CSE 330 : Numerical Methods Lecture 17: Solution of Ordinary Differential Equations (a) Euler’s Method (b) Runge-Kutta Method Dr. S. M. Lutful Kabir Visiting.

Slides:



Advertisements
Similar presentations
6/1/ Runge 4 th Order Method Industrial Engineering Majors Authors: Autar Kaw, Charlie Barker
Advertisements

Ordinary Differential Equations
Chapter 6 Differential Equations
Numerical Methods Lecture 14 Differentiation-Continuous Functions
HAMPIRAN NUMERIK SOLUSI PERSAMAAN DIFERENSIAL (lanjutan) Pertemuan 12 Matakuliah: METODE NUMERIK I Tahun: 2008.
Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker
5/19/ Runge 4 th Order Method Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker
PART 7 Ordinary Differential Equations ODEs
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 32 Ordinary Differential Equations.
11 September 2007 KKKQ 3013 PENGIRAAN BERANGKA Week 10 – Ordinary Differential Equations 11 September am – 9.00 am.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 31 Ordinary Differential Equations.
Initial-Value Problems
Numerical Integration CE5504 – Surface Water Quality Modeling  non-idealized loading functions  variable parameters  multi-segment systems  non-linear.
Dr. Jie Zou PHY Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (II) 1 1 Besides the main textbook, also see Ref.: “Applied.
8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 5 Approximations, Errors and The Taylor Series.
Numerical Solutions of Ordinary Differential Equations
NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
CISE301_Topic8L31 SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2,
8/8/ Euler Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
PART 7 Ordinary Differential Equations ODEs
Section 6.1: Euler’s Method. Local Linearity and Differential Equations Slope at (2,0): Tangent line at (2,0): Not a good approximation. Consider smaller.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Solving ODE.
CSE 330 : Numerical Methods
9/22/ Runge 2 nd Order Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Computational Method in Chemical Engineering (TKK-2109)
10/20/ Runge 2 nd Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
5/30/ Runge 4 th Order Method Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Numerical Methods for Solving ODEs Euler Method. Ordinary Differential Equations  A differential equation is an equation in which includes derivatives.
11/16/ Euler Method Electrical Engineering Majors Authors: Autar Kaw, Charlie Barker
11/17/ Shooting Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
CSE 330 : Numerical Methods Lecture 15: Numerical Integration - Trapezoidal Rule Dr. S. M. Lutful Kabir Visiting Professor, BRAC University & Professor.
Numerical Analysis – Differential Equation
Introduction to the Runge-Kutta algorithm for approximating derivatives PHYS 361 Spring, 2011.
1/16/ Runge 4 th Order Method Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
1/19/ Runge 4 th Order Method Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker
Dr. Mujahed AlDhaifallah ( Term 342)
Today’s class Ordinary Differential Equations Runge-Kutta Methods
2/28/ Runge 4 th Order Method Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Computer Engineering Majors Authors: Autar Kaw, Charlie Barker
Ordinary Differential Equations
Numerical Solution of Ordinary Differential Equation
525602:Advanced Numerical Methods for ME
Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Mechanical Engineering Majors Authors: Autar Kaw, Charlie Barker
Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Class Notes 18: Numerical Methods (1/2)
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L4&5.
Civil Engineering Majors Authors: Autar Kaw, Charlie Barker
Industrial Engineering Majors Authors: Autar Kaw, Charlie Barker
Numerical Solutions of Ordinary Differential Equations
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L2.
Numerical Analysis Lecture 38.
Numerical solution of first-order ordinary differential equations
ECE 576 POWER SYSTEM DYNAMICS AND STABILITY
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L6.
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L3 KFUPM.
Electrical Engineering Majors Authors: Autar Kaw, Charlie Barker
Numerical Computation and Optimization
Differential equations
Chemical Engineering Majors Authors: Autar Kaw, Charlie Barker
Sec 23: Runge–Kutta Methods
Numerical Analysis Lecture 36.
CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L7 KFUPM.
CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L1 KFUPM.
Numerical solution of first-order ordinary differential equations 1. First order Runge-Kutta method (Euler’s method) Let’s start with the Taylor series.
CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L6 KFUPM.
Presentation transcript:

CSE 330 : Numerical Methods Lecture 17: Solution of Ordinary Differential Equations (a) Euler’s Method (b) Runge-Kutta Method Dr. S. M. Lutful Kabir Visiting Research Professor, BRAC University & Professor (on leave) IICT, BUET 1 Prof. S. M. Lutful Kabir, BRAC University

