ode_heun_step

Contents

ode_heun_step#

class braintools.quad.ode_heun_step(f, y, t, *args, **kwargs)#

Third-order Runge-Kutta (Heun’s RK3) step for ODEs.

Coefficients (c,a,b): - c = [0, 1/3, 2/3] - a21 = 1/3; a32 = 2/3 - b = [1/4, 0, 3/4]

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.

Returns:

The updated state after one RK3 (Heun) step.

Return type:

PyTree

See also

ode_rk3_step

A different third-order RK scheme.

ode_rk4_step

Classical fourth-order Runge-Kutta.