# The Azimuth Project Spectral methods for PDEs (Rev #8, changes)

Showing changes from revision #7 to #8: Added | Removed | Changed

# Contents

## Idea

Spectral methods are methods for the numerical approximation of partial differential equations. They are important for the solution of the Navier-Stokes equations in meteorology and in climate models.

The basic idea of spectral methods is to choose a finite set of functions and calculate the optimal approximation of the exact solution by these functions. These basis functions are often part of an orthonormal basis of a Hilbert space, and more specifically trigonometric functions, hence the name “spectral” methods.

## Details

### Introduction for Pure Functional Analysts

The following paragraph is meant as an introduction to the method for pure mathematicians with a background in functional analysis.

For illustrative purposes we will make some simplifying assumptions. Let’s assume that we have an infinite topological vector space T, its topological dual $T^*$ and a (closable densely defined differential) operator

$A: D \subset T \to T$

with a unique solution of the equation

$A(f) = 0$

We omit initial and boundary conditions for the moment. In order to calculate an approximation to the exact solution $f$, we need to turn the infinite dimensional problem to a finite dimensional one.

The basic idea of spectral methods is to choose a finite dimensional subspace $T_g$ of T spanned by a given set of functions $\{g_1, ..., g_n \}$, which are called in this context trial, expansion or approximation functions. We are looking for the projection of the exact solution $f$ to the subspace $T_g$, but since we don’t know $f$, we cannot calculate the exact expansion

$f = \sum_{k = 1}^n \alpha_k g_k$

But we can test the goodness of a given approximation $f_{\alpha} := \sum_{k = 1}^n \alpha_k g_k$ by testing $M(f_{\alpha})$ for “smallness”. This function is sometimes called theresidual function.

The Different “smallness” test in spectral methods is differ done mainly via in a their choice interpretation of a “smallness” finite and dimensional their subspace strategy to determine the best approximation.$T^*_h$ of the dual space $T^*$ spanned by the elements $\{h_1, ..., h_n \}$, we then demand that

One particular “smallness” test in spectral methods is done via a choice of a finite dimensional subspace $T^*_h$ of the dual space $T^*$ spanned by the elements $\{h_1, ..., h_n \}$, we then demand that

$\langle \; M(f_{\alpha}), \; h_i \; \rangle = 0$

should hold for all $h_i \in T^*_h$. The “functions” $h_i$ are called test or weight functions. Due to the choice of finite dimensional subspaces the problem is reduced to a finite set of (linear) algebraic equations.

### Approximation with Orthonormal Functions in Hilbert Space

Often the function space is a Hilbert space and the approximation functions elements of an orthonormal base. This is the case for example if one uses Fourier series. In some cases it is possible to show that the expansion coefficients of, for example, a smooth function in an orthonormal basis decay exponentially fast. This is sometimes called exponential or spectral accuracy in the literature.

## Examples

### One Dimensional Boundary Problem

We will have a look at an ordinary differential equation on the interval $[-1, 1]$ with boundary conditions:

$u_{xx} - (x^6 + 3 x^2) u = 0$

where we have written $u_{xx}$ for $\frac{d^2 u}{d x^2}$.

The boundary conditions are:

$u(-1) = u(1) = 0$

This problem has an exact solution which is:

$u(x) = \exp{(\frac{1}{4} (x^4 - 1))}$

The first step to calculate an approximate solution using the spectral method is to choose the approximation functions, in this example we choose the polynomials $1, x, x^2$. With this choice, the approximation functions themselves don’t satisfy the boundary conditions, therefore we make another choice and choose as approximation

$u_a := 1 + (1 - x^2) (a_0 + a_1 x + a_2 x^2)$

This way, the boundary conditions are satisfied independently of the approximation coefficients $a_0, a_1, a_2$.

The residual function is of course

$R(a_0, a_1, a_3; x) = \frac{d^2 u_a}{d x^2} - (x^6 + 3 x^2) u_a$

We choose as test functions three Dirac delta functions, which is equivalent to choosing three points $(x_0, x_1, x_2)$ such that the residual function vanishes at these points. This choice has its own name, it is called the collocation or pseudospectral method.

Choosing as collocation points the tuple $(- \frac{1}{2}, 0, \frac{1}{2})$ leads to a system of three linear equations for the approximation coefficients, with the solution:

$a_0 = a_2 = - \frac{784}{3807} \; \text{and} \; a_1 = 0$

The resulting approximation may seem to be crude at first sight, but the following graphic shows that it is actually quite close to the exact solution already:

## References

• Spectral methods

Spectral methods, Wikipedia

, Wikipedia
• Claudio Canuto, M. Yousuff Hussaini, Alfio Quarteroni, Thomas A. Zang: Spectral methods. Fundamentals in single domains. (Springer 2006, ZMATH)

• Claudio Canuto, M. Yousuff Hussaini, Alfio Quarteroni, Thomas A. Zang: Spectral methods. Evolution to complex geometries and applications to fluid dynamics. (Springer 2007, ZMATH)

• David A. Kopriva: Implementing spectral methods for partial differential equations. Algorithms for scientists and engineers. (Springer 2009, ZMATH)

A two volume introduction to the theory of the method, starting with the basics:

• Claudio Canuto, M. Yousuff Hussaini, Alfio Quarteroni, Thomas A. Zang: Spectral methods. Fundamentals in single domains. (Springer 2006, ZMATH)

… and continuing with the explanation of how complex boundary conditions should be handled, with applications to CFD:

• Claudio Canuto, M. Yousuff Hussaini, Alfio Quarteroni, Thomas A. Zang: Spectral methods. Evolution to complex geometries and applications to fluid dynamics. (Springer 2007, ZMATH)

Based on the preceding introduction to the theory, the following volume concentrated on the task of implementing concrete algorithms:

• David A. Kopriva: Implementing spectral methods for partial differential equations. Algorithms for scientists and engineers. (Springer 2009, ZMATH)

An elementary introduction with special emphasis on spherical coordinates (important for GCMs):

• John P. Boyd: Chebyshev and Fourier spectral methods. 2nd rev. ed. (Dover 2001, ZMATH)