Sei sulla pagina 1di 5

Mathematics 171: Introduction to Numerical Analysis Aleph Continuum

PredictorCorrector Methods February 10, 2017

GOAL:
Numerically approximate the solution y(t) to the well-posed initial-value problem (IVP) y (t) = f (t, y(t)), y(a) = y0 on
the interval [a, b].

Recall:

Let [a, b] be the interval over which we want to find the solution y(t) to the well-posed IVP y (t) = f (t, y(t)), y(a) = y0 .
Divide the interval [a, b] into M subintervals, each of length h = ba
M . Select the mesh points tk = a + hk for k = 0, 1, . . . , M .

1. Eulers Method
yk+1 = yk + hf (tk , yk ) for k = 0, 1, . . . , M 1

2. Heuns Method
h
yk+1 = yk + [f (tk , yk ) + f (tk+1 , pk+1 )], pk+1 = yk + hf (tk , yk ) for k = 0, 1, . . . , M 1
2

Observe that in Heuns Method, pk+1 = yk + hf (tk , yk ) is already an approximation/prediction of y(tk+1 ) given by Eu-
lers Method, but we dont stop here. We want to improve this initial approximation/prediction, so we use the corrector
yk+1 = yk + h2 [f (tk , yk ) + f (tk+1 , pk+1 )] which can be derived from the Fundamental Theorem of Calculus (FTC) and the
Trapezoidal Rule applied to the nodes tk and tk+1 . Heuns Method is an example of what are called PredictorCorrector
Methods. In a PredictorCorrector Method, we first predict/approximate y(tk+1 ) using a predictor function, then we improve
this prediction/approximation using a corrector function.

ADAMSBASHFORTHMOULTON METHOD

The AdamsBashforthMoulton Method is a four-step method which requires yk3 , yk2 , yk1 , and yk in the calculation
of yk+1 . It is not self-starting; four initial points (t0 , y0 ), (t1 , y1 ), (t2 , y2 ), and (t3 , y3 ) must be given in advance in order to
generate the points {(tk , yk ) : k 4}.

To find a predictor for the AdamsBashforthMoulton Method, we must establish a relation that involves yk+1 , yk , yk1 ,
yk2 , and yk3 . Consider the interval [tk , tk+1 ]. From the IVP, we have y (t) = f (t, y(t)). By the FTC,
tk+1 tk+1
y (t) dt = y(t)|tk+1
t
f (t, y(t)) dt = k
= y(tk+1 ) y(tk )
tk tk
tk+1
y(tk+1 ) = y(tk ) + f (t, y(t)) dt (1)
tk

How do we introduce yk3 , yk2 , yk1 , and yk into the scene? We approximate f (t, y(t)) using the Lagrange
(1)
interpolatory polynomial P3 (t) based on the points (tk3 , fk3 ), (tk2 , fk2 ), (tk1 , fk1 ), and (tk , fk ). We then have
tk+1 tk+1
(1)
f (t, y(t)) dt P3 (t) dt.
tk tk

(1) (t tk2 )(t tk1 )(t tk ) (t tk3 )(t tk1 )(t tk )


P3 (t) =fk3 + fk2
(tk3 tk2 )(tk3 tk1 )(tk3 tk ) (tk2 tk3 )(tk2 tk1 )(tk2 tk )
(t tk3 )(t tk2 )(t tk ) (t tk3 )(t tk2 )(t tk1 )
+ fk1 + fk
(tk1 tk3 )(tk1 tk2 )(tk1 tk ) (tk tk3 )(tk tk2 )(tk tk1 )

Let t = t0 + hs. Then dt = h ds, tm tn = h(m n), and t tn = h(s n) m, n {0, 1, . . . , M }.

(1) h3 (s k + 2)(s k + 1)(s k) h3 (s k + 3)(s k + 1)(s k)


