You are on page 1of 20

Review

Stability: Explicit Method


Stability: Crank-Nicolson
Summary

S TABILITY FOR PARABOLIC S OLVERS

Dr. Johnson

School of Mathematics

Semester 1 2008

university-logo

Dr. Johnson MATH65241


Review
Stability: Explicit Method
Stability: Crank-Nicolson
Summary

O UTLINE

1 R EVIEW
2 S TABILITY: E XPLICIT M ETHOD
Explicit Method as a Matrix Equation
Growing Errors
Stability Constraint

3 S TABILITY: C RANK -N ICOLSON


Crank-Nicolson in a Matrix
Bounding the Growth of Errors
Matrix Polynomials

4 S UMMARY
university-logo

Dr. Johnson MATH65241


Review
Stability: Explicit Method
Stability: Crank-Nicolson
Summary

F IRST AND S ECOND O RDER M ETHODS FOR


PARABOLIC PDE S

The explicit method is first order and has a stability


constraint.
The implicit method is first order and unconditionally stable.
But requires a direct solver.
The Crank-Nicolson is the average of the two schemes above.
It is second order.
It is unconditionally stable.
Multidimensional scheme require careful consideration.
ADI scheme may be preferred to Crank-Nicolson since it only
requires a 1D direct solver.
university-logo

Dr. Johnson MATH65241


Review
Explicit Method as a Matrix Equation
Stability: Explicit Method
Growing Errors
Stability: Crank-Nicolson
Stability Constraint
Summary

Consider the first order explicit scheme which can be written


as

wjk +1 = βwjk−1 + (1 − 2β)wjk + βwjk+1 ,

for 1 ≤ i ≤ n − 1, with w0 , wn given.


We can write the above in matrix form as

 
(1 − 2β) β

 β (1 − 2β) β 

w k +1 =
 .. .. ..  k
w
 . . . 
 β (1 − 2β) β 
β (1 − 2β)
university-logo

Dr. Johnson MATH65241


Review
Explicit Method as a Matrix Equation
Stability: Explicit Method
Growing Errors
Stability: Crank-Nicolson
Stability Constraint
Summary

S OME U SEFUL R ESULTS FOR M ATRIX N ORMS


1 ||cA|| = |c | ||A|| for a scalar c
2 ||AB || ≤ ||A|| ||B ||.
3 Gerschgorin’s first theorem

The largest of the moduli of te eigenvalues of the square matrix A


cannot exceed the largest sum of the moduli of the elements along
any row or column.

ρ(A) ≤ ||A||1 or ||A||∞

4 Gerschgorin’s circle theorem and the norm of matrix A

If the eigenvalues λs are estimated by the circle theorem, then the


condition |λs | ≤ 1 is equivalent to ||A||1 or ||A||∞ . university-logo

Dr. Johnson MATH65241


Review
Explicit Method as a Matrix Equation
Stability: Explicit Method
Growing Errors
Stability: Crank-Nicolson
Stability Constraint
Summary

T HE G ROWTH OF E RRORS - E IGENVALUES

Now we have

wk +1 = Awk
Recall that if we begin some error e0 , the error at the kth step
can be written

ek = Ak e0 .
Now express the initial error e0 as a linear combination of the
eigenvectors of A
n
e0 = ∑ cs v s .
s =1
university-logo

Dr. Johnson MATH65241


Review
Explicit Method as a Matrix Equation
Stability: Explicit Method
Growing Errors
Stability: Crank-Nicolson
Stability Constraint
Summary

T HE G ROWTH OF E RRORS - E IGENVALUES

Then we may write the error at the kth step as


n
ek = ∑ cs λks vs .
s =1

where λs are the eigenvalues of the matrix A.


This shows that errors will not increase exponentially if

max |λs | ≤ 1, s = 1, 2, . . . , n − 1.
s

This is equivalent to the condition

||A|| ≤ 1 university-logo

Dr. Johnson MATH65241


Review
Explicit Method as a Matrix Equation
Stability: Explicit Method
Growing Errors
Stability: Crank-Nicolson
Stability Constraint
Summary

C ONSTRAINT

Stability requires ||A|| ≤ 1 for the explicit method.


The infinity norm ||A||∞ is defined as
n
||A||∞ = max ∑ |ai,j |
j
i

for an n × n matrix A.
For the explicit method we have

||A||∞ = β + |1 − 2β| + β

The scheme is therefore stable when

2β + |1 − 2β| ≤ 1. university-logo

Dr. Johnson MATH65241


Review
Explicit Method as a Matrix Equation
Stability: Explicit Method
Growing Errors
Stability: Crank-Nicolson
Stability Constraint
Summary

