Professional Documents
Culture Documents
1 / 17
Lecture 2
∆x 2 00 ∆x k (k )
f (x + ∆x) = f (x) + ∆xf 0 (x) + f (x) + . . . + f (x) + O(∆x k +1 )
2! k!
3 / 17
Lecture 2
4 / 17
Lecture 2
5 / 17
Lecture 2
Accuracy
I The error with the exact solution is given exactly by the remaining terms
in the Taylor expansion : these terms where neglected for the
approximation of the differential operator.
I The order of accuracy of a numerical scheme is given by the order of
truncation of the Taylor expansion.
I Both the Forward and Backward Euler schemes are accurate to the 1rst
order.
Does it mean that the 2 schemes behave the same ? NO !
6 / 17
Lecture 2
I There is no threshold value above which the numerical solution blows up.
8 / 17
Lecture 2
A posteriori analysis
9 / 17
Lecture 2
∂u ∂2 u
=α 2 for x ∈]a; b[, and t > 0
∂t ∂x
With an initial condition : u(x, t 0 ) = U 0 (x), and fixed (Dirichlet) boundary
conditions : u(x0 , t n ) = Ua , and u(xNx , t n ) = Ub .
Notation, as usual :
I Time discretization : t n = t 0 + ndt
I Space discretization : xj = x0 + jdx
I Numerical approximation of the temperature : ujn ' u(xj , t n ).
Thus ujn+1 ' u(xj , t n + dt) and uj±1
n
' u(xj ± dx, t n ).
10 / 17
Lecture 2
αdt n
ujn+1 = ujn + u − 2ujn + uj−1
n
dx 2 j+1
11 / 17
Lecture 2
∂u ujn+1 − ujn ∂2 u
n
uj+1 − 2ujn + uj−1
n
(xj , t n ) ' and (xj , t n
) '
∂t dt ∂x 2 dx 2
The truncated terms are of order O(dt + dx 2 ) :
The Forward Euler scheme is accurate of order 1 in time and 2 in space
I Injecting a particular solution (monochromatic wave) : ujn = ρn e iβx , and
knowing that the heat equation is energy-dissipating : |un+1 | 6 |un |, we
get after some computation :
dx 2
The stability condition for the Forward Euler scheme : dt 6
α2
12 / 17
Lecture 2
αdt 0
uj1 = uj0 + uj+1 − 2uj0 + uj−1
0
2
for j = 1, . . . , Nx − 1
dx
The Forward Euler scheme is said to be explicit because the unknown
un+1 has an explicite formulation involving known terms un . The
computational cost is low !
I The boundary conditions are then solved : in case of Dirichlet boundary
conditions, one has straightforwardly u00 = Ua and uN1 x = Ub
I At this stage, the full numerical solution has been computed for the time
layer t 1 : we have to apply the same process in order to compute the next
time layer t 2 , and so on...
13 / 17
Lecture 2
∂u ujn − ujn−1 ∂2 u
n
uj+1 − 2ujn + uj−1
n
(xj , t n ) ' and (xj , t n
) '
∂t dt ∂x 2 dx 2
and shifting the time labels n := n + 1 in order to start with n > 0
14 / 17
Lecture 2
∂u ujn − ujn−1 ∂2 u
n
uj+1 − 2ujn + uj−1
n
(xj , t n ) ' and (xj , t n
) '
∂t dt ∂x 2 dx 2
are of order O(dt + dx 2 ) : The Backward Euler scheme is accurate of
order 1 in time and 2 in space, as the Forward Euler scheme.
I Injecting a particular solution (monochromatic wave) : ujn = ρn e iβx , and
knowing that the heat equation is energy-dissipating : |un+1 | 6 |un |, we
get after some computation :
The Backward Euler scheme has no stability condition : dt may be as big
as wanted, the solution will not blow up !
15 / 17
Lecture 2
MUn+1 = Un
Summarize
17 / 17