Sie sind auf Seite 1von 25

Ordinary Differential

Equations : Predictor
Corrector Method
By
Syaiful Anam
Applied Mathematical Modeling and Computation Laboratory
Mathematics Department
Brawijaya University
Multi Step Methods
An m-step multistep method for solving the initial-value problem

y ' f t, y , a t b, y a , (1.1)

has a difference equation for finding the approximation wi 1 at the mesh point ti 1 represented

by the following equation, where m is an integer greater than 1:


wi 1 am1wi am2 wi 1 a0 wi 1m
h bm f ti 1 , wi 1 bm1 f ti , wi (1.2)

b0 f ti 1m , wi 1 m ,

for i m 1, m, , N 1 , where h b a N , the a0 , a1 , , am1 and b0 , b1 , , bm are


constants, and the starting values

w0 , w1 1 , w2 2 , , wm1 m1

are specified.
When bm 0 the method is called explicit, or open, since Eq. (1.2) then gives wi 1 explicitly in

terms of previously determined values. When bm 0 the method is called implicit, or closed,

since wi 1 occurs on both sides of Eq. (1.2) and is specified only implicitly.
EXAMLE 1
The equations

w0 , w1 1 , w2 2 , w3 3 ,
h (1.3)
wi 1 wi 55 f ti , wi 59 f ti 1 , wi 1 37 f ti 2 , wi 2 9 f ti 3 , wi 3 ,
24

for each i 3, 4, , N 1 , define an explicit four-step method known as the fourth-order

Adams-Bashforth technique. The equations

w0 , w1 1 , w2 2 ,
h (1.4)
wi 1 wi 9 f ti 1 , wi 1 19 f ti , wi 5 f ti 1 , wi 1 f ti 2 , wi 2 ,
24

for each i 2,3, , N 1 , define an implicit three-step method known as the fourth-order
Admas-Moulton technique.
The staring values in either (1.3) or (1.4) must be
specified, generally by assuming w0 and
generating the remaining values by either a Runge-
Kutta method or some other one-step technique.
To apply an implicit method such as (1.4) directly,
we must solve the implicit equation for wi 1 . It is
not clear that this can be done in general or that a
unique solution for wi 1 will always be obtained.
To begin the derivation of a multistep method, note that the solution to the initial-value problem

(1.1), if integrated over the interval ti , ti 1 , has the property that

y ti 1 y ti y ' t dt f t , y t dt.
ti 1 ti1

ti ti

Consequently,

y ti 1 y ti f t , y t dt.
ti 1
(1.5)
ti


Since we cannot integrate f t , y t without knowing y t , the solution to the problem, we


instead integrate an interpolating polynomial P t to f t , y t that is determined by some of

the previously obtained data points t0 , w0 , t1 , w1 , , ti , wi .


When we assume, in addition, that y ti wi , Eq. (1.5) becomes

y ti 1 wi P t dt.
ti 1
(1.6)
ti

Although any form of the interpolating polynomial can be used for the derivation, it is most
convenient to use the Newton backward-difference formula.
To derive an Adams-Bashforth explicit m-step technique, we form the backward-difference

polynomial Pm1 t through

t , f t , y t , t
i i i i 1
, f ti 1 , y ti 1 ,
, ti 1m , f ti 1m , y ti 1m .
Since Pm1 t is an interpolatory polynomial of degree m 1 , some number i in ti 1m , ti exists

with

f m i , y i
f t , y t Pm1 t t ti t ti 1 t ti 1m .
m!

Introducing the variable substitution t ti sh , with dt h ds into Pm1 t and the error term

implies that

ti 1 m 1 s k
f t , y t dt 1 f ti , y ti dt
ti 1

k
ti ti
k 0 k
f m i , y i
t ti t ti 1 t ti 1m dt
ti 1

ti m!
m 1
s
k f ti , y ti h 1
1
0 k ds
k

k 0

h m 1
s s 1 s m 1 f m i , y i ds.
1

m! 0
s
The integrals 1 ds for various values of k are easily evaluated and are listed in Table
k 1

0
k
5.10. For example, when k 3 ,

s 1 s s 1 s 2
1 0 ds 0
3 1
ds
3 1 2 3

s 3s 2 2s ds
1 1 3
6 0
1
1 s4
2 19 3
s 3
s .
6 4 0 6 4 8
Table
k 0 1 2 3 4 5
k 1 s 1 5 3 251 95
1 0 ds 1
k 2 12 8 720 288
As a consequence,


f t , y t dt h f ti , y ti f ti , y ti 2 f ti , y ti
ti1 1 5
ti
2 12
hm1 1

