Today’s class Ordinary Differential Equations Runge-Kutta Methods Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
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
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
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
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
Euler’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Euler’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Euler’s Method Example: True: h = 0.5 Numerical Methods Prof. Jinbo Bi Lecture 16 Prof. Jinbo Bi CSE, UConn
Euler’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
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
Error Analysis Start with Taylor Series expansion Local truncation error Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Error Analysis Global Truncation Error Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
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
Euler’s Method Improvements Higher order Taylor Series Heun’s Method Midpoint/Improved Polygon Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
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
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
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
Heun’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
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
Heun’s Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Midpoint Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Midpoint Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Midpoint Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Runge-Kutta Methods Numerical Methods Prof. Jinbo Bi Lecture 16 CSE, UConn
The principles of Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
The principles of Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
The principles of Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
The principles of Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
The principles of Runge-Kutta Method Heun method Midpoint method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Third-order Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Classic 4th-order Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Classic 4th-order Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Classic 4th-order Runge-Kutta Method Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Comparison of Runge-Kutta Methods Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Systems of ODEs Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Higher-order ODE Numerical Methods Prof. Jinbo Bi Lecture 16 CSE, UConn
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
Systems of ODEs Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Systems of ODEs Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn
Next class Ordinary Differential Equations Read Chapter 25, 26 Numerical Methods Lecture 16 Prof. Jinbo Bi CSE, UConn