pathsim.solvers.ssprk22 module

class pathsim.solvers.ssprk22.SSPRK22(*solver_args, **solver_kwargs)[source]

Bases: ExplicitRungeKutta

Strong Stability Preserving (SSP) 2-nd order two stage (2,2) Runge-Kutta method, also known as the ‘Heun-Method’.

This integrator has a good trade off between speed, accuracy and stability. Especially for non-stiff linear systems, this is probably a great choice.

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]