ordinary differential equations y′web.boun.edu.tr/ozupek/me303/ode_web.pdfmodified euler method...
TRANSCRIPT
1
Ordinary Differential Equations
00 )0(,)0(with 0),,( yyyyxyyxfy ′=′=>′=′′
Initial Value Problem (IVP)
Boundary Value Problem (BVP)
ba ybyyaybxayyxfy ==<<′=′′ )(,)(with ),,(
Initial Value Problem,1st order
0)0(with 0),( yytytfy =>=′
htyhtyy )()( ofion approximat difference forward −+
=′
),()( )( ythftyhty +=+⇒
within solution for Seek 0 nttt ≤≤
Mtthhtt
Miihtt
nii
i
01
0
and
,...,1,0−
==−
=+=
+
ionapproximatEuler ),( 1 iiii ythfyy +=⇒ +
2
Example
22),(
1 with 30for )( Find
1)0( 2
1iiii
iiiiiytytyythfyy
htty
yyty
+=
−+=+=
=≤≤
=−
=′
+
(0.75+2)/2=1.37533(1+0.5)/2=0.7522(0+1)/2=0.511100yitii
As h gets smaller we approach the exact solution.
Geometric interpretation of Euler’s Method
Φ
Step size, h
t
y
t0,y0
True value
y1, Predictedvalue
3
2),(
13)(
1)0(2
1ii
iiiiiytyythfyy
htty
yyty
−+=+=
=≤≤
=−
=′
+
with 0for Find
4
5
Error in Euler
Euler approximation
→ Local discretization error
→ Global discretization error
Final global error:
6
How to improve accuracy of Euler’s Method?
( ) ...!32
)()(32
+′′′+′′+′+=+ ηyhyhyhxyhxy
Consider Taylor series
and compute the derivatives as
.....
( ) ( )ηyhfffhhfxyhxy yx ′′′++++=+!32
)()(32
For Taylor’s formula of order N
Local discretization error = O (hN+1)
Global discretization error = O (hN)
7
)4(4
)3(3
)2(2
!4!32)()( yhyhyhyhxyhxy +++′+=+
Final global error:
8
Taylor’s method is cumbersome from numerical point of view since higher derivatives need to be calculated.Alternative way to improve accuracy is to use several function evaluations:
slope at the beginning of
step
slope at the end of step
↓↓
Local DE Global DE
9
Modified Euler Method(use two slopes sequentially)
Runge-Kutta Method : accuracy of Taylor N=4, no high derivatives,
several function evaluations
Find ai, bi by matching the Runge-Kutta method to N=4 Taylor method.This results in 11 equations for 13 unknowns.
2 of ai, bi are selected and the rest are solved in terms of the selected ones.
10
11
error in Simpson ~ O (h5); accumulated error in Runge-Kutta after M steps ~ O (h4 )
12
For k2,k3,k4=0 we recover Euler’s method
Remark:
Find A, B, P, Q by matching the Runge-Kutta method to N=2 Taylor method:
let
→
}
→
13
We need to select one of A,B,P or Q
14
Sytem of ODEs
within solution for Seek 0 nttt ≤≤
Mtthhtt
Mkkhttn
kk
i
01
0 ,...,1,0−
==−
=+=
+ and
Euler’s approximation
Runge-Kutta method of order=4 (RK4)
15
Higher order ODEs
Reduce the ODE to a system of lower order ODEs
→
16
Boundary Value Problem (BVP)
Linear BVP
17
Solution of
is given as
where u and v are the solutions of the following IVPs:
proof:
→
18
19
20
21