m! 0
s s 1 s m 1 f m
i , y i ds.

(1.7)
Since s s 1 s m 1 does not change sign on 0,1 , the Weighted Mean Value Theorem
for Integrals can be used to deduce that for some number i , where ti 1m i ti 1 , the error

term in Eq. (1.7) becomes

h m 1 1
s s 1 s m 1 f m i , y i ds
m! 0

h m 1 f
m
, y
s s 1 s m 1 ds
1

i i

m! 0

or

s
m
i , y i 1 0 m ds. (1.8)
1
m 1 m
h f

Since y ti 1 y ti f t , y t dt , Eq. (1.8) can be written as
ti 1

ti


y ti 1 y ti h f ti , y ti f ti , y ti 2 f ti , y ti
1 5
2 12

m 1 s
h f i , y i 1 ds.
m 1 m
0
m
(1.9)
EXAMPLE
To derive the three-step Adams-Bashforth technique, consider Eq. (1.9) with m 3 :

y ti 1 y ti h f ti , y ti f ti , y ti 2 f ti , y ti
1 5
2 12

y ti h f ti , y ti f ti , y ti f ti 1 , y ti 1
1
2

f ti , y ti 2 f ti 1 , y ti 1 f ti 2 , y ti 2
5

12
y ti 23 f ti , y ti 16 f ti 1 , y ti 1 f ti 2 , y ti 2 .
h
12
The three-step Adams-Bashforth method is, consequently,

w0 , w1 1 , w2 2 ,
h
wi 1 wi 23 f ti , wi 16 f ti 1 , wi 1 5 f ti 2 , wi 2 ,
12

for i 2,3, , N 1 .
Definition
If y t is the solution to the initial-value problem

y ' f t , y , a t b, y a ,
and
wi 1 am 1wi am 2 wi 1 a0 wi 1 m
h bm f ti 1 , wi 1 bm 1 f ti , wi b0 f ti 1 m , wi 1 m

is the i 1 st step in a multistep methods, the local truncation error at this step is

y ti 1 am 1 y ti a0 y ti 1 m
i 1 h
h (1.10)
bm f ti 1 , y ti 1 b0 f ti 1 m , y ti 1 m ,

for each i m 1, m, , N 1 .
EXAMPLE
To determine the local truncation error for the three-step Adams-Bashforth method derived in
Example 2, consider the form of the error given in Eq. (1.9) and the appropriate entry in Table
5.10:

s 3h 4 3
3
i , y i 1 0 3 ds 8 f i , y i .
3 1
4
h f

Using the fact that f


3
, y y and the difference equation derived in Example
i i
4
i

2, we have
y ti 1 y ti 1
i 1 h 23 f ti , y ti 16 f ti 1 , y ti 1 5 f ti 2 , y ti 2
h 12
1 3h 4 3 3h3 4
f i , y i y i , for some i ti 2 , ti 1 .
h 8 8
Some of the explicit multistep methods together with their required starting values and local
truncation errors are as follows. The derivation of these techniques is similar to the procedure in
Example 2 and 3.
Adams-Bashforth Two-Step Explicit Method:

w0 , w1 1 ,
h (1.12)
wi 1 wi 3 f ti , wi f ti 1 , wi 1 ,
2
5
where i 1, 2, , N 1 . The local truncation error is i 1 h y "' i h 2 , for some
12
i ti 1 , ti 1 .
Adams-Bashforth Three-step Explicit Method:

w0 , w1 1 , w2 2 ,
h (1.12)
wi 1 wi 23 f ti , wi 16 f ti 1 , wi 1 5 f ti 2 , wi 2 ,
12
3 4
where i 2,3, , N 1 . The local truncation error is i 1 h y i h3 , for some
8
i ti 2 , ti 1 .
Adams-Bashforth Four-step Explicit Method:

w0 , w1 1 , w2 2 , w3 3 ,
h (1.13)
wi 1 wi 55 f ti , wi 59 f ti 1 , wi 1 37 f ti 2 , wi 2 9 f ti 3 , wi 3 ,
24
251 5
where i 3, 4, , N 1 . The local truncation error is i 1 h y i h 4 , for some
720
i ti 3 , ti 1 .
Adams-Bashforth Five-step Explicit Method:
w0 , w1 1 , w2 2 , w3 3 , w4 4 ,
h
wi 1 wi 1901 f ti , wi 2774 f ti 1 , wi 1 (1.14)
720
2616 f ti 2 , wi 2 1274 f ti 3 , wi 3 251 f ti 4 , wi 4 ,
95 6
where i 4,5, N 1 . The local truncation error is i 1 h y i h5 , for some
288
i ti 4 , ti 1 .