Euler’s Method Φ Step size, h x y x 0,y 0 True value y 1, Predicted value Slope Figure 1 Graphical interpretation of the first step of Euler’s method Prof. S. M. Lutful Kabir, BRAC University2

Euler’s Method Φ Step size h True Value y i+1, Predicted value yiyi x y xixi x i+1 Figure 2. General graphical interpretation of Euler’s method Prof. S. M. Lutful Kabir, BRAC University3

How to write Ordinary Differential Equation Example is rewritten as In this case How does one write a first order differential equation in the form of Prof. S. M. Lutful Kabir, BRAC University 4

Example A ball at 1200K is allowed to cool down in air at an ambient temperature of 300K. Assuming heat is lost only due to radiation, the differential equation for the temperature of the ball is given by Find the temperature at seconds using Euler’s method. Assume a step size of seconds. Prof. S. M. Lutful Kabir, BRAC University5

Solution Step 1: is the approximate temperature at Prof. S. M. Lutful Kabir, BRAC University6

Solution Cont For Step 2: is the approximate temperature at Prof. S. M. Lutful Kabir, BRAC University7

Solution Cont The exact solution of the ordinary differential equation is given by the solution of a non-linear equation as The solution to this nonlinear equation at t=480 seconds is Prof. S. M. Lutful Kabir, BRAC University8

Comparison of Exact and Numerical Solutions Figure 3. Comparing exact and Euler’s method Prof. S. M. Lutful Kabir, BRAC University9

Step, h  (480) EtEt |є t |% − Effect of step size Table 1. Temperature at 480 seconds as a function of step size, h (exact) Prof. S. M. Lutful Kabir, BRAC University10

Comparison with exact results Figure 4. Comparison of Euler’s method with exact solution for different step sizes Prof. S. M. Lutful Kabir, BRAC University11

Effects of step size on Euler’s Method Figure 5. Effect of step size in Euler’s method. Prof. S. M. Lutful Kabir, BRAC University12

Errors in Euler’s Method It can be seen that Euler’s method has large errors. This can be illustrated using Taylor series. As you can see the first two terms of the Taylor series The true error in the approximation is given by are the Euler’s method. Prof. S. M. Lutful Kabir, BRAC University13

Runge Kutta 2 nd Order Method Runge Kutta thought to consider upto second derivative terms in Taylor’s series In that case the Eular’s Method will be extended to But finding the second derivative is sometimes difficult Hence they used the average of two approximate slopes as follows: where, 14Prof. S. M. Lutful Kabir, BRAC University

Runge Kutta Method (Heun’s Method) x y xixi x i+1 y i+1, predicted y i Figure 1 Runge-Kutta 2nd order method (Heun’s method) Prof. S. M. Lutful Kabir, BRAC University15

Example A ball at 1200K is allowed to cool down in air at an ambient temperature of 300K. Assuming heat is lost only due to radiation, the differential equation for the temperature of the ball is given by Find the temperature at seconds using Heun’s method. Assume a step size of seconds. Prof. S. M. Lutful Kabir, BRAC University16

Solution Step 1: Prof. S. M. Lutful Kabir, BRAC University17

Solution Cont Step 2: Prof. S. M. Lutful Kabir, BRAC University18

Comparison with exact results Figure 2. Heun’s method results for different step sizes Prof. S. M. Lutful Kabir, BRAC University19

Effect of step size Table 1. Temperature at 480 seconds as a function of step size, h Step size, h  (480) EtEt |є t |% − − − − (exact) Prof. S. M. Lutful Kabir, BRAC University20

21 Runge-Kutta 4 th Order Method where For Runge Kutta 4 th order method is given by Prof. S. M. Lutful Kabir, BRAC University

22 Example A ball at 1200K is allowed to cool down in air at an ambient temperature of 300K. Assuming heat is lost only due to radiation, the differential equation for the temperature of the ball is given by Find the temperature at seconds using Runge-Kutta 4 th order method. seconds. Assume a step size of Prof. S. M. Lutful Kabir, BRAC University

23 Solution Step 1: Prof. S. M. Lutful Kabir, BRAC University

24 Solution Cont is the approximate temperature at Prof. S. M. Lutful Kabir, BRAC University

25 Comparison with exact results Figure 1. Comparison of Runge-Kutta 4th order method with exact solution Prof. S. M. Lutful Kabir, BRAC University

Step size, h  (480) EtEt |є t |% − Effect of step size Table 1. Temperature at 480 seconds as a function of step size, h (exact) Prof. S. M. Lutful Kabir, BRAC University

THANKS Prof. S. M. Lutful Kabir, BRAC University27