ode_dopri8_step

Contents

ode_dopri8_step#

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

Dormand–Prince 8(7) (DOP853) one-step integrator with error estimate.

Implements the explicit 8th-order Dormand–Prince method with an embedded lower-order estimator as used in DOP853. Coefficients are taken from the standard tableau and applied per PyTree leaf with broadcasting.

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

  • y (PyTree) – Current state.

  • 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 an error estimate PyTree computed from the embedded formulas.

Returns:

8th-order solution after one step. If return_error is True, returns (y_next, error_estimate).

Return type:

PyTree or tuple

Notes

Uses dt = brainstate.environ.get_dt() for the step size. Error estimate follows the DOP853 strategy combining 5th- and 3rd-order differences.