Summary
Summary
Summary
• IVP (Initial Value Problem, or Cauchy Problem): is a time depending problem with an
initial data in time.
computing:
δ = b2 − 4ac (2)
the PDE can be classified as:
• δ < 0: Elliptic.
• δ = 0: Parabolic.
• δ > 0: Hyperbolic.
This definition does not include all PDE. For other PDE, technical algebraic manipulations
must be done.
The problem A(u) = f is well posed if, for all data f
• Neumann boundary condition: applied on the derivative (or flux) of the magnitude.
• Fourier (or Robin) boundary condition: linear combination of the two previous ones.
1 of 13
2. Elliptic PDE
2.1 Poisson equation
The Poisson equation, which represents the conductivity of a magnitude, is defined by:
∆u = 0 x ∈ Ω (4)
• G is positive.
• The maximum principle is satisfied: if f ≥ 0 then u ≥ 0, and if f > 0 then u > 0 on ]0, 1[.
• For a right hand side f located in a small zone, the solution u is not equal to 0 all over the
domain.
• If the right hand side f is locally modified, the solution u is modified globally.
3. Parabolic PDE
3.1 Heat equation
To represent the heat equation, where u is the time dependent temperature and κ is the heat
conductivity (it represents the diffusion of a magnitude):
ut − κ∆u = 0 (10)
2 of 13
Considering the 1D initial or boundary problem on I = [0, l] ⊂ R:
ut − κux x = 0 x ∈ I, t > 0
u(x, 0) = φ(x), x ∈ I (11)
u satisfies some BC
where: Z l
2 nπ
An = sin φ(x)dx (13)
l 0 l
Periodic BC:
∞ h nπ nπ i
X nπ 2
u(x, t) = A0 + An cos + Bn sin e−κ( l ) t (14)
l l
n=1
where:
Z l Z l Z l
1 1 nπ 1 nπ
A0 = l φ(x)dx An = cos φ(x)dx Bn = sin φ(x)dx (15)
2 −l l −l l l −l l
Solution in R:
Z ∞
(x − y)2
1 −
u(x, t) = √ φ(y)e 4κt dy (t > 0)
4κπt −∞ (16)
lim u(x, t) = φ(x) (t = 0)
t→0+
Extension in RN : Z
u(x, t) = H(x − y, t)φ(y)dy (17)
RN
where H(x, t) is the fundamental solution of the heat equation:
|x|2
1 −
H(x, t) = N/2
e 4κt t>0 (18)
(4πκt)
0 t<0
3 of 13
3.3 Parabolic regularization
Assuming φ ∈ C(RN ) ∩ L∞ (RN ), then the solution of the heat equation satisfies:
u ∈ C ∞ (RN × (0, ∞)) and lim u(x, t) = φ(x0 ) (19)
(x, t) → (x0 , t)
x0 , x ∈ R, t > 0
This theorem represents an asymptotic behaviour: the solution converges to 0 when t → 0
(which makes sense, since heat is dissipated with time).
It is also important to remark that for φ > 0, then u(x, ε) > 0, ∀x ∈ Ω and ε > 0, which
means that for an initial point which is cold (φ(x) 1) and very far from the heat source, it
becomes immediately hot. Thus we have a propagation of the heat with infinite speed, which
means that this is not a realistic model.
Also, for t ≤ 0 the problem is not well posed, since a solution cannot be obtained. This is
modelled with the backward heat equation (not well posed).
4. Hyperbolic PDE
4.1 Transport and waves equation
The transport equation represents the convection of a magnitude:
ut + c.∇u = 0 x, c ∈ RN t>0 (20)
and the propagation of waves is expressed as:
utt − c2 ∇u = 0 x, c ∈ RN t>0 (21)
Considering the transport equation in 1D:
ut + cux = 0 x, c ∈ R t > 0 (22)
the solution is constant along the characteristic curves:
x + ct → x(t) = ct + x(0) (23)
is equal to: Z t
u0 (x − ct) + f (x + (s − t)c, s)ds
x > ct
u(x, t) = 0Z x (27)
x
1 s
u1 1 − +c f x − s, t − ds x < ct
c 0 c
The interpretation is that the solution corresponds to translate u0 with the quantity ct.
4 of 13
4.4 Regularisation and conservation properties
For ∀t > 0, u(., t) has the same regularity as u0 , so there is not an instantaneous regularisation
like for the parabolic problem, but there is a propagation of a singularity. Two theorems can be
applied:
Reversibility in time: For t < 0, the formula u(x, t) = u0 (x − ct) is still satisfied, so there is a
solution for the transport problem for negative time. This problem is associated to a propagation
with speed −c.
To simplify notation:
unj ≈ u(xj , tn ) (32)
where unj is the approximated solution given by the scheme and u(xj , tn ) is the exact solution.
2. Numerical analysis
2.1 Some definitions
A general finite difference scheme is formally defined by:
n o
n+m
F∆t,∆x uj+k − + −
=0 (33)
m ≤m≤m ,k ≤k≤k+
where the integers m− , m+ , k − and k + define the width of the stencil. The stencil is the point
defined by the couple (j, n).
A FDS is linear if F (u) = 0 is linear with respect to un+m
j+k .
Consistency
5 of 13
The FDS is consistent with the PDE defined by F (u) = 0 if, for every sufficiently regular solution
of this equation, the truncation error of the system, defined by:
F∆t,∆x {u(t + m∆t, x + k∆x)}m− ≤m≤m+ ,k− ≤k≤k+ = 0 (34)
tends to zero uniformly with respect to (t, x) as ∆t and ∆x tend to zero independently. In
n+m
practice, we calculate the truncation error of a scheme by replacing uj+k with its correspondent
Taylor expansion.
Accuracy
The scheme has an accuracy of order p in space and of order q in time if the truncation error
tends to zero as:
o(∆xp + ∆tq ) (35)
when ∆x and ∆t tend to zero.
2.2 Lp Norm
Considering the norm on RN for the numerical solution:
1
N p
X
n
||u ||p = ∆x|unj |p for 1 ≤ p ≤ +∞ (36)
j=1
In practice, p = 2 and p = +∞ are the ones that are used. When p = +∞:
If this condition only holds for steps ∆t and ∆x defined under certain inequalities, the scheme
is conditionally stable.
A two level linear scheme can be written as:
where A is the amplification matrix (value for purely implicit and explicit schemes; such schemes
will be defined hereafter). Since un = An u0 , the stability is:
6 of 13
– Forward and backward schemes (1st order):
∂u uj+1 − uj ∂u uj − uj−1
(xj ) ≈ (xj ) ≈ (42)
∂x ∆x ∂x ∆x
• If all components of b are negative or equal to zero, then all components of the solution U
are negative or equal to zero.
• For u ∈ C 4 ([0, 1]), the solution of the continuous problem and U the approximated solution
given by the linear system:
∆x2
max |u(xi ) − U (xi )| ≤ max |u(4) (x)| (46)
1≤i≤N 96 x∈[0,1]
This convergence is obtained thanks to consistency and stability.
un+1 − ujn−1
∂u j
(xj , tn ) ≈ (47)
∂t 2∆t
7 of 13
4.2 FDS for Heat equation
Considering the heat equation:
∂u ∂2u
−ν 2 =0 (x, t) ∈ (0, 1) × R+
f or ∗
∂t ∂x (49)
u(0, x) = u0 (x) (IC)
u(t, 0) = u(t, 1) = 0 (BC)
We consider u0j = u0 (xj ) (IC) and un0 = unN +1 = 0 (BC). There are two basic types of
schemes:
• Explicit: information at a given time step can be obtained straightforward from the infor-
mation (or solutions) for previous times.
un+1
j − unj unj−1 − 2unj + unj−1
−ν =0 (50)
∆t ∆x2
Although stability and accuracy will be analysed after, it is advanced that:
Implicit scheme
un+1
j − unj un+1 n+1
j−1 − 2uj + un+1
j−1
−ν =0 (51)
∆t ∆x2
• Accuracy: second order in space and first order in time.
DuFort-Frankel
un+1
j − un−1
j unj−1 − 2unj + unj−1
−ν =0 (52)
2∆t ∆x2
• Accuracy: second order in space and second order in time.
Gear scheme
3un+1
j − 4unj + un−1
j unj−1 − 2unj + unj−1
−ν =0 (53)
2∆t ∆x2
• Accuracy: second order in space and first order in time.
θ-scheme for 0 ≤ θ ≤ 1
un+1
j − unj un+1 n+1
j−1 − 2uj + un+1
j−1 unj−1 − 2unj + unj−1
− θν − ν(1 − θ) =0 (54)
∆t ∆x2 ∆x2
• Accuracy: second order in space and first order in time.
8 of 13
• Stability: stable in L2 if 2(1 − 2θ)ν∆t ≤ ∆x2 (for 0 ≤ θ ≤ 1/2) and unconditionally stable
in L2 if 1/2 ≤ θ ≤ 1 (L∞ ?).
• If θ = 0: explicit scheme.
• If θ 6= 0: implicit scheme.
Considering the spacial discretization, it can be obtained the spacial eigenvalue, substituting
the previous expressions and using the Euler’s relations:
d n
û = λ(k)ûnk (58)
dt k
so the time discretization is expressed only as a function of λ(k). Computing the amplification
matrix: n+1 n
u u
= A n−1 (59)
un u
it will be expressed as a function of λ(k). The stability criterion will be:
ρ(A) ≤ 1 (60)
where ρ represents the spectral radius of the matrix (maximum absolute value of the eigenvalues
of the matrix). This stability criterion is called Von-Neumann stability criterion. Such stability
is studied in the homework (see procedure there).
9 of 13
4.5 Convergence of the scheme: Lax theorem
Assuming that the scheme is linear, two level, consistent and stable for a norm ||.||, then the
scheme is convergent in the sense that:
!
∀T > 0 lim sup ||en || =0 (61)
∆t,∆x→0 tn ≤T
where enj = unj − u(tn , xj ) is the error vector. If the scheme has an accuracy of order p in space
and q in time, then for all T > 0 there exists a constant CT such that:
with solution u(x, t) = u0 (x − ct), there are some properties to take into account:
since both the derivative of the solution and the initial condition are the same. The TV
measures the variation of the first derivative, so for first class PDE of this type is constant.
For nonlinear PDE, the TV is not constant, but decreases.
For the transport equation, the CFL condition is not the same as for the parabolic equation;
it is defined as:
c∆t
CF L = (66)
∆x
Explicit scheme
un+1
j − unj unj+1 − unj−1
+c =0 (67)
∆t 2∆x
• Accuracy: second order in space and first order in time.
• Stability: unstable in L2 .
Crank-Nicholson scheme
10 of 13
• Stability: the amplification factor depens on the spatial eigenvalue:
1 + 12 λ∆t
A= (69)
1 − 21 λ∆t
Implicit scheme
un+1
j − unj un+1 n+1
j+1 − uj−1
+c =0 (70)
∆t 2∆x
• Accuracy: second order in space and first order in time.
• Stability: stable in L2 .
un+1
j − unj unj − unj−1
+c =0 (71)
∆t ∆x
• Accuracy: first order in space and first order in time.
• Stability: stable in L2 if CF L ≤ 1, and stable in L∞ if c > 0 and under the same CFL
condition.
• Stability: stable in L2 if CF L ≤ 1, and stable in L∞ if c < 0 and under the same CFL
condition.
Leap-Frog scheme
un+1
j − un−1
j unj+1 − unj−1
+c =0 (73)
2∆t 2∆x
• Accuracy: second order in space and second order in time.
• Stability: stable in L2 if CF L ≤ 1.
Lax-Friedrichs scheme
un n
j−1 +uj+1
un+1
j − 2 unj+1 − unj−1
+c =0 (74)
∆t 2∆x
• Accuracy: second order in space and first order in time.
Lax-Wendroff scheme
un+1
j − unj unj+1 − unj−1 ∆t unj+1 − 2unj + unj−1
+c − c2 =0 (75)
∆t 2∆x 2 ∆x2
• Accuracy: second order in space and second order in time.
11 of 13
6. FDS and Boundary Conditions
Considering the Elliptic (Laplace) equation (although the reasoning is valid for every equation):
00
−u (x) = f (x) for x ∈]0; 1[ uj+1 − 2uj + uj−1
→− = fj (76)
u(0) = 0 u0 (1) = 0 ∆x2
• For i = 0: u0 = 0, so u0 is known.
– First order:
uN +2 − uN +1 uN +1 − uN
u0 (1) = = 0 → uN +1 = uN +2 → = f (xN +1 ) (78)
∆x ∆x2
∆x2
uN +2 = uN +1 + u0 (1)∆x + u00 (1) (79)
2
and since u0 (1) = 0 and u00 (1) = −f (1) = −f (xN +1 ):
∆x2
uN +2 = uN +1 − f (xN +1 ) (80)
2
Substituting in the scheme:
∆x2
uN +1 − − 2uN +1 + uN
2 f (1) 2(uN +1 − uN )
− = f (1) → = f (xN +1 ) (81)
∆x2 ∆x2
The final scheme can be expressed as:
2u1 − u2
= f (x1 )
∆x2
uj+1 − 2uj + uj−1
− = fj (82)
∆x2
u − u 2(uN +1 − uN )
N +1 N
or = f (xN +1 )
∆x 2 ∆x2
The scheme of order 1 introduces an error of order 1 at the BC. Even if the scheme is of order
2, an approximation of order 1 at the boundary implies a global first order error. Therefore, one
must choose a BC conditions that at least the order of the system.
For E = U − Uexact the error vector, it can be proven that:
where C is a constant depending only on f , u and the derivatives of u. The scheme 1 is also not
consistent, since the truncation error near the right boundary condition does not tend to zero
when ∆x → 0.
12 of 13
7. FDS for multidimensional cases
The Heat equation in 2D problem will be considered (although the concept is applicable to every
equation): 2 2u
∂u ∂ u ∂
−ν + 2 = 0 for (x, y, t) ∈ Ω × R+
∗
∂t ∂x2 ∂y
(83)
u(0, x, y) = u0 (x, y) for (x, y) ∈ Ω
u(t, x, y) = 0 for t ∈ R+ (x, y) ∈ ∂Ω
∗
which scheme (explicit) is represented as:
un+1 n
j,k − uj,k unj+1,k − 2unj,k + unj−1,k unj,k+1 − 2unj,k + unj,k−1
−ν −ν =0 (84)
∆t ∆x2 ∆y 2
The new CFL condition for L∞ stability is:
1 1
ν∆t + ≤ CF L2D (85)
∆x2 ∆y 2
Two cases will be considered:
• ∆x ∼ ∆y: the solutions in both directions are of the same order, which makes:
2ν∆t CF L1D 1
2
= 2CF L1D ≤ CF L2D → CF L2D = = (86)
∆x 2 2
so the CFL condition in 2D is more restrictive than the CFL in 1D.
• ∆x ∆y: one solution in one direction is way greater than the other:
ν∆t
= CF L1D ≤ CF L2D → CF L2D = CF L1D = 1 (87)
∆x2
so the 1D scheme is recovered.
8. Equivalent equation
The equivalent equation of a scheme is the equation obtained by adding the principal part of the
truncation error to the model studied (that is, the term with dominant order). As an example,
lets take the Lax-Friedrichs scheme. The original equation and the truncation error are:
un n
j−1 +uj+1
un+1
j − unj+1 − unj−1
2
ut + cux = 0 → +c =0→
∆t 2∆x (88)
∆x2 (c∆t)2
→E=− 1− uxx = νuxx
2∆t 2∆x2
and the equivalent equation:
ut + cux = νuxx → ut + cux − νuxx = 0 (89)
The coefficient of diffusion ν is called numerical diffusion. If it is large, the scheme is diffusive
(or dissipative). The typical behaviour of a diffusive scheme is its tendency to artificially spread
out the initial data in the course of time. The schemes that are too diffusive are therefore bad
schemes. If ∆t is very small, ν may be very large and the scheme is bad as it is too weighted
to the diffusion. The Lax-Friedrichs scheme is a good approximation (order 2) of the equivalent
equation where the coefficient ν is small.
In the case of a dispersive scheme, if the principal part of the truncation error is added to the
equation, then this scheme is not only consistent with this new equivalent equation, but it is also
strictly more accurate. The equivalent equation of the Lax-Wendroff scheme contains a third
order term, called dispersive. The typical behaviour of a dispersive scheme is that it produces
oscillations when the solution is discontinuous. The coefficient of this dispersive term can be
neglected compared to the coefficient of diffusion for the diffusive schemes.
13 of 13