Textbooks: A First Course in the Numerical Analysis of Differential Equations, by Arieh Iserles
and Introduction to Mathematical Modelling with Differential Equations, by Lennart Edsberg
c Gustaf Söderlind, Numerical Analysis, Mathematical Sciences, Lund University, 2008-09
◮ Elliptic
∆u = 0 + BC
◮ Parabolic
ut = ∆u + BC & IC
◮ Hyperbolic
utt = ∆u + BC & IC
ut + a(u)ux = 0 + BC & IC
Stiffness
Always use A–stable time-stepping methods
Shocks
Solutions may be discontinuous – example: “sonic boom”
Turbulence
Multiscale phenomena
∂2 ∂2 ∂2
Laplacian ∆= 2
+ 2+ 2
∂x ∂y ∂z
Laplace equation ∆u = 0
with boundary conditions u = u0 (x, y, z) x, y, z ∈ ∂Ω
◮ Equilibrium problems
Structural analysis (strength of materials)
Heat distribution
◮ Potential problems
Potential flow (inviscid, subsonic flow)
Electromagnetics (fields, radiation)
◮ Eigenvalue problems
Acoustics
Microphysics
∂ 2u ∂ 2u
2
+ 2 = f (x, y)
∂x ∂y
yj+1
yj
yj−1
xi−1 xi xi+1
Numerical Methods for Differential Equations – p. 12/50
Computational “stencil” for ∆x = ∆y
1 “Five-point operator”
1 −4 1
Strong form
−∆u = f ; u = 0 on ∂Ω
Take v with v = 0 on ∂Ω
Z Z
−∆u · v = f ·v
Ω Ω
−hu′′ , vi = hu′ , v ′ i
a(v, u) = hv, f i
Kc = F
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Diffusion equation ut = ∆u
Nonlinear diffusion
ut = div (k(u)gradu)
◮ Diffusive processes
Heat conduction ut = d · uxx
◮ Chemical reactions
Reaction–diffusion ut = d · uxx + f (u)
1
Convection–diffusion ut = ux + u
Pe xx
Equation ut = uxx
Initial values u(x, 0) = g(x)
Boundary values u(0, t) = u(1, t) = 0
Ṫ X ′′
ut = X Ṫ , uxx = X ′′ T ⇒ = =: λ
T X
λt
√ √
T = Ce X = A sin −λ x + B cos −λ x
Boundary values
X(0) = X(1) = 0 ⇒ λk = −(kπ)2 , therefore
√ −(kπ)2 t
Xk (x) = 2 sin kπx Tk (t) = e
Initial values
P∞ √
Fourier expansion g(x) = 1 ck 2 sin kπx ⇒
√ X∞
−(kπ)2 t
u(x, t) = 2 ck e sin kπx
k=1
4
t
0
0 1 2 3 4 5 6 7
x
tj+1
tj
xi−1 xi xi+1
1
Courant number µ = ∆t/∆x2
−µ 2µ−1 −µ
2 kπ
2
Recall λk [T∆x ] = −4(N + 1) sin for k = 1 : N
2(N + 1)
1
4∆t 2 0.5
∆t · λk ∈ − 2
, −π ∆t S
∆x
Im
0
−0.5
−1
−1.5
−2.5 −2 −1.5 −1 −0.5 0 0.5
Re
0.8
0.6
0.4
0.2
0
1
0.8 0.1
0.6 0.08
0.4 0.06
0.04
0.2
0.02
0 0
Numerical Methods for Differential Equations – p. 31/50
Violating the CFL condition. Instability
N = 30 internal pts in [0, 1], M = 184 time steps on [0, 0.1]
Unstable solution at CFL = .522
0.8
0.6
0.4
0.2
−0.2
−0.4
1
0.8 0.1
0.6 0.08
0.4 0.06
0.04
0.2
0.02
0 0
Numerical Methods for Differential Equations – p. 32/50
Crank–Nicolson method (1947)
Taylor expansion
∆t ∆x2
−li,j = ut − uxx + utt + uxxxx + O(∆t2 , ∆x4 )
2 12
Therefore
∆t ∆x2
−li,j = utt + uxxxx + O(∆t2 , ∆x4 )
2 12
Conclusion
Consistency li,j → 0 as ∆t, ∆x → 0
Stability CFL condition ∆t/∆x2 ≤ 1/2
Convergence ei,j → 0 as ∆t, ∆x → 0
Suppose
◮ order of SD scheme for spatial variables is p1
◮ order of ODE time discretization is p2
∆t
uj+1
i = uji + 2
[(uj
i−1 − 2uj
i + uj
i+1 ) + (uj+1
i−1 − 2uj+1
i + uj+1
i+1 )]
2∆x
tj+1
tj
xi−1 xi xi+1
Numerical Methods for Differential Equations – p. 40/50
Crank–Nicolson. Stability
µ −1 µ
Aµ = (I − T ) (I + T ) with usual Toeplitz matrix T
2 2
1 + µ2 λ[T ]
Theorem The eigenvalues are λ[Aµ ] =
1 − µ2 λ[T ]
0.8
0.6
0.4
0.2
0
1
0.8 0.1
0.6 0.08
0.4 0.06
0.04
0.2
0.02
0 0
Numerical Methods for Differential Equations – p. 42/50
7. Parabolic problems. FEM
B∆x ċ + K∆x c = 0
Simplest case
Piecewise linear basis functions on equidistant grid
1
K∆x = tridiag(−1 2 −1)
∆x
∆x
B∆x = tridiag(1 4 1)
6
B∆x ċ + K∆x c = 0
Explicit Euler
∆t
B∆x (cn+1 − cn ) = − · K∆x (cn + cn+1 )
2
∆t ∆t
(B∆x + K∆x )cn+1 = (B∆x − K∆x )cn
2 2
on every step
(
wt = Lw + f, w(x, 0) = h(x)
Suppose
vt = Lv + f, v(x, 0) = h(x) + g(x)
√ X∞
−(kπ)2 t
u(x, t) = 2 ck e sin kπx
k=1
Z 1
kE(t)gk22 = |u(x, t)|2 dx
0
∞ X
X ∞ Z 1
−(k2 +j 2 )π 2 t
= 2 ck cj e sin kπx sin jπx dx
k=1 j=1 0
∞
X ∞
X
2 −2(kπ)2 t
= ck e ≤ c2k = kgk22
k=1 k=1