You are on page 1of 64

Chapter 3

DISCRETIZATION SCHEMES

In this chapter we will revisit the three types of partial di erential equations, i.e. elliptic equations, parabolic equations and hyperbolic equations, and look at discretization
methods for the various types of equations. Although the revision of the three basic types
of equations is necessary to gain a basic knowledge in CFD, the three types play an important role in time-dependent incompressible Navier-Stokes equations. Incompressibility
and the pressure have an elliptic character, viscosity is modelled by a parabolic equation
and the convective terms are hyperbolic. The major problem in incompressible viscous
ows is to nd numerical methods which account for the various types. This course is
devoted to that exercise.
3.1

Elliptic schemes

Elliptic partial di erential equations consist of equations for which no real characteristic
directions exist, see Chapter 2. These equations were associated with problems in which
information travels in nitely fast through the domain.
In this chapter we would like to consider three methods to discretize elliptic equations.





The boundary integral method, or panel method;


The nite di erence method;
The nite volume method.

An introduction to panel methods has already been given in the course Aerodynamics-B
(AE2-110). For a more extensive treatment of panel methods one is referred to Chapter 4.
45

46

DISCRETIZATION SCHEMES

The nite di erence method employs Taylor series expansions to approximate the di erential equation under consideration, while the nite volume method utilizes the integral
form associated with the elliptic problem.

3.1.1 Boundary integral method


If one wants to solve an elliptic problem in a two dimensional domain, the boundary integral
method or panel method allows one to reduce the computational e ort by discretizing only
the boundary of the domain. This simpli es the creation of a computational mesh and
reduces the number of unknowns in the discrete problem. The price one has to pay for this
reduction in complexity is that one has to solve a full, albeit smaller system of algebraic
equations, in contrast to nite volume or nite di erence method where the discrete set
of equations usually forms a sparse system.
In this section the Poisson equation will serve as the example to illustrate the use of
the boundary integral method.
Consider the Poisson equation in two spatial dimensions

r~ 2 u = b

in
;

(3.1)

~ 2 denotes the Laplace operator and


denotes the physical domain. Now de ne
in which r
the following inner product
Z 

r~ 2u b w d
= 0 ;

(3.2)

in which w is a so-called test function. If u satis es the Poisson equation (3.1) then
obviously this integral equation is satis ed for all w. However, if (3.2) is satis ed for all
w, then u must be a solution of the Poisson equation (3.1). Using partial integration (3.2)
can be re-written as
Z 

@u @w
@x @x

@u @w
@y @y

bw d
+

@u
wd = 0 :
@n

(3.3)

A second partial integration yields


Z  2
@w

@2w
u
+
u bw d
+
@x2
@y 2

@u
wd
@n

@w
d =0;
@n

(3.4)

3.1. ELLIPTIC SCHEMES

47

or equivalently
Z n

~ 2w

u bw d
+

@u
wd
@n

@w
d =0:
@n

(3.5)

