Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Review Multiple Shooting Richardson Extrapolation Summary

BVP S M ULTIPLE S HOOTING T ECHNIQUE


Dr. Johnson
School of Mathematics

Semester 1 2008

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

B OUNDARY VALUE P ROBLEMS


Boundary value problems are commonplace in CFD and mathematics in general Newtons Shooting method: gn+1 = gn (gn ) (gn )

Can use the Secant method to generate , or solve the augmented system to generate and use Newtons method Newtons method is quadratic, so should converge in 5-15 iterations
Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

B OUNDARY VALUE P ROBLEMS


Boundary value problems are commonplace in CFD and mathematics in general Newtons Shooting method: gn+1 = gn (gn ) (gn )

Can use the Secant method to generate , or solve the augmented system to generate and use Newtons method Newtons method is quadratic, so should converge in 5-15 iterations
Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

A FOURTH ORDER PROBLEM


Consider the problem: d4 y = y3 dx4 with the boundary conditions y(0) = 1, y (0) = 0, y(1) = 2, and y (1) = 1 We have two starting conditions at x = 0, and two nal conditions at x = 1. Therefore we need to guess y and y(IV ) at x = 0 dy dx
2

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

A FOURTH ORDER PROBLEM


Consider the problem: d4 y = y3 dx4 with the boundary conditions y(0) = 1, y (0) = 0, y(1) = 2, and y (1) = 1 We have two starting conditions at x = 0, and two nal conditions at x = 1. Therefore we need to guess y and y(IV ) at x = 0 dy dx
2

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

I NITIAL C ONDITIONS

Let us dene Y1 = y, Y2 = y , Y3 = y , and Y4 = y then our initial conditions will look like Y1 = 1, Y2 = 0, Y3 = e, and Y4 = g where e and g are guesses

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

I NITIAL C ONDITIONS

Let us dene Y1 = y, Y2 = y , Y3 = y , and Y4 = y then our initial conditions will look like Y1 = 1, Y2 = 0, Y3 = e, and Y4 = g where e and g are guesses

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

S ATISFYING THE BOUNDARY CONDITIONS


We now have two conditions to satisfy, and hence two functions 1 (e, g) =Y1 (x = 1; e, g) 2 2 (e, g) =Y2 (x = 1; e, g) 1 We need to iterate on both e and g to ensure both 1 = 0 and 2 = 0 To proceed we need to use a Taylor expansion for a function of two variables f (x + a, y + b) = f (x, y) + a
Dr. Johnson

f f + b + R1 (x, y) x y

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

S ATISFYING THE BOUNDARY CONDITIONS


We now have two conditions to satisfy, and hence two functions 1 (e, g) =Y1 (x = 1; e, g) 2 2 (e, g) =Y2 (x = 1; e, g) 1 We need to iterate on both e and g to ensure both 1 = 0 and 2 = 0 To proceed we need to use a Taylor expansion for a function of two variables f (x + a, y + b) = f (x, y) + a
Dr. Johnson

f f + b + R1 (x, y) x y

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

TAKING A GUESS
Then let us perform a Taylor expansion around the guesses e and g to get 1 + dg 1 + R1 (e, g) e g 2 2 + dg + R1 (e, g) 2 (e + de, g + dg) =2 (e, g) + de e g 1 (e + de, g + dg) =1 (e, g) + de

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

TAKING A GUESS
Then let us perform a Taylor expansion around the guesses e and g to get 1 + dg 1 + R1 (e, g) e g 2 2 + dg + R1 (e, g) 2 (e + de, g + dg) =2 (e, g) + de e g

1 (e + de, g + dg) =1 (e, g) + de

Set both (e + de, g + dg) = 0, and the remainder R1 = 0.

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

TAKING A GUESS
Then let us perform a Taylor expansion around the guesses e and g to get 1 de + e 2 de + e 1 dg = 1 (e, g) g 2 dg = 2 (e, g) g

and we are left with simultaneous equations for de and dg. In matrix form this can be written as: J(g )dg = (g )
Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

High Order Problems Correcting the guess

T HE SOLUTION

Given the equations in matrix form, J(g )dg = (g ) where g is a vector of guesses, is the vector of conditions and J is the Jacobian matrix. We can write the correction as dg = J1 (g )(g ).

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

O UTLINE
R EVIEW M ULTIPLE S HOOTING
High Order Problems Correcting the guess
3

R ICHARDSON E XTRAPOLATION
Exploiting our knowledge of errors

S UMMARY

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

T RUNCATION ERRORS
Suppose that we use a method with truncation error of O(hm ) to compute an approximation wi . We can exploit the way in which our approximation converges towards the solution
0.71 0.7 0.69 0.68
wn

