Sie sind auf Seite 1von 38

Review

Second Order Methods


Multi-Dimensions
Summary

S ECOND O RDER M ETHODS FOR PARABOLIC


PDE S

Dr. Johnson

School of Mathematics

Semester 1 2008

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

F IRST O RDER M ETHODS FOR P RABOLIC PDE S

The explicit method is the simplest method, taking the


difference approximations at tk .
The scheme is first order in t,
The stability condition requires 1/2.
The implicit method takes the difference approximations
at tk+1
The scheme is first order in t,
The scheme is unconditionally stable.

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

F IRST O RDER M ETHODS FOR P RABOLIC PDE S

The explicit method is the simplest method, taking the


difference approximations at tk .
The scheme is first order in t,
The stability condition requires 1/2.
The implicit method takes the difference approximations
at tk+1
The scheme is first order in t,
The scheme is unconditionally stable.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

W HERE TO TAKE YOUR APPROXIMATION ?

We know that the central difference formula for a first


derivative is second order.
How to exploit this?
We have that
j1
wkj +1 wj t2 3 u

u
= + ,
t xj ,tk 2t 6 t3 xj ,tk

so if we use this in a scheme we should get a second order


scheme...

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

W HERE TO TAKE YOUR APPROXIMATION ?

We know that the central difference formula for a first


derivative is second order.
How to exploit this?
We have that
j1
wkj +1 wj t2 3 u

u
= + ,
t xj ,tk 2t 6 t3 xj ,tk

so if we use this in a scheme we should get a second order


scheme...

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

R ICHARDSON S M ETHOD

Richardsons Method is a good example of what not to do!


It is as follows:

wkj +1 wjk1 wkj+1 2wkj + wkj1


" #
= .
2t x2

The resulting method is O(x2 , t2 ).


Unfortunately it has serious stability problems!
It is unconditionally unstable.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

R ICHARDSON S M ETHOD

Richardsons Method is a good example of what not to do!


It is as follows:

wkj +1 wjk1 wkj+1 2wkj + wkj1


" #
= .
2t x2

The resulting method is O(x2 , t2 ).


Unfortunately it has serious stability problems!
It is unconditionally unstable.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

D U F ORT-F RANKEL M ETHOD

We can construct a stable second-order explicit method


centered at k:

wkj +1 wjk1 wj+1 wkj +1 wjk1 + wkj1


" k #
= .
2t x2

Although the scheme is stable, problems do arise with


errors in the scheme.
We show later that errors are O(x2 ), O(t2 ) and
O(t2 /x2 ).
Hence the scheme is inconsistent if t/x remains a
constant.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

D U F ORT-F RANKEL M ETHOD

We can construct a stable second-order explicit method


centered at k:

wkj +1 wjk1 wj+1 wkj +1 wjk1 + wkj1


" k #
= .
2t x2

Although the scheme is stable, problems do arise with


errors in the scheme.
We show later that errors are O(x2 ), O(t2 ) and
O(t2 /x2 ).
Hence the scheme is inconsistent if t/x remains a
constant.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

A BETTER WAY TO DIFFERENCE

One of the most popular schemes is derived by taking the


average of the explicit and implicit schemes.
The Crank-Nicolson scheme is both unconditionally stable
and second order.
We can think of it as differencing on the half-time step.
It is as follows:

wkj +1 wkj wkj+1 2wkj + wkj1 wkj++11 2wkj +1 + wkj+11


" #
= + .
t 2x2 2x2

The resulting system of equations are solved in the same


manner as the implicit scheme.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

A BETTER WAY TO DIFFERENCE

One of the most popular schemes is derived by taking the


average of the explicit and implicit schemes.
The Crank-Nicolson scheme is both unconditionally stable
and second order.
We can think of it as differencing on the half-time step.
It is as follows:

wkj +1 wkj wkj+1 2wkj + wkj1 wkj++11 2wkj +1 + wkj+11


" #
= + .
t 2x2 2x2