C ONSTRAINT

We can evaluate the inequality

2β + |1 − 2β| ≤ 1.

to find that
1
||A|| ≤ 1 ⇐⇒ β ≤ .
2
Then the size of the timestep must satisfy

∆x 2
∆t ≤

university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

The Crank-Nicolson scheme may be written as

− βwjk−+11 + (2 + 2β)wjk +1 − βwjk++11 =


βwjk−1 + (2 − 2β)wjk + βwjk+1

for j = 1, 2, . . . , n − 1.
We can express this in matrix form as

Bwk +1 = Awk
So that the iteration matrix defined from

wk +1 = B −1 Awk
university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

T HE M ATRICES A AND B

 
(2 − 2β) β

 β (2 − 2β) β 

A=
 . .. . .. . .. 

 
 β (2 − 2β) β 
β (2 − 2β)
 
(2 + 2β) −β

 −β (2 + 2β) − β 

B=
 . . . . . . 
 . . . 

 − β (2 + 2β) −β 
−β (2 + 2β)
university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

We may also write them as

A = 2In−1 + βSn−1 ,
B = 2In−1 − βSn−1 .

where  
−2 1
 1 −2 1 
 
S=
 .. .. .. 
 . . . 

 1 −2 1 
1 −2

university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

The Crank-Nicolson scheme is defined by the equation

wk +1 = B −1 Awk
so the scheme will be stable if

||B −1 A|| ≤ 1, or max |λs | ≤ 1


s

This time we will work with the eigenvalues of the matrices,


rather than norms.
We need to show that the maximum eigenvalue of B −1 A is
less than unity.
How to find the eigenvalues?
university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

E IGENVALUES AND P OLYNOMIALS

Recall that λ is an eigenvalue of the matrix S, and x a


corresponding eigenvector if

Sx = λx.
Thus for any integer p

S p x = S p −1 Sx = S p −1 λx = · · · = λp x.
Hence the eigenvalues of S p are λp with eigenvector x.

university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

E IGENVALUES AND P OLYNOMIALS

Extending this result, if P (S ) is the matrix polynomial

P (S ) = a0 S n + a1 S n−1 + · · · + an I

then
1
P (S )x = P (λ)x, and P −1 ( S ) x = x
P (λ)

Finally if Q (S ) is any other polynomial in S then we see that

Q (λ)
P −1 ( S ) Q ( S ) x = x.
P (λ)
university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

B ACK TO C RANK -N ICOLSON ...

If we let

P = B (Sn−1 ) = 2In−1 − βSn−1 ,

and

Q = A(Sn−1 ) = 2In−1 + βSn−1

then the eigenvalues of the matrix B −1 A are given by

2 + βλ
µ=
2 − βλ

where λ is an eigenvalue of the matrix Sn−1 . university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

E IGENVALUES OF A T RIDIAGONAL M ATRIX

It can be shown that the generic tridiagonal matrix T where


 
b c
 a b c 
 
. . . .
T = . .. ..
 

 
 a b c 
a b

has the eigenvalues


½ ¾

λs = b + 2 ac cos , s = 1, 2, . . . , n − 1
n+1
university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

E IGENVALUES OF B −1 A

Hence the eigenvalues of Sn−1 are


n sπ o
λs = −4 sin2 , s = 1, 2, . . . , n − 1
2n
and so the eigenvalues of B −1 A are

2 − 4β sin2
© sπ ª
2n ª
µs = , s = 1, 2, . . . , n − 1
2 + 4β sin2
© sπ
2n

university-logo

Dr. Johnson MATH65241


Review
Crank-Nicolson in a Matrix
Stability: Explicit Method
Bounding the Growth of Errors
Stability: Crank-Nicolson
Matrix Polynomials
Summary

C ONSTRAINT ON C RANK -N ICOLSON

For stability, we require

max |µs | ≤ 1,
s

Clearly we can choose any value of beta and this will be


satisfied.
Hence the scheme is unconditionally stable.
If maxs |µs | ∼ 1 the solution may be prone to ringing.

university-logo

Dr. Johnson MATH65241


Review
Stability: Explicit Method
Stability: Crank-Nicolson
Summary

Errors will propogate through the solution;

ek = Ak e0 .
We can bound the errors by the equivalent conditions

||A|| ≤ 1, or max |λs | ≤ 1


s

Using the norm condition, we find the explicit scheme requires

1
β≤
2
and from eigenvalue analysis the Crank-Nicolson scheme has
no restrictions.
university-logo

Dr. Johnson MATH65241

You might also like