ode_dopri5_step

Contents

ode_dopri5_step#

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

Dormand–Prince embedded Runge–Kutta 5(4) step (DOPRI5/ode45).

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 (y5 - y4).

Returns:

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

Return type:

PyTree or tuple