imex_euler_step

Contents

imex_euler_step#

class braintools.quad.imex_euler_step(f_exp, f_imp, y, t, *args, max_iter=2, **kwargs)#

First-order IMEX Euler step (explicit + drift-implicit).

Solves

y_{n+1} = y_n + dt * f_exp(y_n, t_n) + dt * f_imp(y_{n+1}, t_{n+1})

by fixed-point iteration.

Parameters:
  • f_exp (Callable[[PyTree, Array | ndarray | bool | number | bool | int | float | complex | Quantity, Any], PyTree]) – Explicit (nonstiff) part f_exp(y, t, *args).

  • f_imp (Callable[[PyTree, Array | ndarray | bool | number | bool | int | float | complex | Quantity, Any], PyTree]) – Implicit (stiff) part f_imp(y, t, *args) evaluated implicitly at the end of the step.

  • y (PyTree) – Current state.

  • t (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Current time.

  • *args – Extra arguments forwarded to f_exp and f_imp.

  • max_iter (int) – Fixed‑point iterations for the implicit solve.

Returns:

The updated state y_{n+1}.

Return type:

PyTree