Now assume that the boundary has been split into 1 and 2 such that = 1 [ 2 and
1 \ 2 = ; and suppose that on 1 Dirichlet boundary conditions have been prescribed
and on 2 Neumann boundary conditions, i.e.

q=

u = u on

@u
= q on
@n

(3.6)

Inserting these boundary values into (3.5) gives


Z n

r~ 2 w u bw d
+

qw d +

qw d

@w
u d
1 @n

@w
d = 0 :(3.7)
@n

Applying twice partial integration to the integral over


then yields
Z 

r~ 2u b w d

(q

q) w d
+

(u u)

@w
d =0:
@n

(3.8)

At rst sight this result might seem contradictory to (3.2) but in this equation it was
already assumed that u satis ed the prescribed boundary conditions. If (3.8) is satis ed
for all w the integrands of all three integrals have to vanish separately meaning that the
partial di erential equation is satis ed in the domain
and both boundary conditions
are satis ed on 1 and 2 .
For boundary integral methods equation (3.7) will be used. From now on, however,
we will use a very speci c set of functions for w denoted as u , in which u satis es the
equation

r~ 2 u + (x; y) = 0 ;

(3.9)

48

DISCRETIZATION SCHEMES

in which (x; y ) denotes the Dirac delta distribution1. The Dirac delta distribution is
de ned as
Z

<2

(xa ; ya )f (x; y ) dxdy = f (xa ; ya ) ;

(3.10)

for an arbitrary point (xa ; ya ) 2 <2 . A solution which satis es (3.9) is called the fundamental solution. Inserting this particular solution in (3.7) using the fact that
Z 

r~ 2u u d
=

(xi ; yi)u d
= u(xi ; yi ) ;

(3.11)

yields for b = 0

u(xi ; yi) +

uq  d +

uq  d =

qu d +

qu d :

(3.12)

So with this speci c choice w = u the integral over


has disappeared! The whole
problem is now stated in terms of the boundary integrals only. The only thing we need
to nd now is the fundamental solution u .
The fundamental solution for the Laplace operator in two dimensions is given by

u =

1
lnr ;
2

(3.13)

and in three dimensions by

u =

1
:
4r

(3.14)

Aerodynamicists immediately recognize in these solutions the velocity potential for a sink
with unit strength. This serves also as motivation for the fact that in Chapter 3 of
Fundamentals of Aerodynamics, by John D. Anderson, Jr. the panel source panel method
was introduced. (See Aerodynamics-B, AE2-110).
We now proceed by taking the point (xi ; yi) in the Dirac delta distribution on the
boundary of the domain . This leads to the problem that some singular integrals have
1 Also

called the Dirac delta function. However this operator is the limit of functions, but is itself not
a function in the classical sense

3.1. ELLIPTIC SCHEMES

49

to be evaluated. For convenience, we consider (3.12) before the boundary conditions have
been inserted, i.e. the equation

u(xi ; yi ) +

uq  d =

u q d :

(3.15)

Suppose we assume that the boundary is a smooth line in two dimensions or a smooth
surface in three dimensions. Around the point (xi ; yi ) the surface integrals are slightly
changed as depicted in Fig 3.1 for the two dimensional case.

(xi,yi)

Figure 3.1: Small detour around the singular point (xi ; yi ) on panel i.
This small detour is denoted by . The contribution of this small change of
limit for  ! 0 for for both surface integrals is given by (for two dimensions)
lim
!0

Z

qu d

1
=
lim
2 !0

Z

q ln  d


= lim
!0

nq

 ln  = 0 :

in the
(3.16)

Where we made use of the fact that


lim
 ln  =
!0

lim

x!1

ln x
=0:
x

(3.17)

So this integral evaluated near the singular point (xi ; yi) does not contribute to to the
boundary integral formulation. The second integral which must be checked in the vicinity
of the singular point (xi ; yi ) is
lim
!0

Z

uq  d


= lim
!0

Z

1
u d
2


= lim
!0

 o
1
= u(xi ; yi) :
2
2

(3.18)

50

DISCRETIZATION SCHEMES

The factor 1=2 which appears in this limit depends on the fact that the integral was
evaluated on a smooth part of the curve. If the limit for  ! 0 had been taken for a point
positioned at a kink in the curve this value has to be altered.
So for a point (xi ; yi) on the boundary
1
u(x ; y ) +
2 i i

uq  d =

we nd the following integral equation

qu d :

(3.19)

In the boundary integrals the singular points have already been accounted for. This
equation has to be set up for all points (xi ; yi ) on the boundary . The solution of the
boundary integral method is the function u which satis es (3.19) for all point (xi ; yi ) 2 .
In order to do this analytically a solid background in both complex function theory and
linear analysis is required which is beyond the scope of this course. We therefore turn to
a numerical approximation of these integrals. The rst step in the approximation consists
of approximating the boundary by straight segments denoted by j and we furthermore
assume that u and q are constant over such segments. See Fig 3.2.

Figure 3.2: Approximation of the geometry by straight panels.


Since the value of both u and q are constant over the segment or panels the method
is referred to as the constant element method. Denoting these constant values over a
panel j by uj and q j the boundary integral equation at a point u(xi ; yi) := ui becomes,

3.1. ELLIPTIC SCHEMES

51

assuming that the boundary has been covered by N panels


Z

N
1 i X
u +
2
j =1

q d

uj =

N
X
j =1

u d

qj :

(3.20)

These N equations for the N unknowns, ui j 2 and q i j 1 , can be solved as soon as the
integrals for u and q  have been evaluated. These integrals represent the in uence of
panel j on the solution near panel i and are therefore called the in uence coecients.
The integrals will be abbreviated by

H^ ij

q d

and

Gij

u d :

(3.21)

With this notation we can now write the linear system for the unknowns ui as
N
N
X
1 i X
u + H^ ij uj =
Gij q j :
2
j =1
j =1

(3.22)

Incorporation of the term ui =2 into the matrix H^ ij by means of

H ij

H^ ij
when i 6= j ;
1
ij
^
H + 2 when i = j

(3.23)

leads to
N
X
j =1

H ij uj

N
X
j =1

Gij q j ;

(3.24)

or in matrix form

H ~u = G~q :

(3.25)

The matrices H and G are N  N matrices, whereas the vectors ~u and ~q are vectors of
length N . Note that each panel in uences every other panel which results in full matrices
H and G. So here we have N equations for 2N unkowns.

52

DISCRETIZATION SCHEMES

Now bear in mind that the boundary is made up of two disjunct portions 1 , where
u is prescribed and 2 , where q is prescribed. In the discrete case this means that N1
elements of the vector ~u are given on 1 and N2 values are given in the vector ~q, with,
obviously N1 + N2 = N . Splitting the matrices and vectors with respect to the unknowns
and the prescribed values leads to the system

A~x = f~ ;

(3.26)

in which

A = H 0 G0 ;

~x = ~u0 + ~q0 ; f~ = (Gb

H b) (~ub + ~qb) :

(3.27)

This system can be solved by various means such as Gau elimination.


Once the solution for ~u0 and ~q0 is determined, the value of u at any point in the
computational domain can be obtained from

ui

qu d

uq  d ;

(3.28)

where the point at which ui is evaluated is not necessarily on the boundary. This leads
accordingly to its discrete analogue

ui

N
X
j =1

Gij q j

N
X

H^ ij uj ;

j =1

(3.29)

^ have to be calculated for each point xi separately.


in which the matrices G and H
The evaluation of the integrals can be performed by standard numerical integration
rules, unless one wants to evaluate the in uence of the i-th element on itself. For constant
elements this integral can be evaluated exactly. The H^ ii term is identically zero, because

H^ ii =

q d =

@u @r
d =0;
@r @n
i

(3.30)

because @r=@n = 0. The integrals Gii require a special treatment.

Gii

1
u d =
i

2

ln

 

1
d :
r

(3.31)

3.1. ELLIPTIC SCHEMES

53

Introduce the co-ordinate transformation (see Fig/ 3.3)


l
= 
2

(3.32)

Figure 3.3: Coordinate transformation on panel i


This yields

Gii

=
=
=
=

 

 

1
1 point2
1
1 point2
ln
d =
ln
dr
2 point1
r
 controlpointi
r
 


Z
1 l
1
lim ln
d
 2 !0 
l=2
  

  
Z
1
1
1 l
ln
+ lim
ln
d
!0 
 2
l=2

  


1 l
1
ln
+1 :
 2
l=2

(3.33)

With these ingredients it is possible to implement a computer program which solves


an elliptic ow problem governed by the Laplace equation using constant elements.
A direct extension of the constant panel method may consist of increasing the accuracy
by using linear, quadratic or even cubic polynomial representations over a panel. For a
more extensive treatment on the subject one is referred to Chapter 4.

3.1.2 Finite di erence formulation


For the nite di erence formulation we employ the di erential form of the elliptic equation.
For the two dimensional Laplace equation which was solved in the previous subsection

54

DISCRETIZATION SCHEMES

this di erential equation reads

@2u @2u
+
=0:
@x2 @y 2

(3.34)

Assume that the geometry


consists of a square rectangle which is covered by a uniform
mesh2 as depicted in Fig 3.4
j=N

ui,j

j=1
j=0
i=0 i=1 i=2

i=N

Figure 3.4: Finite Di erence grid.


At the intersection of the mesh lines the discrete value ui;j := u(i  x; j  y ) is
de ned. Note that for a uniform mesh x and y are constant. In order to transform
the partial di erential equation (3.34) to an algebraic system using the the nite di erence
method we assume that we can approximate the values of u in the points surrounding the
point ui;j by a Taylor series expansion. In order to apply a Taylor series expansion around
the point ui;j we must assume that all derivatives at the point (i; j ) := (i  x; j  y )
exist. If this is the case we can use

ui 1 = ui
ui = ui ;
2 The

@u x2 @ 2 u
x +
@x i
2 @x2 i

x3 @ 3 u x4 @ 4 u
5 ;
+
+
O

x
6 @x3 i
24 @x4 i

(3.35)
(3.36)

extension to more complex geometries and non-uniform meshes will be treated in chapter 7

3.1. ELLIPTIC SCHEMES


55


@u x2 @ 2 u x3 @ 3 u x4 @ 4 u
+
+
+ O x5 :
ui+1 = ui + x +



2
3
4
@x i
2 @x i
6 @x i
24 @x i

(3.37)

Taking a linear 2combination of these three equations, such that the leading order term
in x is equal to @@xu2 yields

ui

2ui;j + ui+1;j
=
x2

1;j

@ 2 u x2 @ 4 u
4
:
2 + 12 @x4 + O (x )
@x
{z
}
|
Modi ed or equivalent di erential operator

(3.38)

This equation shows that if we would replace the second order derivative of u with respect
to x by the left hand side of (3.38) we would actually solve the modi ed or equivalent
di erential operator up to fourth order in x. However, by decreasing x, i.e. by
re ning the mesh the second order term in x will become less in uential, if the fourth
order derivative of u at (i; j ) is bounded!
For x ! 0 we would have
lim

x!0

ui

1;j

2ui;j + ui+1;j @ 2 u
= 2:
x2
@x

(3.39)

If this is the case for a discretization scheme, the scheme is called consistent.
Consistency is one of the major requirements for a numerical scheme, and, as it turns
out, the discrete approximation by (3.38) is consistent.
The leading order error that we make in approximating the second order derivative
by (3.38) is given by
x2 @ 4 u
:
12 @x4

(3.40)

This error is called the truncation error. We see that if we half x, the error becomes
four times smaller. This is due to term x2 in the truncation error. The method is
called second order accurate. For a general approximation with truncation error xp the
method is p-th order accurate.
A similar discretization can be obtained for the second order derivative with respect
to y yielding for the Laplace operator

ui

1;j

2ui;j + ui+1;j ui;j


+
x2

2ui;j + ui;j +1
=0:
y 2

(3.41)

56

DISCRETIZATION SCHEMES
The modi ed di erential equation is now given by

@ 2 u @ 2 u x2 @ 4 u y 2 @ 4 u
+
+
+
=0:
@x2 @u2 12 @x4 12 @y 4

(3.42)

If x = y this can be reduced to

j+1

-4

j-1

1
i-1

i+1

Figure 3.5: Finite Di erence Molecule


4ui;j + ui

1;j

+ ui;j 1 + ui+1;j + ui;j +1 = 0 :

(3.43)

The coecients are usually depicted in the grid as shown in Fig. 3.5

3.1.3 Finite Volume Method


The nite volume method resembles the nite di erence method but the starting point
in this approach is the integral formulation of the problem. For the Laplace equation we
are considering in this section the problem may be stated as

3.1. ELLIPTIC SCHEMES

57

~ 2 u = 0 throughout the whole computational domain, then


If r
Z

test

r~ 2 u d
test =

@u
d
test @n

test

= 0 ; for each
test 
:

On the other hand if (3.44) for an arbitrary


test bounded by
~ 2 u = 0.
satisfy the Laplace equation r

test ,

(3.44)
then the solution must

The idea is now to cover the computational domain


with a mesh, just like for the
nite di erence method, see Fig 3.4, and to de ne the test volumes, the so-called control
volumes, see Fig 3.6.

j+1
test

test

j-1

i-1

i+1

Figure 3.6: Finite Volume method: Control Volume


The control volume need not be disjoint, but may be overlapping. We are now using
the boundary integral which appears in (3.44) to discretize the Laplace equation.
Let us consider the square control volume around the point (i  x; j  y ), from now
on referred to as the cell (i; j ) and let us evaluate the boundary integral
Z

@u
d
test @n

test

=0:

(3.45)

58

DISCRETIZATION SCHEMES

This boundary integral can be decomposed into four separate integrations over e , the
eastern boundary, n the northern boundary, w the western boundary and s , well ...
you probably already guessed what the 's' stands for.
The part over
Z

@u
d
@n
e

can approximated by

ui+1;j ui;j
d
x
e

 y ui+1;jx ui;j :

(3.46)

Applying the same approximation to the other three side gives


Z

@u
d
test @n

y

test

ui+1;j ui;j
u
u
+ x i;j +1 i;j
x
y

y

ui;j

ui
x

1;j

x

ui;j

ui;j
y

(3.47)

Although this might look like a new scheme division by the area of
test again gives
the well-known 5-point stencil (3.41).
By choosing di erent control volumes or di erent integration rules, di erent schemes
may be obtained, see Exercise 3.20
3.2

Parabolic schemes

Parabolic schemes stem from the same degeneration from which we obtained the elliptic
schemes as a limiting case of hyperbolic schemes with in nite wave speeds, see Example 12.
The standard parabolic equation we are going to consider in this section is the so-called
heat equation, given by

@T
@t

@2T
=0:
@x2

(3.48)

This equation can be solved by the nite di erence method, in which the partial di erential
equation (3.48) is considered, or by the nite volume method which employs an equivalent
integral formulation. This equation contains a 'time-derivative' and we are going to spend
some time to consider the problem how well the numerical solution behaves in time. We
are going to do this for the partial di erential equation and the numerical scheme. This
analysis considers the problem of well-posedness and stbility. Let us consider the nite
di erence method rst.

3.2. PARABOLIC SCHEMES

59

3.2.1 Finite Di erence Method


Assume that we use a nite di erence grid as shown in Fig. 3.4 in which j is now replaced
by n, denoting the n-th time level, see Fig. 3.7. Approximating the points near the (i; n)

Figure 3.7: Points included to approximate the heat equation


by means of a Taylor series expansion gives

Tin = Tin ;
Tin+1

(3.49)

Tin + t

@T n t2 @ 2 T n
+ O(t3 ) ;
+


2
@t i
2 @t i

(3.50)

and

Tin1

Tin

@T n x2 @ 2 T n x3 @ 3 T n x4 @ 4 T n


 x @x + 2 @x2  6 @x3 + 24 @x4 + O(x5 ) : (3.51)
i
i
i
i

Taking a linear combination of these 4 grid values and choosing the coecients such that
the leading order term in t and x represents the di erential equation, i.e.

Tin + Tin 1 + Tin+1 + Tin+1 =

@T
@t

@2T
+ O (t; x) ;
@x2

(3.52)

60

DISCRETIZATION SCHEMES

yields

Tin+1 Tin
t

Tin 1

2Tin + Tin+1
=0:
x2

(3.53)

Inserting the expansion yields the equivalent di erential equation

Tin+1 Tin Tin 1 2Tin + Tin+1 @T @ 2 T t @ 2 T x2 @ 4 T


2 ; x4  :(3.54)
k
=
k
+
k
+
O

t
t
x2
@t @x2 2 @t2
12 @x4
So the truncation error is given by
t @ 2 T
2 @t2


x2 @ 4 T
+ O t2 ; x4 ;
4
12 @x

(3.55)

from which it follows that the scheme is consistent, because


t @ 2 T
t;x!0 2 @t2
lim


x2 @ 4 T
+ O t2 ; x4 = 0 :
4
12 @x

(3.56)

The truncation error also shows that the discretization (3.53) is rst order in time due
to the appearance of the t in the truncation error and second order in space due to the
appearance of x2 in the truncation error.

3.2.1.1 Well-posedness and stability


In this subsection we brie y digress on well-posedness and stability. For an initial value
problem to be well-posed we want




the solution should exist and should be unique


the solution should depend continuously on the parameters of the problem (Coecients, right-hand-side function and initial conditions)

The second point can be made more precise as follows:


Suppose u is the solution of the Cauchy problem

@u
= P (x; t; u; @=@x)u + F (x; t) ; x 2 Rs ; 0  t  T ;
@t

(3.57)

3.2. PARABOLIC SCHEMES

61

with initial condition

u(x; 0) = f (x) ; x 2 Rs :

(3.58)

In general the solution u will be a complex valued function.


Now we consider a slightly perturbed problem in which F is replaced by F + F and
the intitial condition f by f + f , so

@v
= P (x; t; v; @=@x)v + F + F ; x 2 Rs ; 0  t  T ;
@t

(3.59)

with initial condition

v (x; 0) = f + f ; x 2 Rs :

(3.60)

We now require that the solution v to the perturbed problem is in the neighborhood of
the solution u of the original problem, i.e.

ku vk  K fkF k + kf kg ; 0  t  T :
For linear equations the perturbation in the solution, u = v

@u
= P (x; t; @=@x)u + F ; x 2 Rs ; 0  t  T ;
@t

(3.61)

u, will satisfy
(3.62)

with initial condition

u(x; 0) = f ; x 2 Rs :

(3.63)

The desired estimate readily follows if we can show the following estimate for the original
problem

kuk  K fkF k + kf kg ;

0tT :

(3.64)

(Note that in order to use such an estimate we rst have to chose a suitable norm.)

62

DISCRETIZATION SCHEMES

Suppose that the initial condition u(x; 0) can be represented by a Fourier mode as
follows

u(x; 0) = f^(! )e^!x ;

(3.65)

and we try to nd a solution of the form

u(x; t) = u^(!; t)e^!x :

(3.66)

We now study the amplitude u^ of this Fourier mode in time. Note that we use Fourier
analysis since the Fourier transform converts partial derivatives in multiplications by ! .

Example 14

The rst example is given by ut + aux = 0. Converting this to ! yields

u^t + ^a! u^ = 0 ; u^(!; 0) = f^(! ) ;

(3.67)

with solution

u^ = e

^a!t f^(! )

(3.68)

so the solution for u becomes

u(x; t) = e^!(x

!t) f^(! )

(3.69)

Note that the amplitude of the solution does not grow or decay.

Example 15

The second example is the heat equation ut = uxx. This gives

u^t = ! 2 u^ ; u^(!; 0) = f^(! ) ;

(3.70)

which gives the solution

u(x; t) = e^!x

!2 t f^(! )

Note that this solution decays for increasing time t.

(3.71)

3.2. PARABOLIC SCHEMES


Example 16

63

The backward heat equation ut = uxx the solution of which is


2

u(x; t) = e^!x+! t f^(! ) :

(3.72)

This solution grows exponentially fast as a function of the time t. Note that the higher
the frequency ! the faster the explosion of the solution.

These three examples demonstrate that every di erentiation with respect to x leads
to an aditional factor ^! in the equation for u^. This in turn e ects the coecient of t in
the exponential. We can therefore state the following

Theorem 1

Consider

ut = P (@=@x)u ;

(3.73)

in which P denotes a polynomial, supplemented with the initial value

^ ^!x :
u(x; 0) = fe

(3.74)

Then the solution is given by

u(x; t) = f^(! )e^!x eP (^!)t :

(3.75)

The polynomial P (^! ) is called the Fourier symbol or brie y the symbol of the di erential equation. In the discrete case we will shortly encounter the discrete analogue of the
symbol.
Sofar, we only considered one Fourier component. The idea is to rewrite general initial
conditions

u(x; 0) = f (x) ;

(3.76)

as a Fourier series using


1
f^(! ) = p
2

Z 1

^!x f (x) dx

(3.77)

64

DISCRETIZATION SCHEMES

such that
1
f (x) = p
2

Z 1

e^!x f^(! ) d! :

(3.78)

For each individual term e^!x f^(! ) we can establish the time evolution, so the integrated
result will be
1
u(x; t) = p
2

Z 1

e^!x f^(! )eP (^!)t d! :

(3.79)

If we are able to bound P (^! ) we can prevent unattenuated growth of the solution so
we have

De nition 1

The Cauchy problem

ut = P (@=@x)u ; u(x; 0) = f (x) ;

(3.80)

is well posed if there exist constants and K such that


P (^!)t
e

 Ke t ;

(3.81)

for all t  0.

This de ntion of well-posedness allows us to derive the following estimate

ku(; t)k = keP (^!)t f^(!)k  Ke t kf^k = Ke t kf k :

(3.82)

This is an equation of the form (3.64). Note that this de nition of well-posedness allows
the solution to grow to in nity for t ! 1, but on every bounded time interval the solution
remains bounded independent of ! .
A stronger requirement would be to state that the solution remains bounded at all
time. This requirement is called stability.

3.2. PARABOLIC SCHEMES


De nition 2

65

The Cauchy problem

ut = P (@=@x)u ; u(x; 0) = f (x) ;

(3.83)

is called stable if there exists a constant K , independent of


such that
P (^!)t
e

K; t0:

(3.84)

!0;

(3.85)

When
P (^!)t
e

for t ! 1 ;

the Cauchy problem is called strongly stable.

Example 17
t =

The wave equation given by

0 @=@x
@=@x 0

;

(3.86)

gives

P (^! ) =

0 ^!
^! 0

(3.87)

with eigenvalues ^! , therefore jeP (^!)t j = 1. This means that the problem is neutrally
stable. (i.e. no growth and no decay).

Example 18
t =

The potential equation

0
@=@x
@=@x 0

;

(3.88)

leads to a P (^! ) having eigenvalues ! and therefore jeP (^!)t j = e!t , so this problem is
ill-posed.

66

DISCRETIZATION SCHEMES

Example 19

The heat equation

t = xx ;

(3.89)

leads to a Fourier symbol given by

P (^! ) = ! 2 =)

