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

  • Uses a simple Picard iteration; for stiff problems increase max_iter or provide a more robust nonlinear solver.

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