ode_rk23_step

Contents

ode_rk23_step#

class braintools.quad.ode_rk23_step(f, y, t, *args, return_error=False, **kwargs)#

Bogacki–Shampine embedded Runge–Kutta 2(3) step (RK23).

Parameters:
  • f (Callable[[PyTree, float | Quantity, ...], PyTree]) – Right-hand side function f(y, t, *args) -> PyTree.

  • y (PyTree) – Current state at time t.

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

  • *args – Additional positional arguments forwarded to f.

  • return_error (bool) – If True, also return a PyTree error estimate (y3 - y2).

Returns:

The updated state (3rd-order). If return_error is True, returns (y_next, error_estimate).

Return type:

PyTree or tuple