Skip to main content

Module ode_pde

Module ode_pde 

Source
Expand description

ODE and PDE solver kernels.

Provides CPU-side implementations of numerical methods for ordinary and partial differential equations. In production these algorithms would generate PTX kernels for GPU execution; the CPU reference implementations here ensure correctness and serve as the algorithmic specification.

§ODE solvers

  • Euler — first-order forward Euler
  • RK4 — classical fourth-order Runge-Kutta
  • RK45 — Dormand-Prince 4(5) with adaptive step-size control
  • Implicit Euler — backward Euler for stiff systems (Newton iteration)
  • BDF2 — second-order backward differentiation formula

§PDE solvers

  • Heat equation (1-D) — explicit FTCS and implicit Crank-Nicolson
  • Wave equation (1-D) — leapfrog / Störmer-Verlet
  • Poisson equation (1-D) — direct tridiagonal solve
  • Advection equation (1-D) — first-order upwind and Lax-Wendroff

Structs§

AdvectionEquation1D
1-D advection equation solver: du/dt + a * du/dx = 0.
Bdf2Solver
Second-order backward differentiation formula (BDF2) solver.
EulerSolver
Forward Euler solver.
Grid1D
One-dimensional uniform grid.
Grid2D
Two-dimensional uniform grid.
HeatEquation1D
1-D heat equation solver: du/dt = alpha * d²u/dx².
ImplicitEulerSolver
Backward (implicit) Euler solver — suitable for stiff systems.
OdeConfig
Configuration for an ODE integration.
OdeSolution
Solution returned by an ODE solver.
PdeConfig
Configuration for a 1-D PDE solve.
Poisson1D
1-D Poisson equation solver: -u’’ = f, with boundary conditions.
Rk4Solver
Classical fourth-order Runge-Kutta solver.
Rk45Solver
Dormand-Prince 4(5) adaptive solver (RK45).
StepResult
Result of a single integration step (adaptive methods).
WaveEquation1D
1-D wave equation solver: d²u/dt² = c² * d²u/dx².

Enums§

BoundaryCondition
Boundary condition type.
OdeMethod
Integration method selector.

Traits§

OdeSystem
Right-hand side of an ODE system dy/dt = f(t, y).

Functions§

numerical_jacobian
Compute the numerical Jacobian of an ODE system by finite differences.
solve_tridiagonal
Solve a tridiagonal system using the Thomas algorithm.