Professional Documents
Culture Documents
Summary
The end
Basic principles
Summary
The end
Outline
Basic principles Problem formulation Various numerical methods Various spectral methods How to choose trial functions Two illustrative examples of spectral methods A Fourier Galerkin method for the wave equation A Chebyshev collocation method for the heat equation Summary
Summary
The end
Consider the PDE with boundary condition Lu = f , in u = g, on . Question: How to solve the above PDE numerically? Approximate the unknown u(x, t) by a sum of basis functions:
N
u(x, t) u N (x, t) =
n=0
an (t)n (x)
Summary
The end
Search for solution u N in a nite-dimensional sub-space HN of some Hilbert space H. Trial Functions: basis of HN : (0 , . . . , N )
N
u =
k =0
ak k
Summary
The end
Finite difference: trial functions: overlapping local polynomials of low order Finite element: trial functions: local smooth functions, nearly orthogonal Spectral methods: trial functions: global smooth functions, nearly orthogonal
Summary
The end
Galerkin: n = n , n satisfy some or all of the boundary conditions. Collocation: n = (x xn ), xn are collocation points. Tau: n = n , but n do not satisfy the boundary conditions.
Summary
The end
It is obvious that we would like our trial function sets to have a number of properties: easy to compute rapid convergence completeness
Basic principles
Summary
The end
A Chebyshev collocation method for the heat equation: . . . , comparison with Galerkin method, . . .
Basic principles
Summary
The end
Wave equation
Many evolution equations can be written as u = M(u). t Consider the domain (0, 2) with periodic boundary conditions. The approximate solution u N is represented as
N/2
u N (x, t) =
N/2
ak (t)k (x).
Basic principles
Summary
The end
Weak formulation
In general, u N = M(u N ). t The approximation is obtained by selecting a set of test functions k and requiring that
2
[
0
(1)
Basic principles
Summary
The end
Trigonometric polynomials: k (x) = eikx , 1 k (x) = 2 eikx . If this were merely an approximation problem, then u N (x, t) would be the truncated Fourier series of the known function u(x, t) with
2
ak (t) =
0
However, for the PDE, u(x, t) is not known; the approximation is determined by (1).
Basic principles
Summary
The end
For the linear hyperbolic problem u u = 0, t x i.e.,for M(u) = condition (1) becomes 1 2
2
u , x
[(
0
) t x
N/2
al (t)eilx ]eikx dx = 0,
N/2
Basic principles
Summary
The end
The analytical (spatial) differentiation of the trial functions and the analytical integration of that expression produce the dynamical equations: dak ikak = 0, k = N/2, . . . , N/2. dt The initial conditions are:
2
ak (0) =
0
Basic principles
Summary
The end
The accuracy of the Fourier Galerkin method (1) Use the initial condition u(x, 0) = sin( cos(x)) to illustrate the accuracy of the Fourier Galerkin method for the above hyperbolic equation. The exact solution, u(x, t) = sin( cos(x + t)), has the Fourier expansion
u(x, t) =
k =
ak (t)eikx ,
Basic principles
Summary
The end
The accuracy of the Fourier Galerkin method (2) The Fourier coefcients are ak (t) = sin( k )Jk ()eikt 2
and Jk (t) is the Bessel function of order k . The asymptotic properties of the Bessel functions imply that k p ak (t) 0 as k
u N (x, t) =
N/2
ak (t)eikx
Basic principles
Summary
The end
Comparison with nite difference method An illustrative of the superior accuracy from the spectral method for this problem is given in the following gure.
Figure: Maximum errors for the linear hyperbolic problem at t = 2 for Fourier Galerkin and several nite difference schemes
Basic principles
Summary
The end
Chebyshev polynomials for the heat equation Chebyshev polynomials: Tk (x) = cos(k cos1 x), for k = 0, 1, . . . . The rst few Chebshev polynomials are T0 (x) = 1 T1 (x) = x T2 (x) = 2x 2 1 ... Tn+1 (x) = 2xTn (x) Tn1 (x).
Basic principles
Summary
The end
The approximate solution (1) Given the heat equation u 2 u 2u = 0, i.e., M(u) = t x 2 x 2 on (1, 1) with homogeneous Dirichlet boundary conditions, u(1, t) = 0, u(1, t) = 0. Choosing the trial functions k (x) = Tk (x), k = 0, 1, . . . , N,
u (x, t) =
k =0
ak (t)k (x).
Basic principles
Summary
The end
In the collocation approach the above PDE must be satised exactly by the approximate solution at collocation points xj in the domain of (1, 1): u N M(u N )|x=xj = 0, j = 1, . . . , N 1. t u N (1, t) = 0, u N (1, t) = 0. u N (xk , 0) = u(xk , 0), k = 0, . . . , N. (2)
Basic principles
Summary
The end
jk ). N We can apply Fast Fourier Transform (FFT) to evaluate M(u N )|x=xj . k (xj ) = cos(
Basic principles
Summary
The end
For the particular initial condition u(x, 0) = sin x, the exact solution is u(x, t) = e t sin x. It has the innite Chebyshev expansion
u(x, t) =
k =0
bk (t)Tk (x),
Basic principles
Summary
The end
ck =
Since Jk () is decaying rapidly, the truncated series converges at an exponential rate. A well-designed collocation method will do the same.
Basic principles
Summary
The end
How the Chebyshev collocation approach works (3) A collocation method is implemented in terms of the nodal values uj (t) = u N (xj , t) and we have the expansion
N
u N (x, t) =
j=0
uj (t)j (x),
and now j denote the characteristic Lagrange polynomials with the property j (xi ) = ij for 0 i, j N. The expansion coefcients are given by ak (t) = where ck = 2, 1, k = 0 or N 1k N 1 2 Nc k
N
cl
l=0
ul (t) cos
lk , N
k = 0, 1, . . . , N,
Basic principles
Summary
The end
How the Chebyshev collocation approach works (4) The exact derivative of u N (x, t) becomes 2uN (t) = x 2 where aN+1 (t) = 0, aN (t) = 0, (1) (1) c k ak (t) = ak +2 (t) + 2(k + 1)ak +1 (t), k = N 1, . . . , 0, and aN+1 (t) = 0, aN (t) = 0, (2) (2) (1) c k ak (t) = ak +2 (t) + 2(k + 1)ak +1 (t), k = N 1, . . . , 0.
(2) (2) (1) (1) N
ak (t)Tk (x),
k =0
(2)
Basic principles
Summary
The end
How the Chebyshev collocation approach works (5) The coefcients ak depend linearly on the nodal values ul ; 2 thus, there exists a matrix DN such that 2uN (t)|x=xj = x 2
N (2)
ak (t) cos
k =0
(2)
jk = N
Substituting the above expression into (2), we obtain a system of ODE for the nodal unknowns: duj (t) = dt
N 2 (DN )jl ul (t), l=0
j = 1, . . . , N 1.
Supplemented by the initial conditions, the ODE system for the nodal values of solution is readily integrated in time.
Basic principles
Summary
The end
Comparison with Finite difference method An illustrative of the superior accuracy from the spectral method for this problem is given in the following gure.
Figure: Maximum errors for the heat equation problem at t = 1 for Chebyshev collocation and several nite difference schemes
Basic principles
Summary
The end
Spectral methods have many advantages over FD and FE methods: high accuracy efciency exponential convergency/spectral convergency However, spectral methods also suffers drawbacks in the following folds: coding: more difcult to code than FD cost: costly per degree of freedom than FD geometry: for complicated domains, heavy loss of accuracy
Basic principles
Summary
The end