Expand description
Spectral methods — FFT-based PDE solving for periodic domains.
Functions§
- dft
- 1D Discrete Fourier Transform (naive O(n²) — for correctness; production uses FFT).
- idft
- 1D Inverse DFT.
- power_
spectrum - Power spectrum (magnitude² of DFT coefficients).
- spectral_
heat_ step - Solve the 1D heat equation spectrally: u_t = α * u_xx on periodic domain [0, L].