P3 (t) =fk3 3
+ fk2
h (1)(2)(3) h3 (1)(1)(2)
h3 (s k + 3)(s k + 2)(s k) h3 (s k + 3)(s k + 2)(s k + 1)
+ fk1 3
+ fk
h (2)(1)(1) h3 (3)(2)(1)
(1) fk3 fk2
P3 (t) = [(s k) + 2][(s k) + 1](s k) + [(s k) + 3][(s k) + 1](s k)
6 2
fk1 fk
[(s k) + 3][(s k) + 2](s k) + [(s k) + 3][(s k) + 2][(s k) + 1]
2 6
Let p = s k. Then dp = ds, and dt = h ds = h dp.

(1) fk3 fk2 fk1 fk


P3 (t) = (p + 2)(p + 1)p + (p + 3)(p + 1)p (p + 3)(p + 2)p + (p + 3)(p + 2)(p + 1)
6 2 2 6
fk3 3 f k2 f k1 fk
= (p + 3p2 + 2p) + (p3 + 4p2 + 3p) (p3 + 5p2 + 6p) + (p3 + 6p2 + 11p + 6)
6 2 2 6
tk+1 1[ ]
(1) fk3 3 fk2 3 fk1 3 fk
P3 (t) dt = (p + 3p2 + 2p) + (p + 4p2 + 3p) (p + 5p2 + 6p) + (p3 + 6p2 + 11p + 6) h dp
tk 0 6 2 2 6

tk+1 1
(1) hfk3 hfk2 1 3
P3 (t) dt = 3 2
(p + 3p + 2p) dp + (p + 4p2 + 3p) dp
tk 6 0 2 0
1
hfk1 hfk 1 3
(p3 + 5p2 + 6p) dp + (p + 6p2 + 11p + 6) dp
2 0 6 0

tk+1
(1) 9h 37h 59h 55h
P3 (t) dt = fk3 + fk2 fk1 + fk
tk 24 24 24 24
h
= (9fk3 + 37fk2 59fk1 + 55fk )
24
tk+1
h
f (t, y(t)) dt (9fk3 + 37fk2 59fk1 + 55fk )
tk 24
h
y(tk+1 ) y(tk ) +
(9fk3 + 37fk2 59fk1 + 55fk )
24
The result above suggests that the AdamsBashforth predictor be
h
pk+1 = yk + (9fk3 + 37fk2 59fk1 + 55fk ). (2)
24
Our next task is to determine the corrector which will improve the predicted value pk+1 . The derivation of the corrector

h
yk+1 = yk + [fk2 5fk1 + 19fk + 9f (tk+1 , pk+1 )] (3)
24
(2)
is left to the reader as an exercise. [Hint: A second Lagrange interpolatory polynomial P3 (t) for f (t, y(t)) is constructed
based on the points (tk2 , fk2 ), (tk1 , fk1 ), (tk , fk ), and the new point (tk+1 , fk+1 ) = (tk+1 , f (tk+1 , pk+1 )).]

Error Estimation and Correction

Theorem 1. The local truncation error (LTE) for the predictor and corrector of the AdamsBashforthMoulton Method
are of the order O(h5 ).

Proof. For the predictor, note that if f (x) C N +1 [a, b], where [a, b] is an interval containing xk , k = 0, 1, . . . , N , then x
[a, b],
f (x) = PN (x) + EN (x),
(x x0 )(x x1 ) (x xN ) N +1
EN (x) = f ((x)), (x) [x0 , xN ].
(N + 1)!
In particular, for f (t, y(t)),
(1) (t tk3 )(t tk2 )(t tk1 )(t tk ) (3+1)
E3 (t) = f (1 (t)).
(3 + 1)!
From (1),
tk+1
(1) (1)
y(tk+1 ) = y(tk ) + [P3 (t) + E3 (t)] dt.
tk
Hence, the LTE for the predictor is given by
tk+1 tk+1
(1) (t tk3 )(t tk2 )(t tk1 )(t tk ) (3+1)
E3 (t) dt = f (1 (t)) dt
tk tk (3 + 1)!

Let t = t0 + hs. Then dt = h ds, and t tn = h(s n). We have