The resulting system of equations are solved in the same


manner as the implicit scheme.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

D U F ORT-F RANKEL AGAIN


Let us return to the Du Fort-Frankel (DFF) scheme

wkj +1 wjk1 wkj+1 wkj +1 wjk1 + wkj1


" #
= .
2t x2

Now rewrite the scheme as

wkj +1 wjk1 wkj+1 2wkj + wkj1 wkj +1 2wkj + wjk1


" #
= ,
2t x2 x2

and we can see that the third term is like a second


derivative in time.
We know the truncation errors for first and second
derivatives.
Dr. Johnson MATH65241
Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

D U F ORT-F RANKEL AGAIN


Let us return to the Du Fort-Frankel (DFF) scheme

wkj +1 wjk1 wkj+1 wkj +1 wjk1 + wkj1


" #
= .
2t x2

Now rewrite the scheme as

wkj +1 wjk1 wkj+1 2wkj + wkj1 wkj +1 2wkj + wjk1


" #
= ,
2t x2 x2

and we can see that the third term is like a second


derivative in time.
We know the truncation errors for first and second
derivatives.
Dr. Johnson MATH65241
Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

C ONSISTENCY ON DFF

From

wkj +1 wjk1 wkj+1 2wkj + wkj1 wkj +1 2wkj + wjk1


" #
= ,
2t x2 x2

we may substitute in the approximation terms with


truncation errors to get

t2 x2 t2 t2

ut + uttt = uxx + uxxxx 2 utt + utttt .
6 12 x 12

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

Then if we let t = x and x, t 0, the equation which


we solve will be

ut = (uxx utt ) .

Hence the scheme is inconsistent since this equation is not


the original equation.
Errors in the solution will therefore be dominated by the
t2
x2
term.
t
We can force this term to be small by setting = C. x2
Note that this constrains us as much as the stability
condition on the explicit scheme.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

Then if we let t = x and x, t 0, the equation which


we solve will be

ut = (uxx utt ) .

Hence the scheme is inconsistent since this equation is not


the original equation.
Errors in the solution will therefore be dominated by the
t2
x2
term.
t
We can force this term to be small by setting = C. x2
Note that this constrains us as much as the stability
condition on the explicit scheme.

Dr. Johnson MATH65241


Review
Centering the Approximation at k
Second Order Methods
Crank-Nicolson Scheme
Multi-Dimensions
Consistency
Summary

Then if we let t = x and x, t 0, the equation which


we solve will be

ut = (uxx utt ) .

Hence the scheme is inconsistent since this equation is not


the original equation.
Errors in the solution will therefore be dominated by the
t2
x2
term.
t
We can force this term to be small by setting = C. x2
Note that this constrains us as much as the stability
condition on the explicit scheme.

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

A N EXPLICIT METHOD
The schemes outlined above are easily extended to
multi-dimensions.
Thus in two space dimensions a first order explict
approximation to

u
= 2 u,
t
is

wki,j+1 wki,j wki+1,j 2wki,j + wki1,j wki,j+1 2wki,j + wki,j1


" #
= + ,
t x2 y2

This is first order in t and second order in space.


Dr. Johnson MATH65241
Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

A N EXPLICIT METHOD
The schemes outlined above are easily extended to
multi-dimensions.
Thus in two space dimensions a first order explict
approximation to

u
= 2 u,
t
is

wki,j+1 wki,j wki+1,j 2wki,j + wki1,j wki,j+1 2wki,j + wki,j1


" #
= + ,
t x2 y2

This is first order in t and second order in space.


Dr. Johnson MATH65241
Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

S TABILITY CONSTRAINTS

The explicit scheme is conditionally stable for

t t 1
2
+ 2 .
x y 2

This is again derived from the spectral radius of the


iteration matrix.

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

If we use a fully implicit scheme we would obtain

wki,j+1 wki,j wki++1,j


1
2wki,j+1 + wki+1,j
1
wki,j++11 2wki,j+1 + wki,j+11
" #
= + ,
t x2 y2

