ode_rk4_38_step

Contents

ode_rk4_38_step#

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

Fourth-order Runge-Kutta (3/8-rule) step for ODEs.

Butcher tableau: - c = [0, 1/3, 2/3, 1] - a21 = 1/3 - a31 = -1/3, a32 = 1 - a41 = 1, a42 = -1, a43 = 1 - b = [1/8, 3/8, 3/8, 1/8]

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 RK4 (3/8 rule) step.

Return type:

PyTree

See also

ode_rk4_step

Classical RK4 (1/6, 1/3, 1/3, 1/6 weights).