step_rk45

Contents

step_rk45#

step_rk45(fun, t, y, f, h)#

Take one step using the RK45 algorithm.

Parameters:
  • fun (callable) – Right-hand side of the system.

  • t (float) – Current time.

  • y (ndarray, shape (n,)) – Current state.

  • f (ndarray, shape (n,)) – Current value of the derivative, i.e., fun(x, y).

  • h (float) – Step to use.

Returns:

  • y_new (ndarray, shape (n,)) – Solution at t + h computed with a higher accuracy.

  • f_new (ndarray, shape (n,)) – Derivative fun(t + h, y_new).

References

E. Hairer, S. P. Norsett G. Wanner, “Solving Ordinary Differential Equations I: Nonstiff Problems”, Sec. II.4.