Leading to equations of the form

wki++1,j
1
wki+1,j
1
+ (2 + 2 + 1)wki,j+1 wki,j++11 wki,j+11 = wki,j

with = t/x2 and = t/y2 .


So the problem reduces to solving an elliptic type PDE at
each timestep.

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

If we use a fully implicit scheme we would obtain

wki,j+1 wki,j wki++1,j


1
2wki,j+1 + wki+1,j
1
wki,j++11 2wki,j+1 + wki,j+11
" #
= + ,
t x2 y2

Leading to equations of the form

wki++1,j
1
wki+1,j
1
+ (2 + 2 + 1)wki,j+1 wki,j++11 wki,j+11 = wki,j

with = t/x2 and = t/y2 .


So the problem reduces to solving an elliptic type PDE at
each timestep.

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

O UTLINE

1 R EVIEW
2 S ECOND O RDER M ETHODS
Centering the Approximation at k
Crank-Nicolson Scheme
Consistency

3 M ULTI -D IMENSIONS
Explicit Schemes
Implicit Schemes
Centered Approximation

4 S UMMARY

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

S ECOND ORDER SCHEMES

We could construct a Crank-Nicolson scheme in


multi-dimensions,
but there will not be any direct methods to solve the
resulting equation.
The explicit method may in fact be more efficient than the
Crank-Nicolson when iterations are taken into account.
So we can use the ADI method, which has three desirable
traits:
Unconditionally stable;
Second order in time and space dimensions;
Uses simple direct solvers no iteration.
The idea is alternate explicit/implicit in the space
dimensions

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

S ECOND ORDER SCHEMES

We could construct a Crank-Nicolson scheme in


multi-dimensions,
but there will not be any direct methods to solve the
resulting equation.
The explicit method may in fact be more efficient than the
Crank-Nicolson when iterations are taken into account.
So we can use the ADI method, which has three desirable
traits:
Unconditionally stable;
Second order in time and space dimensions;
Uses simple direct solvers no iteration.
The idea is alternate explicit/implicit in the space
dimensions

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

S ECOND ORDER SCHEMES

We could construct a Crank-Nicolson scheme in


multi-dimensions,
but there will not be any direct methods to solve the
resulting equation.
The explicit method may in fact be more efficient than the
Crank-Nicolson when iterations are taken into account.
So we can use the ADI method, which has three desirable
traits:
Unconditionally stable;
Second order in time and space dimensions;
Uses simple direct solvers no iteration.
The idea is alternate explicit/implicit in the space
dimensions

Dr. Johnson MATH65241


Review
Explicit Schemes
Second Order Methods
Implicit Schemes
Multi-Dimensions
Centered Approximation
Summary

T HE ADI S CHEME

The scheme can be written in two half steps.


(1) Implicit in x, explicit in y.

wki,j+1/2 wki,j wki++1,j


1/2
2wki,j+1/2 + wki+1,j
1/2
wki,j+1 2wki,j + wki,j1
" #
= + ,
t/2 x2 y2

(2) Explicit in x, implicit in y.

wki,j+1 wki,j+1/2 wki++1,j


1/2
2wki,j+1/2 + wki+1,j
1/2
wki,j++11 2wki,j+1 + wki,j+11
" #
= +
t/2 x2 y2

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

When choosing a scheme we must consider:


Consistency;
Stability;
Order;
Solution methods (direct/iterative).
No one scheme is best in all situations.
Second order schemes (such as Crank-Nicolson) are
usually preferred.

Dr. Johnson MATH65241


Review
Second Order Methods
Multi-Dimensions
Summary

When choosing a scheme we must consider:


Consistency;
Stability;
Order;
Solution methods (direct/iterative).
No one scheme is best in all situations.
Second order schemes (such as Crank-Nicolson) are
usually preferred.

Dr. Johnson MATH65241

Das könnte Ihnen auch gefallen