P (^!)t
e

=e

!2 t

(3.90)

This problem is well-posed if > 0 in which case the solution will be strongly stable. For
= 0 the problem will be neutrally stable and for > 0 the problem is unstable.

So far we have seen instances where we could bound the solution by the initial conditions, which is only part of the stability requirement of (3.64). Inhomogeneous linear
partial di erential equations can be converted to homogeneous linear di erential equations
with new 'initial conditions' using the Principle of Duhamel. Consider

@
@u
= P (x; t; )u + F (x; t) :
@t
@x

(3.91)

The question is now how to incorporate the inhomogeneous term F (x; t) in our wellposedness estimate? The trick is the following. Consider the auxiliary equation for
v (x; t;  ) given by

@v
@
= P (x; t; )v ; t   ;
@t
@x

(3.92)

with 'initial condition'

v (x;  ;  ) = F (x;  ) :

(3.93)

Then the solution to the inhomogeneous problem (3.91) with initial condition u(x; 0) = 0
is given by

u(x; t) =

Z t
0

v (x; t;  ) d :

(3.94)

3.2. PARABOLIC SCHEMES

67

To verify this we can di erentiate u(x; t) with respect to t

@u
= v (x; t; t) +
@t
= F (x; t) +

Z t

0
Z t
0

= F (x; t) + P

@v
(x; t;  ) d
@t

P v (x; t;  ) d P does not depend on 

Z t
0

v (x; t;  ) d

= F (x; t) + P u(x; t)

(3.95)

When we want to solve for u(x; 0) = f (x) we can split the solution into two parts,
u = u1 + u2 where u1 satis es the homogeneous di erential equation supplemented with
inhomogeneous initial conditions and u2 satis es the inhomogeneous di erential equations
with homogeneous initial conditions.

Example 20

Consider the Cauchy initial value problem given by

@
@u
= P ( )u + F (x; t) ; t  0 ;
@t
@x

(3.96)

with initial condition

u(x; 0) = f (x) :

(3.97)

Combining Duhamel's principle and Fourier analysis gives the solution (see Exercise ??.)
Z

1
1
v (x; t;  ) = p
e^!x eP (^!)(t
2 1
= S (t  )F :

 ) F^ d!

(3.98)

With this formal de nition of the operator S the solution of the homogeneous problem u1
can be written as

u1 = S (t)f :

(3.99)

Superposition and Duhamel give the solution to the inhomogeneous problem with inhomogeneous initial conditions

u(x; t) = S (t)f +

Z t
0

S (t  )F (x;  ) d :

(3.100)

68

DISCRETIZATION SCHEMES

If the homogeneous problem is well-posed we have the estimate

kS (t)f k  Ke t kf k ;

(3.101)

which in turn yields

ku(; t)k 

Ke t

Z t

kf k +

kF (;  )k d :

(3.102)

So we now have an estimate of the desired form




ku(; t)k  KT kf k +

Z t
0

kF k d ;

0tT :

(3.103)

This requirement if of the desired form (3.64).

The ideas presented above only deal with well-posedness and stability of partial di erential equations. Similar criteria can be developed for the discrete analogue of a partial
di erential equation. This will concern the stability of the numerical scheme. Furthermore, we can consider the discrete scheme as perturbation of the the di erential equation,
this is essentially the issue of consistency. Suppose we have a numerical scheme such as
the discrete heat equation

Tin+1 Tin
t

Tin 1

2Tin + Tin+1
=0:
x

(3.104)

For this equations we can require similar conditions on the parameters as for the partial
di erential equation. So if we perturb this di erence equation with a small right-hand-side
and modify the the initial conditions slightly, the question is: will the numerical solution of
the perturbed problem be in the vicinity of the unperturbed problem, regardless whether
the numerical problem approximates the di erential equation or not. The way to establish
well-posedness or stability equals the procedure for the di erential equation. We insert
a Fourier mode, determine the symbol and require that the solution remains bounded.
Suppose that Tin is the solution of the di erence scheme (3.104) and T~in is the solution of
the perturbed di erence equation, then the di erence ni satis es

ni +1 ni
t

ni 1

2ni + ni+1
= Fin ;
x2

(3.105)

3.2. PARABOLIC SCHEMES

69

with initial condition

0i = fi ;

(3.106)

If the boundary conditions are assumed to be periodic the error ni can be decomposed
as a Fourier series in space at time level n. In general this decomposition will lead to a
Fourier integral, but since only a nite number of waves can be represented on a grid, the
integral reduces to a nite Fourier sum, see Fig. 3.8.

Figure 3.8: High wavenumber waves are represented on a nite grid as low wavenumber
waves, taken from [9]
In the one dimensional domain of length L the complex Fourier representation re ects
the region (0; L) onto the negative part ( L; 0), and the fundamental frequency corresponds to the maximum wave length of max = 2L. The associated wavenumber k = 2=
attains its minimum value kmin = =L. The maximum wavenumber, on the other hand is
associated with the smallest waves which can be represented on the mesh, which depends
on the smallest wave lengths which are resolvable. The shortest wave length is clearly
equal to min = 2x, see Fig. 3.9, and consequently kmax = =x.

