sde_implicit_euler_step#
- class braintools.quad.sde_implicit_euler_step(df, dg, y, t, *args, max_iter=2, **kwargs)#
Implicit (drift-implicit) Euler–Maruyama step via fixed-point iteration.
Solves
y_{n+1} = y_n + f(y_{n+1}, t_{n+1}) dt + g(y_n, t_n) dWusing a few fixed-point iterations starting from an explicit predictor.- Parameters:
df (
Callable[[PyTree,float|Quantity,...],PyTree]) – Drift functionf(y, t, *args).dg (
Callable[[PyTree,float|Quantity,...],PyTree]) – Diffusion functiong(y, t, *args).y (
PyTree) – Current state.t (
float|Quantity) – Current time.*args – Extra arguments forwarded to
dfanddg.max_iter (
int) – Number of fixed-point iterations for the implicit corrector.
- Returns:
The updated state
y_{n+1}.- Return type:
PyTree
Notes
The implicit drift stage is solved by a simple Picard (fixed-point) iteration. This iteration converges only when the drift is contractive over the step, i.e. roughly
|∂f/∂y| dt < 1. For stiff problems (|∂f/∂y| dt >= 1) it diverges regardless ofmax_iter; reducedtor supply a true nonlinear solver (e.g. Newton) instead. Increasingmax_iteronly refines an already-converging iteration.Diffusion is treated explicitly with
g(y_n, t_n) dW.