sde_heun_step#
- class braintools.quad.sde_heun_step(df, dg, y, t, *args, sde_type='ito', **kwargs)#
Stochastic Heun (predictor–corrector) step.
Implements a predictor–corrector scheme. For Stratonovich SDEs, both drift and diffusion are averaged between the predictor and corrector; for Itô SDEs only the drift is averaged while diffusion is evaluated at the start.
Predictor#
y* = y + f(y, t) dt + g(y, t) dWCorrector#
Itô:
y_{n+1} = y + 0.5 (f(y, t) + f(y*, t+dt)) dt + g(y, t) dWStratonovich:
y_{n+1} = y + 0.5 (f(y, t) + f(y*, t+dt)) dt + 0.5 (g(y, t) + g(y*, t+dt)) dW
- param df:
Drift function
f(y, t, *args).- type df:
- param dg:
Diffusion function
g(y, t, *args).- type dg:
- param y:
Current state.
- type y:
PyTree- param t:
Current time.
- type t:
float|Quantity- type *args:
- param *args:
Extra arguments forwarded to
dfanddg.- param sde_type:
Interpretation of the SDE.
- type sde_type:
- returns:
The updated state
y_{n+1}.- rtype:
PyTree