Professional Documents
Culture Documents
An example:
Find the 2⇡-periodic solutions of
a(u, v ) = L(v ), 8v 2 V ,
where Z Z
2⇡ 2⇡
0 0
a(u, v ) = (u v̄ + ru v̄ )dx, L(v ) = f v̄ dx.
0 0
Introduce the Fourier expansion of u,
1
X 1
X
ikx
u(x) = ûk e = ûk k (x), with k (x) = e ikx .
k= 1 k= 1
Analytic solution
Remember the orthogonality condition:
Z 2⇡ Z 2⇡
¯
k (x) ` (x)dx = e ikx e i`x
dx = 2⇡ k` ,
0 0
Similarly,
Z 2⇡
L(v ) = f (x)e i`x
dx = 2⇡ fˆ` .
0
Hence,
1 ˆ
ûk = fk , k = 0, ±1, ±2, . . .
k2 +r
About the analytic solution
The example was: find the 2⇡-periodic solutions of
1 ˆ
ûk = fk , k = 0, ±1, ±2, . . . .
k2 + r
+1
X +1
X +1
X
|fˆk |2
k 2p+4 2
|ûk | = k 2p+4
2 2
< k 2p |fˆk |2 < 1
(k + r )
k= 1 k= 1 k= 1
Galerkin’s method
N/2
X
Apply now Galerkin’s method with VN = {v |v = v̂k e ikx }:
k= N/2
Introduce an expansion of u 2 VN ,
N/2
X
u(x) = ûkN e ikx .
k= N/2
Theorem
- For all square integrable functions f ,
4
keN k kf k
N2
(quadratic convergence).
p
- If f 2 Hper (0, 2⇡):
(p+1)
O N .
X X |fˆk |2
2 2
keN k = 2⇡ |ûk | = 2⇡
(k 2 + r )2
|k|>N/2 |k|>N/2
1 2 16
2 2
kf k 4
kf k2
(N /4 + r ) N
p
- If f 2 Hper (0, 2⇡):
X |fˆk |2 X k 2p |fˆk |2
keN k2 = 2⇡ = 2⇡
(k 2 + r )2 k 2p (k 2 + r )2
|k|>N/2 |k|>N/2
2⇡ X C (p)2
2pˆ 2
k |fk | 2p+2
(N/2) (N 2 /4 + r )2
2p N
|k|>N/2
Galerkin’s method in practice
- Due to the structure of the FFT method, most efficient when N
even, and preferably even N = 2m .
- Therefore, one normally uses expansions.
N/2 1
X
u(x) = ûk e ikx .
k= N/2
- To make sure that the function stays real valued if all coefficients
and initial conditions are real valued, one would set û N/2 = 0.
Compare to interpolation.
- Error results on last few slides based on continuous Fourier coe↵s.
But in practice, will have DFT coe↵s. Similar results.
Collocation method
- Consider again the equation u 00 + ru = f .
PN/2 1
- Ansatz as before uN = k= N/2 ûkN e ikx .
- Collocation: Use test functions vj (x) = (x xj ) for xj = jh ⇡,
h = 2⇡/N. Equivalently,
@u @u @2u
+u ⌫ =0
@t @x @x 2
Expanding u as u N , multiply by a test function and integrate, and using
orthogonality of the complex exponentials, we get
✓ \ N
◆
d @u
ûk + u N + ⌫k 2 ûk = 0, k= N/2, . . . , N/2 1
dt @x k
where
✓ \ ◆ Z 2⇡
@u N 1 @u N
u N = uN e ikx
dx
@x k 2⇡ 0 @x
is the kth Fourier coefficient for the nonlinear term.
For non-linear PDEs, the collocation approach and Galerkin approach
might not coincide.
Non-linear term
- Consider a term w (x) = u(x)v (x).
- We have that
Z 2⇡
d) = 1
ŵk = (uv uve ikx
dx
k
2⇡ 0
which yields
X
d) =
(uv ûm v̂n , N/2 k, m, n < N/2
k
m+n=k
and define
Wj = U j V j , j = 0, 1, . . . , N 1,
and N 1
1 X ikxj
Ŵk = Wj e , k= N/2, . . . , N/2 1
N
j=0
where xj = 2⇡j/N.
Use of the discrete orthogonality condition leads to
X X X
Ŵk = ûm v̂n + ûm v̂n = ŵk + ûm v̂n
m+n=k m+n=k±N m+n=k±N
| {z }
Aliasing error
Removal of aliasing errors by padding
Introduce M where M > N. Introduce the discrete transforms
M/2 1 M/2 1
X X
ikxj
Uj = ũk (t)e , Vj = ṽk (t)e ikxj , j = 0, 1, . . . , M 1,
k= M/2 k= M/2
and define
W j = U j vj , j = 0, 1, . . . , M 1,
where yj = 2⇡j/M, and
( (
ûk if N/2 k < N/2, v̂k if N/2 k < N/2,
ũk = ṽk =
0, otherwise. 0, otherwise.
Let M 1
1 X ikyj
W̃k = Wj e , k= M/2, . . . , M/2 1.
M
j=0
If we define:
Ŵk = W̃k , k= N/2, . . . , N/2 1,
and M 3N/2, then the aliasing errors are removed.
This is discretized by
@u N
+ u N DN u N ⌫DN2 u N = 0,
@t x=xj
@u 1 @ 2 @2u
+ (u ) ⌫ = 0,
@t 2 @x @x 2
the collocation discretization becomes,
@U 1
+ DN (U · U) ⌫DN2 U = 0.
@t 2
These two discretizations are not equivalent, even if the two forms of the
PDE are.
Comments on time-stepping
- For linear PDEs, taking the Galerkin view point, and solving ODEs
for the Fourier coefficients, one needs to transform back to physical
space only when the solution is needed, and not in each time step.
Very cheap!
- For non-linear PDEs, both with a pseudo-spectral treatment in the
Galerkin approach, or using the collocation formulation, FFTs will be
needed in each time step to go in between physical space and real
space.
where c0 = 2 and ck = 1, k 1.
- The quadrature points are taken e.g. as the Gauss-Lobatto points,
xj = cos ⇡j
N , j = 0, . . . , N.
Then the Fast Fourier Transform can be applied in the computations.