tk+1 k+1
(1) h5 f (3+1) (1 (t))
E3 (t) dt = (s k + 3)(s k + 2)(s k + 1)(s k) ds
tk 24 k

Let p = s k. Then dp = ds, and


tk+1
(1) h5 f (3+1) (1 (t)) 1 251 (5)
E3 (t) dt = (p + 3)(p + 2)(p + 1)(p) dp = y (1 (t))h5 .
tk 24 0 720

19 (5)
It is left as an exercise to show that the error for the corrector is y (2 (t))h5 .
720
Corollary 1. If h is small enough, then y (5) (t) is nearly constant and thus we have
19
y(tk+1 ) yk+1 (yk+1 pk+1 ).
270
Proof. From the proof of Theorem 1, we have
251 (5)
y(tk+1 ) pk+1 = y (1 (t))h5 (4)
720
19 (5)
y(tk+1 ) yk+1 = y (2 (t))h5 (5)
720
where (4) and (5) are the LTE for the predictor and corrector, respectively. Let x = y (5) (2 (t))h5 . Then y (5) (1 (t))h5 x.
251 (5)
(4) y(tk+1 ) = pk+1 + y (1 (t))h5 (6)
720
19
(5) y(tk+1 ) yk+1 = x
720
(6) 251 (5) 19
pk+1 + y (1 (t))h5 yk+1 = x
720 720
251 19
pk+1 + yk+1 x
720 720
270
yk+1 pk+1 x
720
720
(yk+1 pk+1 ) x
270

MILNESIMPSON METHOD

The MilneSimpson Method is a four-step method which requires yk3 , yk2 , yk1 , and yk in the calculation of yk+1 .

To find a predictor for the MilneSimpson Method, we must establish a relation that involves yk+1 , yk , yk1 , yk2 , and yk3 .
Consider the interval [tk3 , tk+1 ]. From the IVP, we have y (t) = f (t, y(t)). By the FTC,
tk+1 tk+1
y (t) dt = y(t)|tk+1
t
f (t, y(t)) dt = k3
= y(tk+1 ) y(tk3 )
tk3 tk3

tk+1
y(tk+1 ) = y(tk3 ) + f (t, y(t)) dt (7)
tk3
How do we introduce yk3 , yk2 , yk1 , and yk into the scene? We approximate f (t, y(t)) using the Lagrange
(1)
interpolatory polynomial Q3 (t) based on the points (tk3 , fk3 ), (tk2 , fk2 ), (tk1 , fk1 ), and (tk , fk ). We then have
tk+1 tk+1
(1)
f (t, y(t)) dt Q3 (t) dt.
tk3 tk3

(1) (t tk2 )(t tk1 )(t tk ) (t tk3 )(t tk1 )(t tk )


Q3 (t) =fk3 + fk2
(tk3 tk2 )(tk3 tk1 )(tk3 tk ) (tk2 tk3 )(tk2 tk1 )(tk2 tk )
(t tk3 )(t tk2 )(t tk ) (t tk3 )(t tk2 )(t tk1 )
+ fk1 + fk
(tk1 tk3 )(tk1 tk2 )(tk1 tk ) (tk tk3 )(tk tk2 )(tk tk1 )
Let t = t0 + hs. Then dt = h ds, tm tn = h(m n), and t tn = h(s n) m, n {0, 1, . . . , M }.

(1) h3 (s k + 2)(s k + 1)(s k) h3 (s k + 3)(s k + 1)(s k)


Q3 (t) =fk3 3
+ fk2
h (1)(2)(3) h3 (1)(1)(2)
h3 (s k + 3)(s k + 2)(s k) h3 (s k + 3)(s k + 2)(s k + 1)
+ fk1 3
+ fk
h (2)(1)(1) h3 (3)(2)(1)

(1) fk3 fk2