Implicit methods are derived by using t i 1


, f ti 1 , y ti 1 as an additional interpolation node

in the approximation of the integral


f t , y t dt.
ti 1
ti
Adams-Moulton Two-step Implicit Method:

w0 , w1 1 ,
h (1.15)
wi 1 wi 5 f ti 1 , wi 1 8 f ti , wi f ti 1 , wi 1 ,
12
1 4
where i 1, 2, N 1 . The local truncation error is i 1 h y i h3 , for some
24
i ti 1 , ti 1 .
Adams-Moulton Three-step Implicit Method:

w0 , w1 1 , w2 2 ,
h (1.16)
wi 1 wi 9 f ti 1 , wi 1 19 f ti , wi 5 f ti 1 , wi 1 f ti 2 , wi 2 ,
24
19 5
where i 2,3, , N 1 . The local truncation error is i 1 h y i h 4 , for some
720
i ti 2 , ti 1 .
Adams-Moulton Four-step Implicit Method:
w0 , w1 1 , w2 2 , w3 3 ,
h
wi 1 wi 251 f ti 1 , wi 1 646 f ti , wi (1.17)
720
264 f ti 1 , wi 1 106 f ti 2 , wi 2 19 f ti 3 , wi 3 ,
3 6
where i 3, 4, N 1 . The local truncation error is i 1 h y i h5 , for some
160
i ti 3 , ti 1 .
It is interesting to compare an m-step Adams-Bashforth explicit method to an (m-1)-step Adams-

Moulton Four-step implicit method. Both involve m evaluations of f per step, and both have the

terms y
m1
i h m in their local truncation errors. In general, the coefficients of the terms

involving f in the local truncation error are smaller for the implicit methods than for the explicit

methods. This leads to greater stability and smaller roundoff errors for the implicit methods.
EXAMPLE
Consider the initial-value problem

y ' y t 2 1, 0 t 2, y 0 0.5,
and the approximations given by the explicit Adams-Bashforth four-step method and the implicit
Adams-Moulton three-step method, both using h 0.2 .
The Adams- Bashforth method has the difference equation
h
wi 1 wi 55 f ti , wi 59 f ti 1 , wi 1 37 f ti 2 , wi 2 9 f ti 3 , wi 3
.
24
for i 3, 4, , 9 . When simplified using f t , y y t 2 1, h 0.2, and ti 0.2i , it
becomes
1
wi 1 35 w 11.8 w 7.4 w 1.8 w 0.192i 2
0.192i 4.736
.
24
i i 1 i 2 i 3

The Adams-Moulton method has the difference equation


h
wi 1 wi 9 f ti 1 , wi 1 19 f ti , wi 5 f ti 1 , wi 1 f ti 2 , wi 2
,
24
for i 2, 3, 9 . This reduces to

1
wi 1
1.8wi 1 27.8wi wi 1 0.2wi 2 0.192i 2 0.192i 4.736
.
24
for i 2, 3, 9.
ALGORITHM :Adams Fourth-Order Predictor-Corrector

Purpose: To approximate the solution of the initial-value problem

y ' f t , y , a t b, y a ,

at N 1 equally spaced numbers in the interval a, b :

INPUT endpoints a, b ; integer N ; initial condition .

OUTPUT approximation w to y at the N 1 values of t .

Step 1 h b a N ;

t0 a ;

w0 ;

OUTPUT t0 , w0 .
Step 2 For i 0,1, 2 , do Step 3-4

(*Computing starting values using Runge-Kutta method*.)

Step 3 K1 hf ti , wi ;

K2 hf ti h 2, wi K1 2 ;

K3 hf ti h 2, wi K2 2 ;

K4 hf ti h, wi K3 .

wi 1 wi K1 2K2 2K3 K4 6 ;

ti 1 a (i 1)h .

Step 4
Step 5 For i 3, , N 1 do Steps 6-8

Step 6 t 0 a (i 1)h ;

w0 wi h 55 f ti , wi 59 f ti 1 , wi 1 37 f ti 2 , wi 2
9 f ti 3 , wi 3 24; Predict wi 1

w0 wi h 9 f t 0, w0 19 f ti , wi 5 f ti 1 , wi 1
f ti 2 , wi 2 24. Correct wi 1
Step 7
C PREPARE FOR NEXT ITERATION
T(I+1) = TO
W(I+1) = WO .
Step 8
Step 9 RETURN.

Das könnte Ihnen auch gefallen