Theory¶
1) Scalar Itô SDE form¶
All solvers target scalar Itô SDEs:
Within the solver routines the equivalent form is:
where \(Q\) scales the stochastic forcing strength.
For time-invariant routines, \(F(X,t) \to F(X)\) and \(G(X,t) \to G(X)\).
2) Time discretization and noise scaling¶
For \(N\) steps over \([T_0, T_N]\):
Stage noise uses:
giving \(\sqrt{H}\) stochastic scaling once multiplied by \(H\) in the stage equations.
3) RK1 (Euler-Maruyama)¶
For both time-invariant and time-variant variants:
For time-invariant routines, omit the explicit time argument in \(F\) and \(G\).
4) RK2¶
The two-stage update is:
with
5) RK3 (time-invariant)¶
The time-invariant 3-stage method uses:
with coefficients:
and stochastic stage parameters:
6) RK4 (time-invariant and time-variant)¶
The 4-stage update is:
The time-invariant and time-variant methods use different Kasdin coefficient sets (see API Reference).
7) Random number generation¶
R8_UNIFORM and R8_NORMAL are internal Fortran routines; they are not exported to Python.
R8_UNIFORM¶
Park-Miller Lehmer generator:
and returns
Schrage's method avoids integer overflow.
R8_NORMAL¶
Box-Muller transform:
with one value cached for the next call.