Q3 (t) = [(s k) + 2][(s k) + 1](s k) + [(s k) + 3][(s k) + 1](s k)
6 2
fk1 fk
[(s k) + 3][(s k) + 2](s k) + [(s k) + 3][(s k) + 2][(s k) + 1]
2 6
Let p = s k. Then dp = ds, and dt = h ds = h dp.

(1) fk3 fk2 fk1 fk


Q3 (t) = (p + 2)(p + 1)p + (p + 3)(p + 1)p (p + 3)(p + 2)p + (p + 3)(p + 2)(p + 1)
6 2 2 6
fk3 3 fk2 3 fk1 3 fk
= 2
(p + 3p + 2p) + (p + 4p + 3p)
2
(p + 5p + 6p) + (p3 + 6p2 + 11p + 6)
2
6 2 2 6
tk+1 1[ ]
(1) fk3 3 fk2 3 fk1 3 fk
Q3 (t) dt = (p + 3p2 + 2p) + (p + 4p2 + 3p) (p + 5p2 + 6p) + (p3 + 6p2 + 11p + 6) h dp
tk3 3 6 2 2 6

tk+1 1
(1) hfk3 hfk2 1 3
Q3 (t) dt = (p3 + 3p2 + 2p) dp + (p + 4p2 + 3p) dp
tk3 6 3 2 3
1 1
hfk1 hfk
(p3 + 5p2 + 6p) dp + (p3 + 6p2 + 11p + 6) dp
2 3 6 3

tk+1
(1) 8h 4h 8h
Q3 (t) dt = fk2 fk1 + fk
tk3 3 3 3
h
= (8fk2 4fk1 + 8fk )
3
tk+1
h
f (t, y(t)) dt (9fk3 + 37fk2 59fk1 + 55fk )
tk3 24
h
y(tk+1 ) y(tk3 ) +
(8fk2 4fk1 + 8fk )
3
The result above suggests that the MilneSimpson predictor be
4h
pk+1 = yk3 + (2fk2 fk1 + 2fk ). (8)
3
Our next task is to determine the corrector which will improve the predicted value pk+1 . The derivation of the corrector
h
yk+1 = yk1 + [(fk1 + 4fk + fk+1 )] (9)
3
is left to the reader as an exercise. [Hint: A second Lagrange interpolatory polynomial Q2 (t) for f (t, y(t)) is constructed
based on the points (tk1 , fk1 ), (tk , fk ), and the new point (tk+1 , fk+1 ) = (tk+1 , f (tk+1 , pk+1 )).]

Error Estimation and Correction


Theorem 2. The local truncation error (LTE) for the predictor and corrector of the MilneSimpson Method are of the
order O(h5 ).
28 (5) 1
Proof. Exercise: Show that the LTE for the predictor is y ((t))h5 and y (5) (1 (t))h5 for the predictor. If h is small
90 90
enough, then y (5) (t) is nearly constant and thus we have
28
y(tk+1 pk+1 ) (yk+1 pk+1 ).
29

Improved MilneSimpson Method

4h
pk+1 = yk3 + (2fk2 fk1 + 2fk )
3
h
yk+1 = yk1 + [(fk1 + 4fk + fk+1 )]
3
28
mk+1 = pk+1 + (yk pk )
29
fk+1 = f (tk+1 , mk+1 )

The Right Step

When a predictorcorrector method is used to solve the IVP y (t) = f (t, y), where y(t0 ) = y0 , over a large interval,
diculties sometimes occur. If fy (t, y) < 0 and the step size is too large, a predictorcorrector method might be unstable.
As a rule of thumb, stability exists when a small error is propagated as a decreasing error, and instability exists when a small
error is propagated as an increasing error. When too large a step size is used over a large interval, instability will result and
sometimes manifest by oscillations in the computed solutions. They can be attenuated by changing to a smaller step size.
When step-size control is included, the following error estimate(s) should be used:
19
y(tk ) yk (pk yk )(AdamsBashforthMoulton Method)
270

pk yk
y(tk ) yk 29 (MilneSimpson Method)
y(tk ) yk 9
121 (p k yk ) (Hamming Method)

Potrebbero piacerti anche