You are on page 1of 18

Chương 7.

Giải gần đúng ptvp


Lecture 7.7

Read 25.1-25.4, 26-2, 27-1

CISE301_Topic8L7 1
Nội dung chương 7
 Lesson 1: Introduction to ODEs
 Lesson 2: Taylor series methods
 Lesson 3: Midpoint and Heun’s method
 Lessons 4-5: Runge-Kutta methods
 Lesson 6: Solving systems of ODEs
 Lesson 7: Multiple step Methods
 Lesson 8-9: Boundary value Problems

CISE301_Topic8L7 2
Lecture 34
Lesson 7: Multiple Step Methods

CISE301_Topic8L7 3
Outlines of Lesson 7
Solution of ODEs

Lesson 7:
Adam-Moulton Multi-step
Predictor-Corrector Methods

CISE301_Topic8L7 4
Learning Objectives of Lesson 7
 Appreciate the importance of multi-step
methods.

 Discuss advantages/disadvantages of
multi-step methods.

 Solve first order ODEs using Adams


Moulton multi-step method.

CISE301_Topic8L7 5
Single Step Methods
 Single Step Methods:
 Euler and Runge-Kutta are single step
methods.
 Estimates of yi+1 depends only on yi and xi.

xi-2 xi-1 xi xi+1

CISE301_Topic8L7 6
Multi-Step Methods
 2-Step Methods
 In a two-step method, estimates of yi+1
depends on yi, yi-1, xi, and xi-1

xi-2 xi-1 xi xi+1

CISE301_Topic8L7 7
Multi-Step Methods
 3-Step Methods
 In an 3-step method, estimates of yi+1
depends on yi ,yi-1 ,yi-2, xi , xi-1, and xi-2

xi-2 xi-1 xi xi+1

CISE301_Topic8L7 8
Heun’s Predictor Corrector Method

Heun’s predictor corrector method is


not a multi-step method.

CISE301_Topic8L7 9
2-Step Predictor-Corrector
3 1 
Predictor : y  yi  h f xi ,yi   f xi 1,yi 1 
0
i 1
2 2 
1 1
  
Corrector : yi 1  yi  h f xi 1 , yi 1  f xi ,yi 
k k 1

2 2 

• At each iteration one prediction step is done


and as many correction steps as needed.
k
• y is the estimate of the solution at xi+1
i 1
after k correction steps.
CISE301_Topic8L7 10
3-Step Predictor-Corrector
Predictor :
 23 16 5 
yi01
 yi  h  f ( xi , yi )  f ( xi 1 , yi 1 )  f ( xi 2 , yi 2 ) 
 12 12 12 
Corrector :
 5 8 1 
y ik1  yi  h  k 1
f ( xi 1 , y i 1 )  f ( xi , yi )  f ( xi 1 , yi 1 ) 
 12 12 12 

CISE301_Topic8L7 11
4-Step Adams-Moulton Predictor-Corrector
Predictor : (Adams - Bashforth Predictor )
h  55 f ( xi , yi )  59 f ( xi 1 , yi 1 ) 
y i01  yi   
24   37 f ( xi 2 , yi 2 )  9 f ( xi 3 , yi 3 ) 

Corrector : ( Adams - Moulton Corrector)


k 1
h  9 f ( xi 1 , y i 1 )  19 f ( xi , yi ) 
y ik1  yi 
24   5 f ( xi 1 , yi 1 )  f ( x i 2 , yi 2 ) 

See pages 744( predictor ), 746( corrector ) formulas


CISE301_Topic8L7 12
How Many Function Evaluations are Done?
Number of function evaluations is the
Computational Speed or Efficiency
How many evaluations per step?
No need to repeat the evaluation of
function f at previous points
Only one new function evaluation in the
predictor
One function evaluation per correction step

# of function evaluations = 1+ number of corrections

CISE301_Topic8L7 13
Example
Solve
dy
 2x  y2 x y (0)  2
dx
h  0.1, Use 2  step Predictor corrector Method
compute y(0.4)

We need two initial conditions to use the


2  step Predictor corrector Method
We will first use RK2 to estimate y(0.1)
CISE301_Topic8L7 14
Example
We need two initial conditions
Use RK 2 to compute y (0.1) then we can use
the Predictor corrector Method
dy 2
 2x  y x y (0)  2, h  0.1,
dx
K1  0.1(0)  0
K 2  0.1(0.2  0.4)  0.06
y (0.1)  2  0.5(0.06)  2.03
CISE301_Topic8L7 15
Example
dy
 2x  y2x yi-1  y (0)  2, yi  y (0.1)  2.03, h  0. 1
dx

3 1 
Predictor : y i01
 yi  h f ( xi , yi )  f ( xi 1 , yi 1 ) 
2 2 
3
 1
 
 2.03  0.1 2(0.1)  2.032 0.1  0  0  2.1218
2 2 
1 1 
Corrector : y (0.2)  y1i 1 0
 yi  h  f ( xi 1 , y i 1 )  f ( xi , yi ) 
2 2 
1
 1
 
 2.03  0.1 2(0.2)  2.12182 0.2   2(0.1)  2.032 0.1   2.1256


2 2 
CISE301_Topic8L7 16
Multi-Step Methods
 Single Step Methods
 Euler and Runge-Kutta are single step
methods.
 Information about y(x) is used to estimate
y(x+h).

 Multistep Methods
 Adam-Moulton method is a multi-step method.
 To estimate y(x+h), information about y(x),
y(x-h), y(x-2h)… are used.
CISE301_Topic8L7 17
Number of Steps
 At each iteration, one prediction step is
done and as many correction steps as
needed.

 Usually few corrections are done (1 to 3).

 It is usually better (in terms of accuracy)


to use smaller step size than corrections.
CISE301_Topic8L7 18

You might also like