Professional Documents
Culture Documents
Diffusion Stability
Diffusion Stability
h2
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.
4D
[cos(kh) 1] 1 = 0
h2
2D
= 2 [cos(kh) 1]
h
4D2 2
[cos(kh) 1]2 + 1
h4
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
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.
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.
c
2
h
c2 2
1.
h2
= (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.