API Reference#
This page provides an overview of the spectral package API.
Spectral Basis Classes#
Classes for spectral methods on different bases.
Legendre-Gauss-Lobatto nodal polynomial basis. |
|
Equispaced Fourier basis on a periodic interval. |
Spectral Differentiation Matrices#
Functions to construct differentiation and mass matrices.
Return Legendre spectral differentiation matrix at arbitrary nodes. |
|
Return Legendre spectral mass matrix using normalized basis. |
|
Construct Fourier differentiation matrix using cotangent identity. |
|
Fourier differentiation matrix rescaled to periodic interval \([a, b]\). |
Boundary Value Problems#
Solvers for boundary value problems (BVPs).
Dense linear BVP system with convenience helpers. |
|
Solve Exercise B: Laplace's equation in polar coordinates using mixed spectral collocation. |
|
Solve Exercise A boundary value problem using Legendre-Gauss-Lobatto collocation. |
|
Solve Exercise A boundary value problem using Legendre tau method. |
|
Solve Exercise B: Laplace's equation in polar coordinates using mixed spectral collocation. |
Time-Dependent PDEs#
Time integrators and PDE solvers.
Time Integrators#
Base class for time integration methods. |
|
Retrieve a time integrator by name. |
|
3rd-order Strong Stability Preserving Runge-Kutta (SSP-RK3). |
|
Classical 4th-order Runge-Kutta method (ERK4). |
KdV Equation Solver#
Korteweg-de Vries equation solver using Fourier spectral methods. |
|
Compute KdV soliton solution. |
|
Initial condition for two-soliton collision simulation. |
Utilities#
Helper functions for I/O, formatting, plotting, and numerical analysis.
Ensure output directory exists, creating it if necessary. |
|
Load simulation data with automatic fallback between parquet and pickle. |
|
Save simulation data to disk. |
|
Extract metadata from a DataFrame. |
|
Format a timestep value as LaTeX scientific notation. |
|
Format a parameter range for display. |
|
Build a parameter string from a dictionary. |
|
Get repository root directory, handling both local and sphinx-gallery execution. |
|
Approximate L2 norm using composite trapezoidal rule. |
|
Compute discrete L2 error between exact and numerical solutions. |
|
Compute discrete \(L^\infty\) (maximum) error. |