Lecture 6 (b)

Spectral methods and Function bases

Unstructured grids

  • Most problems have complex domains.

  • Boundary conditions crucial.

  • Little “structure” to problem.

  • What use is “structure” in the grid?

  • Use unstructured grids.

  • But how, whilst keeping accuracy?

An unstructued grid representing parts of the UK

Function bases

A Fourier Series

\[ \phi = \sum_n c_n(t) \chi_n(x) = \sum_{n=-N}^N c_n(t) \exp(\mathrm{i} n x) \]

allow us to compute eg \(\partial_x \phi\) everywhere.

Extend to more complex bases \(\chi_n(x)\) to

  • match geometry better;
  • minimize Gibb’s oscillations;
  • speed up computations.

Coefficients

How does finite \(\{\chi_n \colon n=0,\dots,N\}\) best match solution to

\[ \partial_t \phi + F(\phi) = 0? \]

Case 1: match at points \(x_j\) (colocation).

\[ c_n \chi_n(x_j)=\phi(x_j), \quad \forall x_j, \quad j=0,\dots,N. \]

Gives linear system for \(c_n\).

Case 2: minimise residual \(R(\phi)=\partial_t \phi+F(\phi)\) wrt basis (Galerkin).

\[ \int R(\phi) \chi_m(x) = 0, \quad \forall m = 0, \dots, N. \]

Galerkin methods

Galerkin methods best “on average”. PDE

\[ \partial_t \phi+F(\phi)=0 \]

becomes, for \(\phi = \sum c_n(t) \chi_n(x)\),

\[ \begin{aligned} \sum_n I_{nk} \frac{\mathrm{d} c_n}{\mathrm{d} t} &= - \int F \left( \sum_n c_n \chi_n \right) \chi_k, \quad \forall k, \\ I_{nk} &= \int \chi_n \chi_k \, . \end{aligned} \]

Coupled nonlinear ODEs.

Spectral Convergence

  • Spectral convergence with \(N\).
  • Faster than all \(\Delta x^k \sim N^{-k}\) from eg finite differencing.
  • Timestep limited by “effective resolution”, so \(\Delta t \sim N^{-2}\).
  • Problems with
    • non-smooth solutions;
    • non-smooth domains/boundaries.

A spectral method advects the initial data $\sin^4(2 \pi x)$ around the domain $x \in [0, 1]$ up to $t = 0.5$. Fourier modes $c_n = -N, \dots, N$ are used. Spectral (exponential) convergence with the number of modes is seen. It is also clear that this is much faster than first or second order convergence as indicated on the bottom panel.

Summary

  • Semi-discretization simplifies constructing complex schemes.
  • Function basis methods give solution everywhere using truncated series approximation.
  • Can suffer Gibb’s effects at eg discontinuities.
  • Spectral methods minimize coupling of basis functions.
  • Spectral convergence exponential.
  • Spectral methods often too sensitive for practical use.