spectral.RK3#

class spectral.RK3[source]#

Bases: TimeIntegrator

3rd-order Strong Stability Preserving Runge-Kutta (SSP-RK3).

This explicit three-stage method preserves strong stability properties, making it particularly suitable for hyperbolic PDEs and problems requiring positivity preservation. The method is 3rd-order accurate in time.

Notes

The SSP property ensures that the numerical solution satisfies the same stability bounds as forward Euler under a modified time step restriction. This is particularly useful for problems with steep gradients or shocks.

References

Engsig-Karup, “Lecture 5: Initial Value Problems”, p. 63

Methods

__init__

Initialize time integrator.

step

Take one time step.

Examples using spectral.RK3#

Generate KdV Soliton Samples (RK4, RK3)

Generate KdV Soliton Samples (RK4, RK3)

Spatial and Temporal Convergence for Fourier KdV Solver

Spatial and Temporal Convergence for Fourier KdV Solver

Single Soliton Error and Conservation Analysis

Single Soliton Error and Conservation Analysis

Profiling Script: Single Soliton KdV Solver

Profiling Script: Single Soliton KdV Solver

Scalability Analysis: Time per Step vs Grid Size

Scalability Analysis: Time per Step vs Grid Size

Work-Precision Analysis: RK3 vs RK4 with Varying Grid Resolution

Work-Precision Analysis: RK3 vs RK4 with Varying Grid Resolution
step(rhs: Callable, u: ndarray, t: float, dt: float) ndarray[source]#

Take one time step.

Parameters:
rhsCallable

Right-hand side function f(u, t)

unp.ndarray

Current solution

tfloat

Current time

dtfloat

Time step

Returns:
np.ndarray

Solution at next time step