sde_tamed_euler_step

sde_tamed_euler_step#

class braintools.quad.sde_tamed_euler_step(df, dg, y, t, *args, **kwargs)#

Tamed Euler–Maruyama step (drift taming for superlinear growth).

Applies componentwise taming to the drift to prevent explosion when the drift exhibits superlinear growth:

y_{n+1} = y_n + [f(y_n, t_n) / (1 + dt * |f(y_n, t_n)|)] dt + g(y_n, t_n) dW_n.

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.

Returns:

The updated state y_{n+1}.

Return type:

PyTree

Notes

  • Taming is performed elementwise via f / (1 + dt * |f|) on each leaf.

  • Uses Brownian increment dW ~ Normal(0, dt) per leaf.