Pseudospectral method (source code)

= Pseudospectral method

A <pseudospectral method> represents an approximate solution through a global basis or its interpolating values and imposes equations at selected collocation points. In a periodic problem the basis is often a <Fourier series>; on an interval, polynomial collocation is common. The adjective spectral refers to the representation, not to computing the eigenvalues of an arbitrary matrix.<Spectral Methods in MATLAB by Lloyd N. Trefethen>[Author's description and sample chapters on spectral differentiation and collocation]{ref}

For periodic data at $x_j=2\pi j/N$, the <discrete Fourier transform> gives coefficients $\widehat u_k$ of a trigonometric interpolant. Its derivative is obtained by multiplying coefficient $k$ by $ik$ and transforming back. For nonlinear equations, products can be evaluated on the physical grid, while derivatives are computed in Fourier coordinates. A <Fast Fourier transform> makes these representation changes efficient.

The grid can confuse unresolved frequencies with resolved ones. With $N=8$, take $u(x)=\cos(3x)$. Its exact square is
$$
u(x)^2=\frac12+\frac12\cos(6x).
$$
At the eight grid points, $\cos(6x_j)=\cos(2x_j)$, so the sampled product appears to contain wave number $2$ instead of $6$. This is <aliasing> created by the nonlinear product, even though the input wave number $3$ was representable. Additional grid resolution, padding or appropriate filtering is needed when such products are used to evolve retained modes.

For sufficiently smooth solutions, spectral representations can converge rapidly as resolution increases. Discontinuities, boundary incompatibilities and unresolved fine structure change that behavior. A <pseudospectral method> therefore needs checks on both approximation error and the nonlinear operations performed on its grid.