70

DISCRETIZATION SCHEMES

Figure 3.9: Fourier representation of the error on the interval (-1,1), taken from [9]
Therefore with a mesh index i, ranging from 0 to N , with xi = i  x and x = L=N
all the harmonics represented on the nite mesh are given by



; j = 0; : : : ; N ;
kj = jkmin = j = j
L
N x

(3.107)

with the maximum number j being associated with the maximum frequency. Hence with
kmax = =x the highest value of j is equal to the number of mesh intervals. The error
can therefore be written as

ni

jX
=N
j= N

where ^ =

Ejn e^kj ix

jX
=N
j= N

Ejn e^ij=N ;

(3.108)

1 and Ejn is the amplitude corresponding with the j -th harmonic.

The product kj x is usually abbreviated by the phase angle

 = kj  x =

j
;
N

(3.109)

3.2. PARABOLIC SCHEMES

71

and covers the whole domain ( ;  ) in steps of =N . The region around  = 0 corresponds to the low frequency modes, whereas the region near  =  is associated with the
rapidly oscillating functions. In particular  =  corresponds to the highest frequency
representable on the mesh, namely with waves of wave length 2x.
Since we are dealing with linear schemes no interaction takes place between the various
harmonics, so in order to study the behaviour of the error it suces to analyze the
behaviour of just one particular wave, say Ejn exp(^i), just as we did for the partial
di erential equations. If we insert this mode into the di erence equation we obtained for
the heat equation we get

Ejn+1 Ejn ^i


e
t

k n ^(i
E e
x2 j

1)

2e^i + e^(i+1) :

(3.110)

After division by exp(^i) and using the fact that exp(^) + exp( ^) = 2 cos  we obtain


Ejn+1

Ejn +

2kt n
E (cos  1) = 0 :
x2 j

(3.111)

We now impose the following stability criterion on this wave: The amplitude Ejn is not
allowed to grow in time, i.e. the ratio

jGj =



E n+1
j
n
Ej

 1 ; 8 :

(3.112)

So this requirement can be compared to neutral stability (jGj = 1) and absolute stability
(jGj < 1) considered for partial di erential equations.
The quantity G introduced here is called the ampli cation function and jGj is called
the ampli cation factor, and it is a function of the time step t, the mesh size x and
the physical parameter k. The condition (3.112) applied to the heat equation gives

G=1+

2kt
(cos 
x2

1) :

(3.113)

Since 1  cos   1 we have that


1

4k
x2

G1;

(3.114)

72

DISCRETIZATION SCHEMES

so the stability criterion is satis ed if


1

4kt
x2

1 =) t 

x2
:
2k

(3.115)

So we see that the scheme will be stable if the time step satis es (3.115). Therefore the
scheme is called conditionally stable.
The stability based on the decomposition of the error in Fourier modes is called the
Von Neumann stability analysis. Note that the assumption was made that the boundary
conditions were periodic. Although this will not be the case in general, the Von Neumann
stability analysis gives a rather good criterion for stability.
The3 Von Neumann stability analysis mimicks the stability analysis we have given
before for partial di erential equations. The reason we used Fourier analysis was to
convert a partial di erential equation to an ordinary di erential equation. However, in
the di erence equation we don't have partial derivatives, so we have another way of
assessing the stability of the scheme.
Consider the semi-discrete system given by

@ T~
= AT~ + F~ ;
@t

(3.116)

in which T~ = (T0 ; T1 ; : : : ; Ti ; : : : ; TN )T . For analysis purposes, it is useful to consider the


exact solution of (3.116). This can be expressed in terms of the eigensystem of A, de ned
by
(A

m I ) ~xm = 0 ; m = 0; : : : ; N :

(3.117)

If we de ne X as the matrix of the right-hand vectors of A

X = (~x0; ~x1;    ~xN ) ;

(3.118)

we can multiply (3.116) by X

X
3 The

~
=X
@t

1 @T

AXX
| {z
I

1~
}T

to obtain

+ X 1 F~ :

following part is taken from the lecture notes by dr. S.J. Hulsho

(3.119)

3.2. PARABOLIC SCHEMES

73

De ning the new variables

w~ = X

T;

~ = X 1 F~ ;
G

(3.120)

and noting that

X 1AX =  = diag(0; 1; : : : ; N ) ;

(3.121)

we can express the equation for w~ in decoupled form

@ w~
~;
= w~ + G
@t

(3.122)

w_ m = m wm + Gm ; m = 0; 1; : : : ; N :

(3.123)

or

~ depend on t, we may express the solution of the decoupled equations


If neither A nor G
as
wm (t) = Cm em t

~
G
if m 6= 0 :
m

(3.124)

If m = 0 the solution obviously is wm (t) = Gt + Cm . Returning the solution from


eigenspace to real space, we have

T~ (t) =

N
X
m=0

Cm em t~xm + X 

1F
~

(3.125)

Where the Cm 's are constant determined by the initial conditions. The homogeneous
solution, given by the summation term, represents the time-dependent or transient portion
of T~ . The particular solution, which is equivalent to A 1 F~ , represents the nal steady
state solution which is achieved for eigensystems with negative real part. Note that the
conversion to (3.125) is only possible when the matrix A is diagonizable. When we have
Jordan blocks, things are slightly more complicated, but the ultimate conclusion remains
the same. Although the long term bahaviour for non-diagonizable matrices is the same
as for diagonizable, the initial solution may start to grow, see Exrcise 15.

74

DISCRETIZATION SCHEMES

The properties of a given spatial discretization can be revealed by comparing the


eigenvalues of the matrix A with the form of the exact solution described above. For
example, a centered spatial discretization of the linear convection equation with periodic
boundary conditions can be written as
0

@u @u
@~u
c
+ c = 0 =)
=
@t
@x
@t
2x

B
B
B
B
B
B
@

0
1

1
0 1
1 0 1

1
0

1
C
C
C
C~
Cu :
C
A

(3.126)

While for the heat equation with periodic boundary conditions we have
0

@2T

@T
=k 2
@t
@x

@ T~
=
@t

=)

B
B
k B
B
x2 B
B
@

2
1

1
2
1

1
2 1

2
1

1
2

1
C
C
C
C T~
C
C
A

(3.127)

In both cases, the matrices A of the discretizations are examples of circulent matrices of
the form
2
6
6
4

b0
b3
b2
b1

b1
b0
b3
b2

b2
b1
b0
b3

b3
b2
b1
b0

3
7
7
5

(3.128)

The eigenvectors of circulent matrix are given by

~xm = (xj )m = e^(2jm)=(N +1) ; j; m = 0; : : : ; N :

(3.129)

While the eigenvalues can be expressed in terms of the matrix coecients as

m =

N
X
j =0

bj e^(2jm=(N +1)) :

(3.130)

3.2. PARABOLIC SCHEMES

75

For the central discretization of the linear convection equation we have

m =

^c
sin ; m = 0; : : : ; N ;
x

(3.131)

where

2m
;
N +1

(3.132)

while for the central discretization of the linear heat equation we have

m =

2k
(cos
x2

1) :

(3.133)

The eigenvalues for the two semi-discrete systems appear plotted in the complex  plane
in Figure 3.10. Inspection of the expression for the general solution (3.125) reveals that
the solution generated by both discretizations behaves in a manner similar to the solutions of the partial di erential equations which they try to approximate (see for example
Exarcise 16 and 17). In the case of the linear heat equation, the negative real part of
of  results in a transient solution which decays in time, mimicking the exact di usion
process. In contrast, the pure imaginary 's of the linear convection discretization will
result in the unattenuated propagation of the initial conditions, which also occurs in the
exact solution of the PDE.
In general, the solution to the semi-discrete system need not behave in manner analogous to the exact solution. Consider for example the upwind discretization of the linear
convection equation

@ui
c
=
(u
@t
x i

ui 1 ) ;

(3.134)

which for periodic boundary conditions has the eigenvalues

m =

c
(cos
x

1 + ^ sin ) ;

(3.135)

or the downwind discretization

@ui
c
=
(u
@t
x i+1

ui ) ;

(3.136)

76

DISCRETIZATION SCHEMES

Figure 3.10: Semi-discrete eigenvalues for central discretizations


for which

m =

c
(cos
x

1 + ^ sin ) :

(3.137)

The eigenvalues of both discretizations (multiplied by x=c) appear plotted in Fig. 3.11.
As the eigenvalues of the upwind discretization include both imaginary and negative real
parts, the exact semi-discrete solution will result in an unphysical decay of the initial
conditions as it is propagated. A more striking example is given by the downwind discertization, whose exact semi-discrete solutions will amplify in time without bound. It is
interesting to note that the unbounded downwind discretization is also distateful from a
physical point of view, as it does not respect the characteristic directions of information
propagation present in the original partial di erential equation. Although it is tempting
to view downwind discretizations as always leading to unstable numerical methods, the
prognosis is incomplete without considering the approximate method used for advancing
the semi-discrete system in time.
In a manner similar to the semi-discrete system, many of the properties of the fully
discrete system are described by the eigenvalues of the fully discrete matrix C . It is
the application of the time-march method which establishes a relationship between the
eigenvalues of C and those of the semi-discrete matrix A. For example, consider the

3.2. PARABOLIC SCHEMES

77

Figure 3.11: Semi-discrete eigenavlues for skew-symmetric discretizations


Euler explicit method applied to (3.116)

~un+1 = (I + tA) ~un + steady state


= C ~un + steady state

(3.138)

The eigenvalues of C denoted by m are given by


(C

m I ) ~ym = 0 ; m = 0; : : : ; N ;

(3.139)

or


(1 m ) I + tX

AX  ~ym = 0 ;

(3.140)

form which

m = 1 + m t :

(3.141)

This relationship between m and m is identical to that obtained by considering the


application of the time marching scheme to the uncoupled system, as discussed below.

78

DISCRETIZATION SCHEMES

The systems (3.116) and (3.122) provide equivalent representations of the semi-discrete
system, in terms of two groups of variables related to eachother by a linear transformation.
The solution of the fully discrete system derived through the application of the time march
can also be equivalently determined using either sets of variables. We therefore consider
a single equation form the decoupled system (3.122)

