sde_implicit_euler_step

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) dW using a few fixed-point iterations starting from an explicit predictor.

Parameters:
  • df (Callable[[PyTree, float | Quantity, ...], PyTree]) – Drift function f(y, t, *args).

  • dg (Callable[[PyTree, float | Quantity, ...], PyTree]) – Diffusion function g(y, t, *args).

  • y (PyTree) – Current state.

  • t (float | Quantity) – Current time.

  • *args – Extra arguments forwarded to df and dg.

  • 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 of max_iter; reduce dt or supply a true nonlinear solver (e.g. Newton) instead. Increasing max_iter only refines an already-converging iteration.

  • Diffusion is treated explicitly with g(y_n, t_n) dW.