Upload
john-ham
View
78
Download
2
Embed Size (px)
DESCRIPTION
Numerical methods lecture slides on the Runge-Kutta method for solving 1st order ODEs. Some parts of this presentation are based on resources at http://nm.MathForCollege.com, primarily http://mathforcollege.com/nm/topics/runge_kutta_2nd_method.html
Citation preview
St. John's University of Tanzania
MAT210 NUMERICAL ANALYSIS2013/14 Semester II
DIFFERENTIAL EQUATIONSRunge-Kutta Method
Kaw, Chapter 8.03-8.04Some parts of this presentation are based on resources at
http://nm.MathForCollege.com, primarilyhttp://mathforcollege.com/nm/topics/runge_kutta_2nd_method.html
MAT210 2013/14 Sem II 2 of 14
Ordinary Differential Equations● Topics
● 1st order ODE– Euler's Method – Runge-Kutta Methods
● Higher order Initial Value● Higher order Boundary Value
– Shooting Method– Finite Differences
MAT210 2013/14 Sem II 3 of 14
Taylor Series perspectiveyi+1=yi+
dydx
|xi h+12d2 ydx2
|xih2+
16d3 ydx3
|xih3+O(h4)
Euler's Method
● What about the other terms?● The challenge is finding the 2nd derivative● That's where Runge and Kutta were clever
MAT210 2013/14 Sem II 4 of 14
The challenge
d2 yd x2
= f '(x , y) = ∂ f (x , y)∂x
+∂ f (x , y)
∂ ydydx
● What to do about those partial derivates?● Brute force approach
– Derive them for each specific problem– Evaluate the result
● Runge-Kutta approach – 2nd order– “Correct” the Euler Method
yi+ f (x , y)h ⇒ yi+(a1 f (x , y)+a2k 2)h
MAT210 2013/14 Sem II 5 of 14
The 2nd Order Method
● Pick one and the other three fall into place● At its heart it is a weighted average of f at the
starting point and a predicted f at point somewhere in the interval● a1 and a2 are the weights
● k1 and k2 are the two points
MAT210 2013/14 Sem II 6 of 14
Heun's Method, a2=1/2● Equal weighting● Linear prediction at far end
MAT210 2013/14 Sem II 7 of 14
Midpoint Method, a2=1● Ignore starting point● Estimate f at the midpoint
MAT210 2013/14 Sem II 8 of 14
Ralston's Method, a2=2/3● 1/3 to 2/3 weighting● Estimate f at the 3/4 point
MAT210 2013/14 Sem II 9 of 14
Previous Example Re-done
MAT210 2013/14 Sem II 10 of 14
Applying Heun's Method
MAT210 2013/14 Sem II 11 of 14
Completing Heun's Method
MAT210 2013/14 Sem II 12 of 14
Seeing the convergence
MAT210 2013/14 Sem II 13 of 14
Bringing them all together
MAT210 2013/14 Sem II 14 of 14
Summary● Not only is it valuable to compare Euler to
Runge-Kutta, but to a full calculation of f'
● Note the approximations of f' are of minimal impact compared to improvement over Euler
● 4th order continues the pattern. (For Reading)