@w
= w + G :
@t

(3.142)

In general, the application of the time march method will produce a fully discrete equation
of the form

wn+1 = wn + k :

(3.143)

For example, application of the Euler explicit methods gives,

wn+1 = (1 + t)wn + Gt ;

(3.144)

which describes the same relation between  and  as found from the decoupled system.
In general, it is easiest to derive the   relation by considering the time march applied
to a single equation from the decoupled system.
In general the solution of (3.143) may be expressed as

wn = C n +

(3.145)

or expressed in terms of the initial conditions

wn = w0  n + k

1 n
:
1 

(3.146)

For the explicit Euler scheme this becomes

wn = C (1 + t)n +

Gt
:
t

(3.147)

Note that if we have a good approximation of the eigenvalues of the spatial operator, , we
have a good approximation of the steady state solution, irrespective of the time-marching

3.2. PARABOLIC SCHEMES

79

method used (as long as the time stepping scheme is absolutely stable). In the rare case
where we have the exact eigenvalues of the spatial operator, the steady state solution will
be exact. This fact allows us to use cheap lower order accurate time stepping methods to
reach the nal steady state. Form this equation we also see that if we want the transients
to remain bounded the modulus of j1 + tj should be less or equal to 1. If we apply this
to the heat equation for which the eigenvalues of the semi-discrete system were given by

m =

2k
(cos
x2

1) ;

(3.148)

we obtain
11+

2kt
(cos
x2

1)  1 :

(3.149)

This condition is satis ed when


t 

x2
;
2k

(3.150)

which is in agreement with the stability limit obtained by the application of the Von
Neumann stability analysis.
In order to test the stability requirement for the heat equation Fig. 3.12 displays the
solution of the heat equation for t = x2 =2k after 0, 50, 100, 200, 500, 1000, 2000 and
5000 timesteps. We see that the initial solution decays and spreads out, exactly as we
expect.
If we increase the time step a little bit, for instance if we take t = 1:2x2 =2k, small
perturbation will grow exponentially fast. Note that no perturbations have been added to
the initial solution. The perturbations are generated from rounding-o errors. Fig. 3.13
displays the solution after 30, 35, 40 and 45 time steps.

Note 1 We have looked at stability for partial di erential equations, semi-discrete

ordinary di erential equations and fully discrete equations. Stability analysis of a discrete
scheme requires that the discrete solution of perturbed di erence scheme remains in the
vicinity of the solution of the unperturbed di erence scheme in a similar vein as we did
for partial di erential equations. Note that the numerical approximation itself can be
considered as a perturbation to the di erential equation. In this case not only the forcing
term and the initial conditions are perturbed (by numerical approximation), but the
di erential operator itself is perturbed.

80

DISCRETIZATION SCHEMES
5

10

20

Figure 3.12: The solution of the heat equation at various time levels using the maximum
allowable time step based on linear stability analysis

Note 2 There is a di erence between accuracy and stability.

Accuracy requires that


the discrete solution is in the neighborhood of the exact solution of the partial di erential
equation. Stability only is concerned with the growth/decay of perturbations in the discrete solutions. Sometimes accuracy is the restricting factor on the time step, sometimes
stability. This depends on the application.

Note 3 We started this discussion with well-posedness and the fact that the solu-

tion should depend continuously on the data. This is a reasonable starting point. What
would the world be like, if a small change in the boundary conditions would lead to a
totally di erent answer? This would prohibit the comparison between experiment and
calculation, because in experiments always small perturbations are present and in calculations rounding-o error provide the small perturbations. However, there are physical
phenomena where a small change in the data does lead to a completely di erent solution.
A well-known example is transition. Just below a certain Reynolds number the ow is
nicely laminar, whereas slightly above the critical Reynolds number the ow eld changes
dramatically. This small change in Reynolds number plays the role of `a small change
in the data'. It is one of todays challenges to develop numerical schemes and analytical
tools to capture these phenomena as well. So well-posedness precludes very interesting
physical phenomena.

3.2. PARABOLIC SCHEMES

81
4

2
1
1
0
0
0

10

20

10

20

4
10
3
5

0
-5
-1
-10

-2
-3

10

20

10

20

Figure 3.13: Numerical solution of the heat equation 1.2 times the maximum allowable
time step based on linear stability analysis. Solution after 30 time steps (upper left),
solution after 35 time steps (upper right), solution after 40 time steps (lower left) and
solution after 45 time steps (lower right).

3.2.2 Finite Volume Method


The second approach for a parabolic equation will be based on the nite volume method.
In this case we use the same idea that was applied to the Laplace equation, i.e. we use
the integral form of the heat equation. Note that

@T
@t

@2T
=0;
@x2

(3.151)

is equivalent to
Z t2 Z x2 
@T
t1

x1

@t

@2T
k 2
@x

dxdt = 0 ;

8t1 ; t2 > 0

and x1 ; x2 2 < :

(3.152)

82

DISCRETIZATION SCHEMES

Now consider the the control volume in space-time shown in Fig. 3.14 We are going to

n+1

test

test

n-1

i-1

i+1

Figure 3.14: Control volume in space-time for the heat equation.


approximate the integral over the small volume show in Fig. 3.14, which gives
Z tn+1 Z (i+ 1 )x
2
tn

(i 12 )x

@2T
k 2 dxdt =
@x

@T
@t

Z tn+1 
tn

@T ((i + 12 )x; t)
k
@x

Z (i 1 )x
2

@T ((i

(i 21 )x

T (x; tn+1 ) T (x; tn ) dx


1
2 )x; t)

@x

(3.153)

dt :

Now we need to approximate the remaining integrals. We will use the so-called mid-point
rule to do so. The mid-point rule is given by
Z b
a

a+b
(b a) :
f (x) dx  f
2

(3.154)

Using this rule we obtain


x Tin+1


Tin

@T n+ 2
t k
@x i+ 12

1!

@T n+ 2
=0:
k
@x i 12

(3.155)

3.2. PARABOLIC SCHEMES

83

Now we need to approximate the gradients of T at time level n + 21 . One possibility would
be to set

@T n+ 2
k
@x i+ 12

@T n
k
@x i+ 21

Tin+1 Tin
 k x :

(3.156)

This would yield the same di erence equation as obtained for the nite di erence method.
The con rmation of this claim is left as an exercise.
Alternatively we can approximate the gradient by

@T n+ 2
k
@x i+ 12

1 @T n
@T n+1
k +k
2
@x i+ 21
@x i+ 21

(3.157)

in which

@T n
k
@x i+ 12

 k Ti+1x Ti :

(3.158)

This leads to the discrete equation for point i at time level n

Tin+1


Tin x

kt 1 n+1
T
x 2 i 1


2Tin+1 + Tin+1+1 +

1 n
T
2 i 1


2Tin + Tin+1

= 0 :(3.159)

This is an implicit scheme for the heat equation and one has to solve a tridiagonal
system to obtain T at time level n + 1.

Example 21

It is fairly easy to establish that (3.159) is a consistent discretization of the


heat equation and to infer the order of the scheme from the equivalent partial di erential
equation. In this example we will study the stability of the scheme.
If we replace in (3.159) Tin by the harmonic E n exp(^i) and divide by exp(^i) we
obtain

E n+1

E n x


kt  n+1
E (cos  1) + E n (cos  1) = 0 ;
x

(3.160)

84

DISCRETIZATION SCHEMES

or


kt
n+1 = 1 + k t (cos  1) E n :
(cos

1)
E
x2
x2

(3.161)

And therefore

G=

E n+1 1 + kx2t (cos  1) 1 2 kx2t sin2 (=2)


=
;
=
En
1 kx2t (cos  1) 1 + 2 kx2t sin2 (=2)

where we used the fact that cos  = 1


is that

(3.162)

2 sin2 (=2). So the only requirement for stability

kt
> 0 =) k > 0 :
x2

(3.163)

If this is the case the scheme is stable for all x and t and therefore the scheme is
called unconditionally stable. The restriction k > 0 is not a real restriction, because the
partial di erential equation would become unstable if k < 0 as we have seen earlier. See
also Exercise 7.

In this section the nite di erence method and the nite volume method for a sample
parabolic equation have been treated. An important new concept that was introduced
was the concept of stability. We already had the concept of consistency of the discrete
scheme. These two requirements for a scheme lead to an important theorem. Alternative
ways to discretize the heat equation will be treated in Exercise 8 and 9.

Theorem 2

Lax Theorem

For a well-posed initial value problem and a consistent disretization scheme, stability
is a necessary and sucient condition for convergence.

This fundamental theorem shows that in order to establish convergence of a numerical


scheme, i.e. to show that the approximate solution will converge to the exact solution for
t; x ! 0, two requirements have to be met




The numerical scheme has to be consistent, and


The numerical scheme has to be stable.

The same concepts will play a role in the next section where hyperbolic schemes will
be discussed.

3.3. HYPERBOLIC SCHEMES


3.3

85

Hyperbolic schemes

The last type of equations to be considered are of hyperbolic type. Just like in the
previous two sections we will rst consider the direct discretization of the di erential
form by means of the nite di erence method. This approach will be followed by the
nite volume method.
In this section we consider the hyperbolic equation

@u
@u
+a =0:
@t
@x

(3.164)

This equation has to be supplemented with initial conditions and boundary conditions (if
we consider a nite spatial domain). If we consider an in nite spatial domain and impose
the initial condition

u(x; 0) = f (x) ;
the solution is given by

u(x; t) = f (x at) :

(3.165)

The solution is constant along the characteristic as was already established in Chapter 2.
Although this speci c hyperbolic equation might seem it bit arbitrary, it is in fact
a rather generic equation. We have seen in Chapter 2, Example 2.30, that a system of
hyperbolic equations can be written in diagonal form in which equation has the form
(3.164).
In contrast to the elliptic and parabolic equations the nite speed with which information is carried through the computational domain and particularly the direction in
which the information is passed will play a dominant role in the numerical approach to
hyperbolic equations. As in the previous two section we will start with nite di erence
method.

3.3.1 Finite Di erence Method


We will use the same mesh as was used for the time dependent parabolic equation, see
Fig. 3.7. Let us rst try to approximate the spatial derivative with respect to x using the

86

DISCRETIZATION SCHEMES

point uni and its two neighborig points. A Taylor series expansion of these two neighboring
points gives

ui 1 = ui

@u x2 @ 2 u
x +
@x i
2 @x2 i


x3 @ 3 u
+ O x4 ;

3
6 @x i

ui = ui ;


@u x2 @ 2 u x3 @ 3 u
+
+ O x4 :
ui+1 = ui + x +


2
3
@x i
2 @x i
6 @x i

By taking a suitable linear combination of ui 1 , ui and ui+1 we can approximate the


partial derivative @u=@x.

ui 1 + ui + ui+1  ( + + )ui + (

x2 @ 2 u
( + )
+ (
2 @x2 i

@u
)x +
@x i

x3 @ 3 u
x4 @ 4 u
5 :
)
+
(

+

)
+
O

x
6 @x3 i
24 @x4 i

(3.166)

In order to approximate the derivative with respect to x we need to have

+ + =0
x + x = 1

(3.167)
(3.168)

This yields

@u (1 x)ui+1 + 2 xui

@x i
2x

(1 + x)ui

(3.169)

We see that in contrast to the elliptic and parabolic equation we have an additional
parameter to play with. For = 0 the approximation to the rst order derivative
becomes second order accurate.

3.3. HYPERBOLIC SCHEMES

87

Of course we do not have to restrict ourselves to the value ui and its direct neighbors,
see Exercise ??.
Time discretisation For the time discretization we will use the points uni and uni +1 just
like we did for the parabolic equation. Expanding uni +1 in terms of uni and its derivatives
gives

@u n uni +1 uni
 t :
@t i

(3.170)

3.3.1.1 Forward in time, Central in space, FTCS


The rst scheme we are going to consider forms a combination of (3.169) and (3.170) in
which we choose = 0, since this renders second order accuracy in x. The resulting
scheme is called Forward in Time and Central in Space (FTSC) and is given by

un
un
uni +1 uni
+ a i+1 i 1 = 0 :
t
2x

(3.171)

This is an explicit nite di erence scheme, because the new value uni +1 can be expressed
directly in terms of the known values from the previous time level. No linear system of
equations needs to be solved. In order to assess convergence of this scheme we have to
check whether the scheme is consistent and stable.

Consistency Using the Taylor series expansions we see that (3.171) approximates the

equation

@u
@u t @ 2 u
x2 @ 3 u
+a +
+
a
+ O(t2 ; x4 ) :
2
3
@t
@x 2 @t
6 @x

(3.172)

This equation is called the equivalent di erential equation (also called the modi ed
di erential equation). This is the equation we are approximating even better than the
one we started out to approximate initially. The additional terms

T =

t @ 2 u
x2 @ 3 u
+
a
+ O(t2 ; x4 ) :
2 @t2
6 @x3

(3.173)

are called the truncation error. Consistency now requires that the truncation error
tends to zero for t and x tending to zero. From (3.173) we see T ! 0 if both

88

DISCRETIZATION SCHEMES

t; x ! 0, provided utt and uxx remain bounded! The order of the scheme is given by
the leading order terms in the truncation error, so the FTCS scheme is order O(t; x2 ).

Stability The second condition which needs to be checked is stability. Suppose we


insert a solution of the form unj = E n e^j into the scheme (3.171). This gives
(E n+1 E n ) ^j aE n ^(j +1)
e +
e
t
2x

e^(j

1) 

=0;

(3.174)

or, dividing by e^j

E n+1

 
E n + E n 2^ sin  = 0 ;
2

(3.175)

where the parameter

=

at
;
x

(3.176)

has been introduced.


Stability now requires that the amplitude of any error harmonic, E n , does not grow
in time, that is, the ratio

jGj 
by

n+1
E



En

1

for all  :

(3.177)

The quantity G is called the ampli cation function. For the FTCS-scheme G is given

G = 1 ^ sin  :

(3.178)

So

jGj2 = 1 + 2 sin2  ;

(3.179)

3.3. HYPERBOLIC SCHEMES

89

and therefore the scheme is unconditionally unstable. Nearly all error modes will grow
in time. There are exactly two modes which are stable. Which modes?
The rather disappointing conclusion is that the FTCS scheme is not convergent. This
could already be seen from the equivalent di erential equation (3.172). Using the fact
that the exact solution satis es ut + aux = 0 we can convert the leading order error in t
in an spatial error
t @ 2 u a2 t @ 2 u
=
;
2 @t2
2 @x2

(3.180)

and we therefore approximate up to order O(t2 ; x2 ) the modi ed di erential equation

@u
@u
+a =
@t
@x

a2 t @ 2 u
:
2
| 2{z @x }
negative di usion

(3.181)

This is a convection-di usion equation with a negative di usion coecient ( a2 t2 =2)
and we have seen in Chapter 2 that the di usion equation with negative coecient blows
up in time. So the explicit rst order approximation in time results in an unstable scheme.
Let us therefore change this approximation in order to remove this de ciency.

3.3.1.2 Leapfrog scheme


One way of avoiding the instability associated with the forward Euler scheme is to use a
higher order approximation for the time derivative. The leapfrog4 scheme is obtained by

uni +1 uni
2t

uni+1 uni 1
+a
=0:
2x

(3.182)

This scheme is consistent and marginally stable, see Exercise 11, if j j = jat=xj  1.
Marginally stable means that the ampli cation factor is equal to 1 for all t and x.
For non-linear problems this is often to strict. Another disadvantage is that the leapfrog
scheme is that it requires two time levels to start the time integration ("The method is
not self-starting"), so in addition to the solution u(x; 0) = f (x) at t = 0 we also need
4 Leapfrog:

in Dutch "bokjespringen"

90

DISCRETIZATION SCHEMES

@u=@t at t = 0. A consistent initial condition would be to set @u=@t = af 0 (x) as given


by the di erential equation. Alternatively, one could start with a di erent method and
continue the calculation using the leapfrog scheme after u(x; t) has been determined.
Apart from the initial step and its marginal stability which may deteriorate non-linear
problems, the major disadvantage is that when one wants to solve problems with damped
solution, for instance problems with a source term or some arti cial dissipation the scheme
becomes unstable. See Exercise 12. The reason is that the time integration method, which
is known as the Midpoint Method, possesses a parasitic solution which grows in time if
the real part of the eigenvalues deviates from zero.
Another drawback is that due to the mariginal stability there is no safety margin
which is especially disadvantagous in non-linear problems.

3.3.1.3 Upwind schemes


So far we have seen that the FTCS scheme is non-convergent because the time integration introduces an error that will progressively grow in time. The equivalent di erential
equation reveals that it is the adverse di usion is the cause of this instability. One way
to overcome this de ciency is to chose a space discretisation which introduces some di usion with the proper sign to counterbalance the `wrong' di usion introduced by the time
integration. This leads to the so-called upwind schemes.
Let us return to the space discretisation given by the general 3-point scheme (3.169).
If we choose for

