Chapter 7. Introduction To Spectral Methods
Chapter 7. Introduction To Spectral Methods
(2)
where U
j
is the coefficient for basis function
j
, and is usually independent of x (i.e., a
function of t only for time dependent problems). The spatial dependency of u is
represented by the basis functions.
The error of (2) satisfying (1) is
1
( ) ( )
N
j j
j
e L U x f x
j \
, (
( ,
. (3)
Galerkin procedure requires that the error be orthogonal to each basis function, or in
another word, the error is a residual that cannot be expressed in terms of the given set of
finite basis functions
7-2
0
b
N i
a
e dx
j \
, (
( ,
for i =1, , N (5)
(5) is a set of N algebraic equations for Uj. When the operator L includes time
derivatives, we have a set of coupled ODE's for Uj.
7.3. Choices of basis functions
Spectral method uses orthogonal Fourier series ( in term of sine-cosine or e
-ikx
) as
the basis function.
Other local basis functions can be chosen, e.g., piecewise linear basis function
The latter gives rise to the finite element method.
Two main branches of Galerkin methods:
Galerkin
Spectral Finite Element
- pure spectral - fixed
- pseudo-spectral - moving
(using global basis functions) (wide choices of elements,
local basis functions)
7-3
7.4. Discrete or Finite Fourier Transform
Before we look at the actual use of spectral method to solve PDEs, we need to review /
introduce the discrete Fourier transform.
Assume we have a set of uniformly spaced grid points in 1-D:
x
j
= j x, j = 1, 2, , N (6)
where Nx = L.
We assume the functions we deal with are periodic with a period of L, which implies that
x = 0 and x = L = N x are equivalent points.
To write a Fourier series for a function f(x) whose values are given only at N grid points
requires only N Fourier coefficients. For generality, f(x) is allowed to be complex. The
series is
1
( )
n j
N
ik x
j j n
n
f x f F e
(7)
where F
n
are the coefficients of the Fourier components, or the spectral coefficients.
The values of k
n
should be properly chosen so that the Fourier components satisfy the
periodic condition, and for computational reasons equally spaced. The following set of
values meet these requirements:
2
n
n
k
N x
n=1,2,, N (8)
and the series (7) becomes
2
2 /
1 1
( )
n
N N
i j x
i nj N
N x
j j n n
n n
f x f F e F e
for j =1, 2, , N (9)
(9) is an expression of f in terms of a series of Fourier components .
The inverse of (9) is
2 /
1
1
N
i nj N
n j
j
F f e
N
, (13)
where the basis functions are
( )
inkx
n
x e , (14)
for
2
, k L N x
L
, x = j x (k
n
in the previous section = n k here).
Substitute (13) into (11)
1
0
N
inkx inkx n
n
n
dU
e cinkU e
dt
, ]
+
, ]
]
(15)
Because of the linear independence or by requiring the error be orthogonal to each basis
function [eq(5)], we have
7-5
0
inkx inkx n
n
dU
e cinkU e
dt
+ for n=1, , N (16)
where is a set of N ODE's for the coefficients U
n
.
Finite difference is usually used for the time derivative. After U
n
is obtained, u(x,t) is
obtained from (8). Note for simple linear equation such as (11), (13) needs to be
evaluated on at the output times. The inverse transform for U
n
needs to be performed
once at the initial time.
Notes:
Galerkin method leads naturally to energy conservation (see discussion in pages 186-187
of Haltiner and Williams), and the time integration of ODE is also subject to stability
condition.
Now let's consider nonlinear advection equation (12).
Equivalent of (15):
1 1 1
0
N N N
inkx inkx inkx n
n n
n n n
dU
e U e inkU e
dt
j \j \
+
, (, (
( ,( ,
(17)
The multiplication of two spectral series in the second term leads to N
2
terms!! And it is
expensive to evaluate (note that for the linear equation, we do not need to evaluate this
series every time step). We end up with equations for N
2
coefficients because wave
interactions generate new waves.
(17) represents creation of new waves via nonlinear interaction
Aliasing can be prevented by dropping waves numbers n>N (spectral filtering)
The need to evaluate spectral series due to the nonlinear advection makes the spectral
method unattractive for practical use, unless the transform method was invented!
The other development that made spectral method practical is the Fast Fourier transform
(FFT) algorithms.
7-6
Transform Method
In practice, the series multiplication in the nonlinear advection term is seldom directly
evaluated. A transform method was invented that makes practical use of spectral method
in numerical models practical.
For the advection term
u
u
x
(18)
(uv) is then expanded in a spectral series:
1
( )
N
inkx
n
n N
uv V e