Você está na página 1de 5

von Neumann Stability Analysis

The Diusion 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 T
n
j
=
n
e
ikjh
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 coecients in the equation are so slowly varying that they may be considered constant
in both space and time. Substituting this into the nite dierence formula:
T
n+1
j
T
n
j

= D
T
n
j+1
2T
n
j
+ T
n
j1
h
2

n+1
e
ikjh

n
e
ikjh

= D

n
e
ik(j+1)h
2
n
e
ikjh
+
n
e
ik(j1)h
h
2
1

= D
e
ikh
2 + e
ikh
h
2
1 =
2D
h
2
[cos(kh) 1]
= 1 +
2D
h
2
[cos(kh) 1]
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 nd 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/h
2
1 or h
2
/(2D) which is the condition used in lab 7.
If we look at the equation with centered time derivatives
T
n+1
j
T
n1
j
2
= D
T
n
j+1
2T
n
j
+ T
n
j1
h
2

n+1
e
ikjh

n1
e
ikjh
2
= D

n
e
ik(j+1)h
2
n
e
ikjh
+
n
e
ik(j1)h
h
2

2
1
2
= D
e
ikh
2 + e
ikh
h
2

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

4D
2

2
h
4
[cos(kh) 1]
2
+ 1
if cos(kh) = 1 then = 1. If cos(kh) = 1 then
=
4D
h
2

16D
2

2
h
4
+ 1
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 nite dierencing
T
n+1
j
T
n
j

= D
T
n
j+1
2T
n
j
+ T
n
j1
h
2
we wish to move the spatial derivatives to time n + 1/2 by using the averages:
T
n+1
j
T
n
j
=
D
h
2

T
n+1
j+1
+ T
n
j+1
2
2
T
n+1
j
+ T
n
j
2
+
T
n+1
j1
+ T
n
j1
2

Substituting T
n
j
=
n
e
ikjh

n+1
e
ikjh

n
e
ikjh
=
D
2h
2
(
n+1
e
ik(j+1)h
+
n
e
ik(j+1)h
2
n+1
e
ikjh
2
n
e
ikjh
+
n+1
e
ik(j1)h
+
n
e
ik(j1)h
)
1 =
D
2h
2
(e
ikh
+ e
ikh
2 2 + e
ikh
+ e
ikh
)
= 1
D
h
2
( + 1)[1 cos(kh)]
=
1
D
h
2
[1 cos(kh)]
1 +
D
h
2
[1 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 nite dierencing will result in
T
n+1
j
2T
n
j
+ T
n1
j

2
= c
2
T
n
j+1
2T
n
j
+ T
n
j1
h
2
.
Substituting T
n
j
=
n
e
i
kjh as above we get

n+1
e
ikjh
2
n
e
ikjh
+
n1
e
ikjh

2
= c
2

n
e
ik(j+1)h
2
n
e
ikjh
+
n
e
ik(j1)h
h
2
.
Dividing by
n1
e
ikjh
/
2
we get

2
2 + 1 =
2c
2

2
h
2
[cos(kh) 1]

2
2

1 +
c
2

2
h
2
[cos(kh) 1]

+ 1 = 0.
Solving for
=

1 +
c
2

2
h
2
[cos(kh) 1]

1 +
c
2

2
h
2
[cos(kh) 1]

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

1
2c
2

2
h
2

2
c
h

c
2

2
h
2
1.
If we now let c
2

2
/h
2
= 1,
= (1 2) 2

0 = 1
and the method is stable (|| 1). If we let q = c/h and have 0 < q < 1 the rst thing we
notice is that the square root will now give us an imaginary number. Then
= (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 nd that, for
the given range of q, ||
2
= 1 and the equation is stable. If you put any value q > 1 you will
nd that || > 1 and the equation is unstable. So the CFL condition becomes c/h 1 or
h/c, the condition specied in the lab manual.
If you look at the 2-dimensional version you will nd that the equation reduces to
=

1
4c
2

2
h
2

8c
2

2
h
2

2c
2

2
h
2
1

.
Through the same process as above, you nd that the condition for stability is c
2

2
/h
2
1/2
so h/(c

2). This should be the condition you determined in lab 6.

Você também pode gostar