= sign(a)=x
then the following discretisation for @u=@x is obtained

@u
@x

8 ui ui 1
<
x

if a > 0

ui+1 ui
x

if a < 0

:

(3.183)

So for a > 0 we have using the notation for  introduced previously

uni +1 = uni

 uni

uni 1 :

(3.184)

3.3. HYPERBOLIC SCHEMES

91

Its ampli cation function is

G = 1 2 sin2


2

^ sin  ;

(3.185)

which can be represented by a circle in the complex plane with center at (


real axis and radius  , therefore the scheme will be stable when

1) on the

01:

(3.186)

The scheme is therefore conditionally stable. The limitation on the time step for a given
spatial step x is given by
0  t 

x
:
a

(3.187)

Note that this restriction is less severe than the stability condition for the explicit scheme
for the heat equation, see the previous section. For negative wave speeds the scheme
(3.184) becomes unstable.
The requirement that 0    1 can be geometrically interpreted as follows:
Characteristic dx/dt=a

n+1

a t
i-1

i+1

Figure 3.15: Graphical interpretation of the CFL condition,   1.


In Fig. 3.15 it can be seen that the stability requirement   1 expresses that the
mesh ratio t=x has to be chosen such that the domain of dependence of the di erential

92

DISCRETIZATION SCHEMES

equation should be contained in the domain of dependence of the numerical scheme. In


other words, the numerical scheme de ning the approximation uni +1 must be able to
include all the physical information which in uences the behaviour of the system at that
point. This condition is generally known as the Courant-Friedrichs-Lewy conditions, or
brie y, the CFL condition. The varaible  is called the CFL number.

The truncation error T is

T =

@2u
ax
(1  ) 2 ; ;
2
@x

(3.188)

showing that the scheme is only rst order accuarte in space and time and that the
equivalent equation has a dissipative term with a numerical viscosity coecient ax(1
 )=2. So whereas the exact solution transports the initial solution unaltered through the
domain with velocity a, this scheme damps the solution (if  6= 1) untill after a long
time the initial pro le is completely lost. This phenomenon is shown in Figs. 3.16 and
3.17. In Fig. 3.16  = 1 and the initial signal is transported undisturbed through the
computational domain. Fig. 3.17 is the numerical solution obtained by taking  = 0:5. In
this case the amplitude of the discrete solution decays as result of the numerical di usion
and the initial solution is smeared out.

1
0.9
0.8
0.7

0.6
0.5
0.4
0.3
0.2
0.1
0

10

20

Figure 3.16: Upwind discetization of the linear convection equation with  = 1:0
Another way to see that the upwind scheme introduce arti cial di usion is to rewrite

3.3. HYPERBOLIC SCHEMES

93

the system in central form

uni +1 uni uni uni 1 uni +1 uni uni+1 uni 1 ax uni+1 2uni + uni 1
+a
=
+a
= 0 :(3.189)
t
x
t
2x
2
x2
So essentially we are solving the original unstable FTCS scheme with a di usion term
with di usion coecient ax=2. Since this added di usion is a result of the numerical
scheme and depends on the numerical parameters, in this case x, it is called arti cial
di usion or numerical di usion. As already mentioned this numerical di usion damps
the original solution in the case where there is no physical di usion present. But even
if physical di usion is present such as is the case in the Navier-Stokes equations one has
to make sure that the arti cial di usion does not dominate the physical di usion, since
this would lead to erronous conclusions. A well-known case would be to solve the NavierStokes equations at a Reynolds number of 106 , but due to the numerical di usion we are
only modelling a ow with Reynolds number of 50. This is one of the major drawbacks
of upwind schemes. To list just a few





