You are on page 1of 5

von Neumann Stability Analysis

The Diffusion Equation


In order to determine the Courant-Friedrichs-Levy condition for the stability of an
explicit solution of a PDE you can use the von Neumann stability analysis. To do this you
assume that the solution is of the form Tjn = n eikjh where represents the time dependence
of the solution and the exponential represents the spatial dependence. In the exponential jh
represents the position along the grid and k is the spatial wave number. It is assumed that
the coefficients in the equation are so slowly varying that they may be considered constant
in both space and time. Substituting this into the finite difference formula:
n
Tjn+1 Tjn
T n 2Tjn + Tj1
= D j+1

h2

n+1 eikjh n eikjh


n eik(j+1)h 2 n eikjh + n eik(j1)h
=D

h2
1
eikh 2 + eikh
=D

h2
1=

2D
[cos(kh) 1]
h2

=1+

2D
[cos(kh) 1]
h2

In order for the solution to be stable in time we must have || 1. Otherwise, since
n is a positive integer, n will be a rapidly growing value. So we look for the largest possible
value of || and find the condition to keep it 1.
If cos(kh) = 1 then = 1. If cos(kh) = 1 (the second term is as negative as possible)
then || 1 only if 2D /h2 1 or h2 /(2D) which is the condition used in lab 7.

If we look at the equation with centered time derivatives


n
T n 2Tjn + Tj1
Tjn+1 Tjn1
= D j+1
2
h2

n+1 eikjh n1 eikjh


n eik(j+1)h 2 n eikjh + n eik(j1)h
=D
2
h2
2 1
eikh 2 + eikh
= D
2
h2
2

4D
[cos(kh) 1] 1 = 0
h2

2D
= 2 [cos(kh) 1]
h

4D2 2
[cos(kh) 1]2 + 1
h4

if cos(kh) = 1 then = 1. If cos(kh) = 1 then


4D
= 2
h

16D2 2
+1
h4

Since we are looking for the condition || 1, the worst case is going to be when we use the
negative sign on the square root. Since the square root is always greater than 1 and both
terms are negative then the magnitude of will always be greater than one no matter how
small we choose to be.

And now to look at the stability of the Crank-Nicholson scheme that we use in lab 8.
From the initial finite differencing
n
n
Tjn+1 Tjn
Tj+1
2Tjn + Tj1
=D

h2

we wish to move the spatial derivatives to time n + 1/2 by using the averages:
Tjn+1

Tjn

D
= 2
h

n+1
n+1
n
n
Tj+1
+ Tj+1
Tjn+1 + Tjn Tj1
+ Tj1
2
+
2
2
2

Substituting Tjn = n eikjh


n+1 eikjh n eikjh =

D
( n+1 eik(j+1)h + n eik(j+1)h 2 n+1 eikjh
2h2
n ikjh
n+1 ik(j1)h
n ik(j1)h

2 e

+ e

1=

D
(eikh + eikh 2 2 + eikh + eikh )
2h2

=1

D
( + 1)[1 cos(kh)]
h2

1
1+

D
[1
h2
D
[1
h2

cos(kh)]
cos(kh)]

It is easy to see that the magnitude of the right-hand side of this equation is always less
than or equal to one no matter what the value of . This algorithm is inherently stable.

Staggered Leapfrog Algorithm


You can also use this analysis on the staggered leapfrog method from labs 5 and 6.
In one dimension, the finite differencing will result in
n
n
n
Tjn+1 2Tjn + Tjn1
2 Tj+1 2Tj + Tj1
=c
.
2
h2

Substituting Tjn = n ei kjh as above we get


n ik(j+1)h
2 n eikjh + n eik(j1)h
n+1 eikjh 2 n eikjh + n1 eikjh
2 e
=
c
.
2
h2

Dividing by n1 eikjh / 2 we get


2 2 + 1 =

2c2 2
[cos(kh) 1]
h2

c2 2
2 1 + 2 [cos(kh) 1] + 1 = 0.
h
!

Solving for
v
u

!2

u
c2 2
c2 2
= 1 + 2 [cos(kh) 1] t 1 + 2 [cos(kh) 1]
h
h
!

1.

If cos(kh) = 1, = 1, which isnt very enlightening. If cos(kh) = 1,


2c2 2
= 1
h2

c
2
h

c2 2
1.
h2

If we now let c2 2 /h2 = 1,

= (1 2) 2 0 = 1
and the method is stable (|| 1). If we let q = c /h and have 0 < q < 1 the first thing we
notice is that the square root will now give us an imaginary number. Then
q

= (1 2q 2 ) i2q 1 q 2 .
What is really important now is the magnitude of which can be found by ||2 = where
the indicates the complex conjugate. If you carry out this operation you will find that, for
the given range of q, ||2 = 1 and the equation is stable. If you put any value q > 1 you will

find that || > 1 and the equation is unstable. So the CFL condition becomes c /h 1 or
h/c, the condition specified in the lab manual.
If you look at the 2-dimensional version you will find that the equation reduces to
4c2 2
= 1
h2

v
u 2 2
u 8c
t

h2

2c2 2
1 .
h2

Through thesame process as above, you find that the condition for stability is c2 2 /h2 1/2
so h/(c 2). This should be the condition you determined in lab 6.

You might also like