Presentation is loading. Please wait.

Presentation is loading. Please wait.

Today’s class Ordinary Differential Equations Runge-Kutta Methods

Similar presentations


Presentation on theme: "Today’s class Ordinary Differential Equations Runge-Kutta Methods"— Presentation transcript:

1 Today’s class Ordinary Differential Equations Runge-Kutta Methods
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

2 Ordinary Differential Equations
A differential equation is an equation made up of a function and derivatives of that function Example An ordinary differential equation (ODE) is a differential equation with only one independent variable Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

3 Ordinary Differential Equations
First-order - highest derivative in the ODE is a first derivative Second-order - highest derivative in the ODE is a second derivative Linear - ODE is of the following form Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

4 Initial-Value & Boundary-Value Conditions
IV Conditions All conditions are given at the same value of the independent variable BV Conditions Conditions are given at different value of the independent variables The numerical methods for solving Initial-value and boundary-value are different. Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

5 Runge-Kutta Methods Focus on methods to solve first order ODE
Euler’s Method Huen and Midpoint methods Classic 4th-order R-K method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

6 Euler’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

7 Euler’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

8 Euler’s Method Example: True: h = 0.5 Numerical Methods Prof. Jinbo Bi
Lecture 16 Prof. Jinbo Bi CSE, UConn

9 Euler’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

10 Error Analysis Global truncation errors
Local truncation - from application of Euler’s method over a single step Propagation truncation - from approximation produced during previous steps Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

11 Error Analysis Start with Taylor Series expansion
Local truncation error Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

12 Error Analysis Global Truncation Error Numerical Methods
Lecture 16 Prof. Jinbo Bi CSE, UConn

13 Euler’s Method Not very accurate
Reducing the step size can improve accuracy but will also increase computation Can be useful for quick analysis (assuming large step size) Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

14 Euler’s Method Improvements
Higher order Taylor Series Heun’s Method Midpoint/Improved Polygon Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

15 Higher order Taylor Series
If f is a function of both the dependent and independent variables, you need to calculate the partial derivatives Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

16 Heun’s Method Main drawback of Euler’s method is that it assumes that the derivative at the beginning of the interval is the same across the interval A better estimate involves looking at the derivatives at both ends of the interval and then averaging Heun method uses the average of the derivatives at the points (xi, yi) and (xi+1, yi+1) to compute yi+1. Since, the derivative at (xi+1, yi+1) is unknown, first to estimate yi+1, then using the average derivative to compute yi+1. Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

17 Heun’s Method Local truncation error is O(h3) and global truncation error is O(h2) Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

18 Heun’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

19 Heun’s Method Can further use yi+1 to re-estimate the derivative at (xi+1, yi+1) and then obtain a better result. The iteration can go on until an accurate result is achieved Further iterations may not converge on the true answer but it will converge on a finite truncation error Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

20 Heun’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

21 Midpoint Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

22 Midpoint Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

23 Midpoint Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

24 Runge-Kutta Methods Numerical Methods Prof. Jinbo Bi Lecture 16
CSE, UConn

25 The principles of Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

26 The principles of Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

27 The principles of Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

28 The principles of Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

29 The principles of Runge-Kutta Method
Heun method Midpoint method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

30 Third-order Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

31 Classic 4th-order Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

32 Classic 4th-order Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

33 Classic 4th-order Runge-Kutta Method
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

34 Comparison of Runge-Kutta Methods
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

35 Systems of ODEs Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

36 Higher-order ODE Numerical Methods Prof. Jinbo Bi Lecture 16
CSE, UConn

37 Systems of ODEs Must be careful in determining slopes
Can use same higher-order Runge Kutta methods with systems of ODEs Must be careful in determining slopes First find slopes at the initial value (k1) Then slopes at the midpoints (k2) Then refine slopes at the midpoint (k3) Then find slopes at the endpoint (k4) Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

38 Systems of ODEs Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

39 Systems of ODEs Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn

40 Next class Ordinary Differential Equations Read Chapter 25, 26
Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn


Download ppt "Today’s class Ordinary Differential Equations Runge-Kutta Methods"

Similar presentations


Ads by Google