The low accuracy of the scheme, only rst order in space and time;
The addition of false di usion to the system, and
The need to nd the proper directions of the wave speeds

This latter point will be shown in the next example

Example 22
@2
@t2

c2

Consider the equation

@2
=0:
@x2

(3.190)

Introducing the auxiliary varibales u = t and v = x this equation can be written as

@u
@t

c2

@v
@t

@v
=0
@x

(3.191)

@u
=0
@x

Multiplying this systen with the matrix L whose rows consist of the left eigenvectors

L=

1
1

c
c

(3.192)

94

DISCRETIZATION SCHEMES

1
0.9
0.8
0.7

0.6
0.5
0.4
0.3
0.2
0.1
0

10

20

Figure 3.17: Upwind discetization of the linear convection equation with  = 0:5
gives

@
@
(u + cv ) c (u + cv ) = 0
@t
@x

(3.193)

@
@
(u cv ) + c (u cv ) = 0
@t
@x

We see, yet again, that the equations for u + cv and u cv are completely decoupled and we
can treat them as separate convection equations with characteristic speeds c, respectively.
Applying the rst order upwind scheme to these two equations gives, assuming c > 0

uni +1 + cvin+1 uni


t
uni +1

cvin+1

t

cvin

uni + cvin

c
+c

uni+1 + cvin+1 uni


x
uni

cvin

cvin

uni 1 + cvin 1

x

Multiplying these two equation by the inverse of

=0
(3.194)
=0

L gives the upwind discretization of the

3.3. HYPERBOLIC SCHEMES

95

original system (3.191)

uni +1 uni
t
vin+1

t

vin

uni+1
c

vin+1

2uni + uni 1
2x
2uni + uni 1

2x

vin+1
2
c

vin 1
=0
2x

uni+1

uni 1

2x

(3.195)

=0

I leave it to the reader to show that this scheme is indeed consistent, stable and rst order
accurate in time and space. See also Exercise 19.

This example shows how to apply the upwind scheme to rst order systems. The need to
rst diagonalize the system, then to apply upwinding and to nally rewrite everything in
the original unknowns may be cumbersome, especially when one deals with large system
or system where the velocity c is determined by the solution, in which you don't know in
advance how to discretize the system, see also Exercise 13.
If c = 0 the viscosity term is completely lost. For problems occuring in gas dynamics
this will be the case at stagnation points and at sonic points. For negative propagation
speeds c < 0, the following one sided scheme is stable

uni +1 = uni

 (uni+1

uni ) :

(3.196)

The ampli cation function in this case is given by

G = 1 + 2 sin2


2

^ ;

(3.197)

which leads to the stability criterion


10:

(3.198)

The reason these schemes are called upwind schemes stems from the fact that the
discretization depends on the direction of the ow and only points upwind or upstream
of the point considered are taken in consideration.
This has an immediate e ect on the number and type of boundary conditions which
can or must be prescribed. For the scheme the scheme (3.184) we need to prescribe a
value at point i = 0 when we want to discretize at the point i = 1. Similarly, when using
(3.196) in the point i = N 1 the value unN should be prescribed. This is in agreement
with the physical situation.

96

DISCRETIZATION SCHEMES

3.3.1.4 Lax-Friedrichs scheme


An alternative way to mend the de ciency in the FTCS scheme given by

uni +1 = uni

 n
u
2 i+1

uni 1 ;

(3.199)

is to replace the rst occurance of uni in this scheme by the average of the two neighboring
points (uni+1 + uni 1 )=2 which leads to the scheme

uni +1 =

 n
u
2 i+1


1 n
ui+1 + uni 1
2

uni 1 :

(3.200)

I personally think this is a very elegant solution, because the scheme turns out the be
stable for 1    1. Apply the Von Neumann analysis to establish this fact! But
the question remains, how can this `small' modi cation stabalize the scheme? In order to
analyze this let us write the Lax-Friedrichs scheme in a more conventional form

uni +1 = uni

 n
u
2 i+1

uni 1 + correction term = 0 :

(3.201)

The correction terms are given by


correction term =

1 n
u
2 i+1

uni + uni 1 =

x2 uni+1 uni + uni 1


;
2
x2

(3.202)

so what we essentially have done by replacing uni by the average of its two neighboring
points is to introduce arti cial di usion to the system just like we have done for the
upwind scheme. An advantage, however, is that we don't have to make a distinction
between the sign of the waves. Especially for systems of hyperbolic rst order equations
this circumvents the necessity to diagonalize the system rst, to nd the proper wave
directions. The arti cial di usion coecient is given by x2 =(2t) as can be seen from
(3.202).

3.3.1.5 Lax-Wendro scheme


Another modi cation to the unstable FTCS scheme is due to Lax and Wendro . The
idea behind this method is to expand the unknown uni +1 in uni and its derivatives using a
Taylor series expansion.

uni +1 = uni + t

@u t2 @ 2 u
+
+ O(t3 ) :
@t
2 @t2

(3.203)

3.3. HYPERBOLIC SCHEMES

97

Now we use the di erential equation to replace @u=@t by


a2 @ 2 u=@x2 . This gives

uni +1 = uni

at

a@u=@x and @ 2 u=@t2 by

@u a2 t2 @ 2 u
+
+ O(t3 ) :
@x
2 @x2

(3.204)

All spatial derivatives are now discretized centrally. This gives

uni +1

= uni

uni+1 uni 1 a2 t2 uni+1 2uni + uni 1


at
+
:
2x
2
x2

(3.205)

This scheme is called the Lax-Wendro scheme. Note that this scheme also adds an
amount of numerical dissipation to the scheme to stabilize it. This scheme is second order
accurate both in space and time.
The Lax-wendro scheme given above is called the one-step Lax-Wendro scheme,
beacuse the new value uni +1 is obtained in one step. An alternative form is the following
+1=2
Step 1: uni+1
=2 =


1 n
at n
ui+1 + uni +
u
2
2x i+1

Step 2: uni +1 = uni

at  n+1
u
x i+1=2

uni ; Lax-Friedrichs step : (3.206)

uni +11==22 ; Leapfrog scheme :

(3.207)

This is just one way of decomposing the Lax-Wendro scheme into two steps and it is
called the Richtmyer scheme. These methods have been developed in the mid 1960's and
are currently being re-invented in the nite element world.
Although the two-step scheme given above is equivalent to the one-step Lax-Wendro
method, di erences will be introduced if these schemes are applied to non-linear PDE's.

3.3.2 Finite Volume Method


Here the nite volume method will be applied in steps. First the integral respect to space
is evaluated, then the integration with respect to time.
Suppose we integrate out model problem over een arbitrary interval [x1 ; x2 ] then
Z x2
x1

@u
dx + a (u(x2 ) u(x1 )) = 0 :
@t

(3.208)

98

DISCRETIZATION SCHEMES

Or since the interval [x1 ; x2 ] is xed in time

@
@t

Z x2
x1

u dx = au(x1 ) au(x2 ) :

(3.209)

Now de ne the average value of u over the interval [x1 ; x2 ] as

u =

jx2 x1 j

Z x2
x1

u dx :

(3.210)

Then (3.209) can be written as

jx2 x1 j @@tu = au(x1) au(x2 ) =

(f (x2 )

f (x1 )) ;

(3.211)

in which f denotes the ux function (see Chapter 1) which in this speci c example is
equal to f = au.
At this stage still no numerical approximation has been applied. The rst approximation we will introduce is to assume that the solution u is constant over the interval under
consideration. If for the intevals we choose [xi 1=2 ; xi+1=2 ] centered around the mesh point
xi we get the approximate solution as shown in Fig. 3.18.

u
uni+1

uni+2

uni
uni-1
uni-2

i-2

i-1
i-3/2

i+1

i
i-1/2

i+1/2

i+2

i+3/2

Figure 3.18: Finite Volume method with constant representation of u

3.3. HYPERBOLIC SCHEMES

99

The scheme now becomes in the control volume [xi


x

@ ui
=
@t

f (xi+1=2 ) f (xi

1=2 )

1=2 ; xi+1=2 ].

(3.212)

If we now integrate this with respect to time form t = nt to (n + 1)t we obtain

uni +1

uni

t  ^
=
f (xi+1=2 ) f^(xi
x

1=2 )

(3.213)

where f^ denotes the time average of the physical ux over the time interval [nt; (n+1)t].
So far we have only assumed that the solution is piecewise constant in the cells, but apart
from this assumption (3.213) is still exact. Since u is constant in each cell ui  ui .
What we have to do now is to advance the solution in time. After t seconds the
exact solution will look like the one shown in Fig. 3.19. The next step is to calculate the

a t

a t

a t

a t

uni+1
uni+2

uni
uni-1
n

ui-2

i-2

i-1
i-3/2

i+1

i
i-1/2

i+1/2

i+2

i+3/2

Figure 3.19: Finite Volume method with constant representation of u


new averages in the cells and set ui equal to the average ui in that cell. Of course this
introduces an error in the scheme. For the linear equation considered in this section we
can explicitly calculate this average. The new average follows from Fig. 3.19 and is given
by

uni +1 =

atuni 1 + (x at)uni


= uni
x

at n
u
x i

uni 1 :

(3.214)

100

DISCRETIZATION SCHEMES

So this more physical approach of exactly convecting the piecewise constant solution and
averaging leads to the familiar rst order upwind scheme.
In general this procedure is not possible, therefore we are going to introduce a numerical ux function.
This ux function will in general depend on all the nearby values ui, so if f~ denotes
the numerical ux

f~ = f~(: : : ; ui 1 ; ui; ui+1 ; : : : ) :

(3.215)

The scheme then becomes

uni +1

uni =

t  ~
f
x i+1=2

f~i


1=2

(3.216)

As can be seen from Fig. 3.18 the value of the ux at the interfaces of the cells is
multi-valued. A reasonable choice therefore seems

a
f~i+1=2 = (ui + ui+1 ) :
2

(3.217)

Inserting this in (3.216) leads to the FTCS scheme which proved to be unconditionally
unstable.
However, just after the solution has started to change with respect to time, it is the
situation as sketched between Fig. 3.18 and 3.19 the physical ux is given by f^i+1=2 = aui
and therefore it makes sense to use as numerical ux

f~i+1=2 = aui :

(3.218)

Inserting this in (3.216) gives the rst order upwind scheme. Note that if a < 0 all the
plateaus in Fig. 3.19 would have been shifted to the left and de ning f~i+1=2 = aui+1 would
seem the natural procedure.
Numerical modelling in terms of the nite volume method can be re ned by chosing
better approximations of f~ to f^ and to use a higher order polynomial with the cell, instead
of the constant values that were used in this example.
For the linear case considered here is, it was rather easy to deduce how the step
function at the interface would evolve in time. For non-linear hyperbolic problems, such

3.4. OVERVIEW

101

as the Euler equations, the time dependent solution resulting from a step in the initial
conditions gives rise to the so-called Riemann problem. This problem will be treated in
the course Gas Dynamics (AE4-140 and AE4-141).
The numerical schemes based on solving the Riemann problem or an approximate
Riemann problem will be discussed in the course Numerical Methods in Aerodynamics,
part II (AE4-152).

3.4

Overview

This chapter addressed the numerical treatment of the various types of di erential equations. Boundary integral methods, nite di erence methods and nite volume methods
have been considered. For time-dependent problems the issue of stability has been extensively treated, both for partial di erential equations and di erence equations. This
chapter now concludes with a few exercises in which you have to apply the ideas treated
in this chapter.

3.5

Exercises

Exercise 6

Consider the two dimensional Laplace equation on the unit square

@2u @2u
+
= 0 ; (x; y ) 2 [0; 1]  [0; 1] :
@x2 @y 2
This equation is solved using a nite volume method in which the control volumes are
chosen around the point (i; j ) as shown in Fig. ??
a Assuming x = y and using the midpoint integration rule determine the FV
discretization.
b What is the order of the scheme obtained.
c Chose a global node numbering in the mesh and determine the the shape of the
resulting matrix.
d Using the FV scheme as described above. How would one incorporate a prescribed
boundary condition at the left boundary, i.e. for i = 0.

102

DISCRETIZATION SCHEMES

j+1
test

test

y
j-1
x
i-1

i+1

Figure 3.20: Finite Volume method: Control Volume

Exercise 7
@T
@t

The heat equation

@2T
=0:
@x2

1<x<1; t>0:

(3.219)

Is discretized by the following scheme

Tin+1 Tin
t

k  n+1
 Ti 1
x2

2Tin+1 + Tin+1+1 + (1 ) Tin 1

2Tin + Tin+1



; (3.220)

in which 0    1.
a Calculate the truncation error of this scheme.
b For which  is the scheme second order accurate both in space and time?
c Perform a stability analysis. For which  does the scheme becomes unconditionally stable?

Exercise 8

The Richardson scheme for the heat equation is given by

Tin+1 Tin
2t

Tin+1

2Tin + Tin 1
=0:
2x

(3.221)

3.5. EXERCISES

103




The determine the order of the Richardson scheme.

Analyze the stability for this scheme. Hint: For multi-level schemes write the difference equation in matrix form as follows: Insertion of the harmonic E n exp(^i)
in the above scheme gives a relation for the amplitude at three di erent time levels,
i.e. E n 1 , E n and E n+1 . This can be written in matrix form as

This scheme is `not self-starting'. Give various ways of circumventing diculties


