0% found this document useful (0 votes)
13 views

Chapter 7. Introduction To Spectral Methods

The document provides an introduction to spectral methods for solving partial differential equations (PDEs). It discusses the Galerkin procedure for representing dependent variables as sums of basis functions. The spectral method uses Fourier series as basis functions. The Galerkin method leads to a set of ordinary differential equations (ODEs) for the coefficients. For nonlinear problems, the transform method is used to avoid directly evaluating multiplication of spectral series. The discrete Fourier transform allows representing functions on a discrete grid. Spectral methods provide exact derivatives and high accuracy but are more complicated to implement than finite difference methods.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Chapter 7. Introduction To Spectral Methods

The document provides an introduction to spectral methods for solving partial differential equations (PDEs). It discusses the Galerkin procedure for representing dependent variables as sums of basis functions. The spectral method uses Fourier series as basis functions. The Galerkin method leads to a set of ordinary differential equations (ODEs) for the coefficients. For nonlinear problems, the transform method is used to avoid directly evaluating multiplication of spectral series. The discrete Fourier transform allows representing functions on a discrete grid. Spectral methods provide exact derivatives and high accuracy but are more complicated to implement than finite difference methods.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

7-1

Chapter 7. Introduction to Spectral Methods



Reference: Durran Chapter 4. Haltiner and Williams Chapter 6.

7.1. Introduction

Grid points method evaluates spatial derivatives using Tayler series expansion

Galerkin method (a super set of spectral method) represents dependent variables
as the sum of a set of functions with pre-specified space structure (basis-function).
We solve the equations (usually ODE's) for the coefficients of these functions.

7.2. Galerkin procedure

For equation

L(u) = f(x), a x b (1)

where L is an operator involving partial derivatives of u.

Consider a set of linearly independent basis-functions
j
(x), so that


1
( ) ( )
N
j j
j
u x U x

(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

for i =1, ., N. (4)



(4) leads to


1
( ) ( ) 0
b b
N
i j j i
j
a a
L U x dx f x 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

for n=1, 2, , N (10)



(10) gives us the spectral coefficients from the grid point values f
j
.
7-4
(9) and (10) defines the finite or discrete Fourier transforms, which are the discretized
analogues of the standard Fourier transform and its inverse. The integral in the
continuous transforms are replaced by sums in the discrete expressions.

(10) can be proven by substituting it into (9) and recognizing the orthogonality of among
the basis functions.

7.5. Spectral Method as Applied to 1-D advection Equation

In this section, we use the discrete Fourier transforms to solve PDEs

We look at linear and nonlinear1-D advection equations:

0
u u
c
t x

+

, (11)
and 0
u u
u
t x

+

. (12)

Consider linear advection equation (11) first.

For a periodic domain L:


1
( , ) ( )
N
inkx
n
n
u x t U t e

, (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

, the spatial derivative is first evaluated at every grid point:




1
N
inkx
n
n
u
v inkU e
x

(18)

(uv) is then expanded in a spectral series:


1
( )
N
inkx
n
n N
uv V e

(Inverse Fourier transform) (19)



where

1
1
( )
2
j
N
inkx
n j
j N
V uv e
N

(Fourier transform) (20)



We end up solving the following ODEs:

0
n
n
dU
V
dt
+ . (21)

With this method, there are 2x( N) operations for the advection term instead of N
2
for the
true spectral method.

Note that it is (20) that is actually evaluated, not (19) because we need V
n
in (21).
7-7

7.6. Advantages and Disadvantages of Spectral Method

Advantages

Derivatives computed exactly
Infinite convergence rate in space (in term of the order of accuracy)
Can pick basis functions that are well-suited for the particular problem, e.g.,
spherical harmonics for flow on a sphere (the negative side is that one does not
have complete freedom to choose the basis function often subject to certain
limitation such as the periodicity condition)
Can obtain power spectra directly
Can control missing, therefore NL instability easily
Can apply spatial filters of very high order easily
Often more accurate than FD method with the same number of degrees of
freedom (grid points versus spectral components)
Conserves energy naturally (see Haltiner and Williams section 6.3)

Disadvantages

More complicated to implement
Can't represent physical processes in spectral space
Hard to parallelize on distributed memory computers
Basis function global, not well suited for handling localized features and/or sharp
gradients (remember the Gibbs phenomenon). FEM and those based on local basis
functions usually do better
Expensive for high resolutions. E.g., the operation count for FFT is proportional
to N ln(N) instead of N as for grid point method a reason why grid point method
is reviving for global models.

You might also like