pathsim.solvers.rk4 module

class pathsim.solvers.rk4.RK4(*solver_args, **solver_kwargs)[source]

Bases: ExplicitRungeKutta

‘The’ classical 4-th order 4-stage Runge-Kutta method.

interpolate(r, dt)[source]

Interpolate solution after successful timestep as a ratio in the interval [t, t+dt].

This is especially relevant for Runge-Kutta solvers that have a higher order interpolant. Otherwise this is just linear interpolation using the buffered state.

Parameters:
  • r (float) – ration for interpolation within timestep

  • dt (float) – integration timestep

Returns:

x – interpolated state

Return type:

numeric, array[numeric]