in the rst time step if Ti0 is given.


E n+1
En

z


G
}|

a b
c d

{ 

En
En 1

(3.222)

Determine the coecients in the matrix, the G-matrix in this case. The stability
condition now states that the eigenvalues of the matrix G satisfy jG j  1.

Exercise 9

The Dufort-Frankel scheme for the heat equation is given by

TIn+1 Tin
2t





Tin+1

Tin 1 + TIn+1 + Tin 1


=0:
2x

(3.223)

Determine the order of this scheme.


Is this discretization consistent?
Analyze the stability. Use the hint given in Exercise 8

Exercise 10

We have seen in Chapter 2 that the rst order derivative is an anti-symmetric


operator. Determine which of the discretisations (3.169) lead to an anti-symmetric discrete scheme. Hint: write the discrete equations of (3.169) in matrix form
0
B
B
B
B
B
@

..
.
(ux)i i 1
(ux)i
(ux)i+1
..
.

C
C
C
C
C
A

B
B
AB
B
B
@

..
.

ui 1
ui
ui+1
..
.

1
C
C
C
C
C
A

and determine under which conditions the matrix A becomes anti-symmetric.

104

DISCRETIZATION SCHEMES

Exercise 11

Show that the leapforg scheme (3.182) is consistent. What is the order
of the scheme. Apply Von Neumann analysis to determine under which conditions the
scheme is stable.

Exercise 12

We want to solve the following partial di erential equation

@u
@u
+ a + u = 0 :
@t
@x

(3.224)

Show that this solution ultimately decays to zero if  > 0 and exponentially grows in time
if  < 0.
In order to tackle this problem we have decided to use a leapfrog scheme given by

uni +1 uni
2t

+a

uni+1 uni 1
+ uni = 0
2x

(3.225)

Determine the stability of the scheme for  > 0 and  < 0.


Now analyze the leapfrog scheme with the upwind space discretisation of the convection
equation ut + aux = 0. This is the scheme

uni +1

uni 1 = 2 (uni

uni 1 ) :

Calculate the ampli cation matrix and show the connection with the previous equation.
In order to understand why the leapfrog scheme behave so poorly we look at the equation

dw
= w ;
dt

(3.226)

and apply the leapfrog scheme. For which values of  will this scheme be stable? What
kind of restrictions does this impose on the semi-discrete eigenvalues. How do these results
compare to the conclusions obtained for the Richardson scheme, Exercise 8?

Exercise 13

Consider the system of rst order di erential equations

8 @u
< @t

+ a @u
@x =

: @v
@t

@v
+ a @x

@v
@x

= c2 @u
@x

x 2 [0; 1]and t > 0 ; a; c > 0 2 <2 :

(3.227)

3.5. EXERCISES

105

a Determine the type of the this system.

b Determine the characteristic speeds, determine the matrix L consisting of the left
eigenvectors and show that the compatibility equations are given by
8 @
< @t (cu

v ) + (a + c) @x@ (cu v ) = 0

: @
@t (cu + v ) + (a

c) @x@ (cu + v ) = 0

c Use a rst order upwind discretization and a forward Euler integration in time to
discretize the compatibility equations. Assume a > 0 and make a distinction between
a < c and a > c.
d Transform the discrete equations back to the original variables by premultiplying the
discrete equation by the matrix R consisting of the right eigenvectors. Show that
this yields a consistent discretization of (3.227). Determine the order of the scheme.
e Analyze the stability of the discrete version of (3.227) obtained in 2d.

Exercise 14

Proof Theorem 1.

Exercise 15

Find the exact solution to the system

@~u
= A~u ;
@t

(3.228)

with the 5  5 matrix A given by


0

B
B
B
=B
B
B
@


0
..
.
..
.
..
.

1

0
..
.
..
.

0 ::: :::
1 0 :::
 1 0
0  1
..
. 0 

1
C
C
C
C
C
C
A

(3.229)

and

ui (x; 0) = C0 (x) ; 0  i  N :

(3.230)

Show that A is non-diagonizable and determine the exact solution. Show that although
the real part of all eigenvalues may be less than zero the solution will initially grow in
time. Does this have any implications for the long time behaviour of the system?

106

DISCRETIZATION SCHEMES

Exercise 16

In this chapter we have calculated the eigenvalues of the semi-discrete heat


equation. These eigenvalues are given by

m =

2k
(cos
x2

1) ; =

2m
:
N +1

(3.231)

We can also calculate the eigenvalues for the operator

@2
:
@x2

(3.232)

These eigenvalues are determined by the equation

@ 2 Tm
= m Tm ; x 2 [0; L] ;
@x2

(3.233)

with periodic boundary conditions Tm (0) = Tm (L) and @Tm (0)=@x = @Tm (L)=@x. Show
that the eigenvalues of the di erential operator (3.232) and eigenfunctions are given by

m =

4km2  2
and Tm (x) = e^mx=L :
L2

(3.234)

Plot the rst 25 eigenvalues of the di erential operator (3.232) and the semi-discrete
eigenvalues for various values of N . Do the semi-discrete eigenvalues converge to the
eigenvalues of the di erential operator? Proof the convergence

lim m = m :

N !1

(3.235)

Note that based on this analysis it seems a reasonable idea to set up a numerical approximation of the form

T h (x; t)

N
X
i=0

i (t)Ti (x) ;

(3.236)

where the Ti (x) are the eigenfunctions of the di erential operator given above. Set up an
equation for the i 's and solve for all i 's. How do we nd the integration constants for
the i 's?
This numerical approach is known as the spectral collocation scheme. A very interesting feature of this approach is that adding more terms in the expansion (3.236) reduces
the error in the numerical approximation exponentially.

3.5. EXERCISES
Exercise 17
mined to be

cm =

107

The semi discrete eigenvalues for the pure convection equation were deter-

^c
sin :
x

(3.237)

For the upwind and downwind discretization the eigenvalues were determined to be

um =

c
(cos
x

1 + ^ sin ) and dm =

c
(cos
x

1 + ^ sin ) ;

(3.238)

respectively. Show that in the limit N ! 1 all three m 's converge to the same limit.
Show that this unique limit value for the semi-discrete eigenvalues is an eigenvalue of the
linear convection operator

@
:
@x

(3.239)

Determine the correspondig eigenfunctions and use these eigenfunctions to set up a spectral collocation scheme as proposed in the previous exercise. How does this approach
compare with the Fourier symbol method discussed in this chapter.

Exercise 18

Use a Taylor series expansion to develop a higher order spatial approximation for the linear convection equation using the point ui 2, ui 1, ui, ui+1 and ui+2 .
Determine the coecients such that the approximation to @u=@x is O(x4 ). If we apply
this higher order scheme to a linear convection equation with periodic boundary conditions, it will give rise to a circulant semi-discrete matrix. Determine the eigenvalues, ho
m
of this matrix. Do these eigenvalues converge to the same limiting values as determined
in the previous exercise for very large values of N ? How does the higher order scheme
e ect stability if we use the explicit Euler time marching method?

Exercise 19

It is fairly easy to write a code to solve the problem discussed in Example 22.
Write such a code for periodic boundary conditions and experiment with various values
of the CFL-number. For which values of the CFL number is the scheme stable. Can you
prove this.

108

You might also like