pathsim.solvers.ssprk22 module

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

Bases: ExplicitRungeKutta

Two-stage, 2nd order, Strong Stability Preserving (SSP) explicit Runge-Kutta method.

Also known as the explicit midpoint method or Heun’s method. SSP methods are designed to preserve stability properties (like total variation diminishing - TVD) when solving hyperbolic PDEs, but are also effective general-purpose low-order explicit methods.

Characteristics:
  • Order: 2

  • Stages: 2

  • Explicit (SSP)

  • Fixed timestep only

  • Good balance of simplicity, cost, and stability (for an explicit 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]