API Reference¶
Only routines declared in src/sdepack.pyf are exported to Python.
Exported routines¶
rk1_ti_solverk1_tv_solverk2_ti_solverk2_tv_solverk3_ti_solverk4_ti_solverk4_tv_solve
Common interface¶
All solvers write to X(0:N) in place with step size:
Common arguments¶
F,G: external drift and diffusion callbacksX(0:N): solution arrayT0,TN: interval endpointsX0: initial conditionN: number of stepsQ: noise intensity parameterSEED: integer RNG seed
Time-invariant solvers¶
Solve:
RK1_TI_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Euler-Maruyama / RK1:
with \(A_{21}=1\), \(Q_1=1\).
RK2_TI_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Two-stage SRK:
with \(A_{21}=1\), \(A_{31}=0.5\), \(A_{32}=0.5\), \(Q_1=Q_2=2\).
RK3_TI_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Three-stage SRK:
coefficients:
noise coefficients:
RK4_TI_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Four-stage SRK:
Kasdin time-invariant coefficients in code:
Time-variant solvers¶
Solve:
RK1_TV_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Euler-Maruyama with time-dependent coefficients:
with \(A_{21}=1\), \(Q_1=1\).
RK2_TV_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Two-stage time-dependent SRK with the same RK2 weights as the time-invariant method:
RK4_TV_SOLVE(F, G, X, T0, TN, X0, N, Q, SEED)¶
Four-stage time-dependent SRK with Kasdin coefficients for the time-variant method:
Internal helper routines (not exported in sdepack.pyf)¶
R8_UNIFORM(SEED)¶
Returns a uniform random value in \((0,1)\) using Park-Miller LCG with Schrage overflow protection:
R8_NORMAL(SEED)¶
Returns a standard normal variate using Box-Muller transform with cached second value:
References¶
See References for full citations.