540 likes | 561 Views
Learn to solve first-order ODEs using Runge-Kutta methods, including RK2, RK3, RK4, and higher order. Understand the accuracy-effort trade-off in choosing the right method.
E N D
EE 3561 : Computational MethodsTopic 8Solution of Ordinary Differential Equations Lesson 5: Applications of Runge-Kutta Methods to solve first order ODEs (c)AL-DHAIFALLAH1435
Lessons in Topic 8 • Lesson 1: Introduction to ODE • Lesson 2: Taylor series methods • Lesson 3: Midpoint and Heun’s method • Lesson 4: Runge-Kutta methods • Lesson 5: Applications of RK method • Lesson 6: Solving systems of ODE (c)AL-DHAIFALLAH1435
Learning Objectives of Lesson 4 • Use Runge-Kutta methods of different orders to solve first order ODEs. (c)AL-DHAIFALLAH1435
Runge-Kutta Method (c)AL-DHAIFALLAH1435
Runge-Kutta Methods RK2 (c)AL-DHAIFALLAH1435
Runge-Kutta Methods RK3 (c)AL-DHAIFALLAH1435
Runge-Kutta Methods RK4 (c)AL-DHAIFALLAH1435
Runge-Kutta Methods Higher order Runge-Kutta methods are available Higher order methods are more accurate but require more calculations. Fourth order is a good choice. It offers good accuracy with reasonable calculation effort Click to see Butcher’s Fifth order Runge-Kutta method (c)AL-DHAIFALLAH1435
Fifth Order Runge-Kutta Methods (c)AL-DHAIFALLAH1435
Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Second Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 1Summary of the solution Summary of the solution (c)AL-DHAIFALLAH1435
Solution after 100 steps (c)AL-DHAIFALLAH1435
Example 24-order Runge-Kutta Method See RK4 Formula (c)AL-DHAIFALLAH1435
Example 2Fourth Order Runge-Kutta Method (c)AL-DHAIFALLAH1435
Example 2Fourth Order Runge-Kutta Method See RK4 Formula (c)AL-DHAIFALLAH1435
Runge-Kutta Methods RK4 (c)AL-DHAIFALLAH1435
Example 2Fourth Order Runge-Kutta Method Click to See The solution (c)AL-DHAIFALLAH1435
Example 2Fourth Order Runge-Kutta Method Click to Go back (c)AL-DHAIFALLAH1435
Example 2Summary of the solution Summary of the solution (c)AL-DHAIFALLAH1435
Remaining Lessons in Unit 7 Lessons 6: Solving Systems of high order ODE (c)AL-DHAIFALLAH1435
EE 3561 : Computational MethodsLesson 6: Solution of Systems of ODEs Dr. Mujahed Al-Dhaifallah ( Term 342) (c)AL-DHAIFALLAH1435
Learning Objectives of Lesson 6 • Convert a single (or a system of ) high order ODEs to a system of first order ODEs • Use the methods discussed earlier in this unit to solve systems of first order ODEs. (c)AL-DHAIFALLAH1435
Outlines of Lesson 6 • Solution of a system of first order ODEs • Conversion of a high order ODEs to a system of first order ODEs • Conversion of a system of high order ODEs to a system of first order ODEs • Use different methods to solve systems of first order ODEs. • Use different methods to solve high order ODEs. • Use different methods to solve systems of high order ODEs. (c)AL-DHAIFALLAH1435
Solving a system of first order ODEs • Methods discussed earlier such as Euler, Runge-Kutta,…are used to solve first order ordinary differential equations • The same formulas will be used to solve a system of first order ODEs. In this case, the differential equation is a vector equation and the dependent variable is a vector variable. (c)AL-DHAIFALLAH1435
Euler method for solving a system of first order ODEs Recall Euler method for solving first order ODE. (c)AL-DHAIFALLAH1435
Example Euler method Euler method to solve a system of n first order ODE. (c)AL-DHAIFALLAH1435
Solving a system of n first order ODEs • Exactly the same formula is used but the scalar variables and functions are replaced by vector variables and vector values functions. • Y is a vector of length n • F(Y,x) is vector valued function (c)AL-DHAIFALLAH1435
Example :Euler method for solving a system of first order ODEs (c)AL-DHAIFALLAH1435
Example :RK2 method for solving a system of first order ODEs (c)AL-DHAIFALLAH1435
Example :RK2 method for solving a system of first order ODEs (c)AL-DHAIFALLAH1435
Method for solving a system of first order ODEs • We have extended Euler and RK2 methods to solve systems of first order ODE • Other methods used to solve first order ODE can be easily extended to solve systems of first order ODE (c)AL-DHAIFALLAH1435
High Order ODE • How do solve second order ODE? • How do solve high order ODE? (c)AL-DHAIFALLAH1435
The general approach to solve ODEs convert solve high order ODE System of first order ODE convert solve Second order ODE Two first order ODEs (c)AL-DHAIFALLAH1435
Conversion Procedure convert solve • Select of dependent variables One way is to take the original dependent variable and its derivatives up to one degree less than the highest order derivative. • Write the Differential Equations in terms of the new variables. The equations comes from the way the new variables are defined or from the original equation. • Express the equations in matrix form high order ODE System of first order ODE (c)AL-DHAIFALLAH1435
Remarks on the Conversion Procedure convert solve • Any nth order ODE is converted to a system of n first order ODE. • There are infinite number of ways to select the new variables. As a result, for each high order ODE there are infinite number of set of equivalent first order systems of ODEs. • Use a table to make conversion easier. high order ODE System of first order ODE (c)AL-DHAIFALLAH1435
Example of converting High order ODE to first order ODEs One degree less than the highest order derivative (c)AL-DHAIFALLAH1435
Example of converting High order ODE to first order ODEs (c)AL-DHAIFALLAH1435
Example of converting High order ODE to first order ODEs One degree less than the highest order derivative (c)AL-DHAIFALLAH1435
Example of converting High order ODE to first order ODEs (c)AL-DHAIFALLAH1435
Conversion Procedure for Systems of high order ODEs convert solve • Select of dependent variables take the original dependent variables and their derivatives up to one degree less than the highest order derivative for each variable. • Write the Differential Equations in terms of the new variables. The equations comes from the way the new variables are defined or from the original equation. • Express the equations in matrix form System of high order ODE System of first order ODE (c)AL-DHAIFALLAH1435
Example of converting High order ODE to first order ODEs One degree less than the highest order derivative One degree less than the highest order derivative (c)AL-DHAIFALLAH1435
Example of converting High order ODE to first order ODEs One degree less than the highest order derivative One degree less than the highest order derivative (c)AL-DHAIFALLAH1435