SSPRK22

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 Heun’s method or the explicit midpoint method. SSP methods are designed to preserve stability properties (like total variation diminishing - TVD) when solving hyperbolic PDEs with spatial discretizations that have strong stability properties. Also effective as a general-purpose low-order explicit method.

Characteristics

  • Order: 2

  • Stages: 2

  • Explicit (SSP)

  • Fixed timestep only

  • SSP coefficient: \(C = 1\)

  • Good balance of simplicity, cost, and stability

When to Use

  • Hyperbolic PDEs: Ideal for shock-capturing schemes and conservation laws

  • TVD/SSP requirements: When preserving monotonicity or boundedness is critical

  • Discontinuous solutions: Shocks, contact discontinuities, rarefactions

  • Method of lines: Time integration of spatially discretized PDEs

Note

Computational fluid dynamics, shallow water equations, traffic flow, Burgers’ equation, Euler equations.

References

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]