14
St. John's University of Tanzania MAT210 NUMERICAL ANALYSIS 2013/14 Semester II DIFFERENTIAL EQUATIONS Runge-Kutta Method Kaw, Chapter 8.03-8.04 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

MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 1: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 2: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 3: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 4: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 5: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 6: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 6 of 14

Heun's Method, a2=1/2● Equal weighting● Linear prediction at far end

Page 7: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 7 of 14

Midpoint Method, a2=1● Ignore starting point● Estimate f at the midpoint

Page 8: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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

Page 9: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 9 of 14

Previous Example Re-done

Page 10: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 10 of 14

Applying Heun's Method

Page 11: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 11 of 14

Completing Heun's Method

Page 12: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 12 of 14

Seeing the convergence

Page 13: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

MAT210 2013/14 Sem II 13 of 14

Bringing them all together

Page 14: MAT210/DiffEq/Runge-Kutta 2nd Order 2013-14

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)