0.67 0.66 0.65 0.64 0.63 0 0.01 0.02 0.03 h 0.04 0.05 0.06 0.07

The most common technique is Richardson extrapolation.


Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

T RUNCATION ERRORS
Suppose that we use a method with truncation error of O(hm ) to compute an approximation wi . We can exploit the way in which our approximation converges towards the solution
0.71 0.7 0.69 0.68
wn

0.67 0.66 0.65 0.64 0.63 0 0.01 0.02 0.03 h 0.04 0.05 0.06 0.07

The most common technique is Richardson extrapolation.


Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

T WO APPROXIMATIONS ARE BETTER THAN ONE


(1)

Suppose wn is an approximation with step size h and wn with step size 2h Then we can write wn = yi + E0 hm + E1 hm+1 + . . . and wn = yi + E0 (2h)m + E1 (2h)m+1 + . . .
(2) (1) (2)

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

T WO APPROXIMATIONS ARE BETTER THAN ONE


(1)

Suppose wn is an approximation with step size h and wn with step size 2h Then we can write wn = yi + E0 hm + E1 hm+1 + . . . and wn = yi + E0 (2h)m + E1 (2h)m+1 + . . .
(2) (1) (2)

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

T WO APPROXIMATIONS ARE BETTER THAN ONE


So eliminating the rst term E0 we have 2m wn wn = (2m 1)yi + O(hm+1 ) then
wn (1) (2)

2m wn wn = 2m 1

(1)

(2)

= yi + O(hm+1 )
(1) (2)

and the approximation wn is better than wn or wn .

For a fourth order method such as RK4 the above gives


wn =

16wn wn 15

(1)

(2)

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

T WO APPROXIMATIONS ARE BETTER THAN ONE


So eliminating the rst term E0 we have 2m wn wn = (2m 1)yi + O(hm+1 ) then
wn (1) (2)

2m wn wn = 2m 1

(1)

(2)

= yi + O(hm+1 )
(1) (2)

and the approximation wn is better than wn or wn .

For a fourth order method such as RK4 the above gives


wn =

16wn wn 15

(1)

(2)

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

E XAMPLE - E ULER S M ETHOD


Solve y = x + sin(y) with y(0) = 0 at x = 1 n 16 32 64 128 256 512 1024 h 0.0625 0.03125 0.01562 0.00781 0.00390 0.00195 0.00097 wn 0.6336 0.6709 0.6902 0.7000 0.7049 0.7074 0.7086
wn = 2wn wn (1) (2) (1) (2)

|wn wn |
0.0373 0.0192 0.0097 0.0049 0.0024 0.0012

ratio

0.7083 0.7095 0.7098 0.7098 0.7099 0.7099

1.9370 1.9687 1.9844 1.9922 1.9961

We get similar accuracy extrapolating with n = 16 and n = 32, as we do by taking n = 1024 Extrapolation will not always work this well! It depends on how smooth the errors are.
Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

M ORE GENERAL R ICHARDSON EXTRAPOLATION


Let A(h) and A h be approximations to Y that depends k on the step size h for some k h k h k
m

A(h) = Y + a0 hm + . . . ,

= Y + a0

+...

then we may write the general approximation A (h) as

A (h) =

km A

h k m k

A(h) 1

We may perform further extrapolations on the extrapolated results to eliminate higher order errors
Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

Exploiting our knowledge of errors

M ORE GENERAL R ICHARDSON EXTRAPOLATION


Let A(h) and A h be approximations to Y that depends k on the step size h for some k h k h k
m

A(h) = Y + a0 hm + . . . ,

= Y + a0

+...

then we may write the general approximation A (h) as

A (h) =

km A

h k m k

A(h) 1

We may perform further extrapolations on the extrapolated results to eliminate higher order errors
Dr. Johnson MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

S UMMARY
If we have a vector of guesses, the correction can be written as: dg = J1 (g )(g ) We can use either the Secant method or solve the augmented system to generate the Jacobian J. If we know the order of a scheme, we can exploit it to generate better approximations at low expense. The general formula for Richardson extrapolation is: km A
h k m k

A (h) =

A(h) 1

Dr. Johnson

MATH65241

Review Multiple Shooting Richardson Extrapolation Summary

S UMMARY
If we have a vector of guesses, the correction can be written as: dg = J1 (g )(g ) We can use either the Secant method or solve the augmented system to generate the Jacobian J. If we know the order of a scheme, we can exploit it to generate better approximations at low expense. The general formula for Richardson extrapolation is: km A
h k m k

A (h) =

A(h) 1

Dr. Johnson

MATH65241

You might also like