Numerical Solution of Ordinary Differential Equation

Numerical Solution of Ordinary Differential Equation

Numerical Solution of Ordinary Differential Equation A first order initial value problem of ODE may be written in the form Example: y ' (t ) f ( y, t ), y (0) y0 y ' (t ) 3 y 5, y (0) 1 y ' (t ) ty 1, y (0) 0

Numerical methods for ordinary differential equations calculate solution on the points, t n t n 1 h where h is the steps size 1 Numerical Methods for ODE Euler Methods Forward Euler Methods Backward Euler Method Modified Euler Method Runge-Kutta Methods Second Order Third Order Fourth Order 2 Forward Euler Method Consider the forward difference approximation for first

derivative yn 1 yn yn ' h , h t n 1 t n Rewriting the above equation we have yn 1 yn hyn ' , yn ' f ( yn , t n ) So, yn is recursively calculated as y1 y0 hy0 ' y0 h f ( y0 , t0 ) y2 y1 h f ( y1 , t1 )

yn yn 1 h f ( yn 1 , t n 1 ) 3 Example: solve y ' ty 1, Solution: for t0 0, for t1 0.25, y0 y (0) 1, 0 t 1, h 0.25 y0 y (0) 1 y1 y0 hy0 ' y0 h(t0 y0 1) for t 2 0.5,

1 0.25(0 *1 1) 1.25 y2 y1 hy1 ' y1 h(t1 y1 1) 1.25 0.25(0.25*1.25 1) 1.5781 etc 4 Graph the solution 5 Backward Euler Method Consider the backward difference approximation for first derivative yn yn 1 yn ' h

, h t n t n 1 Rewriting the above equation we have yn yn 1 hyn ' , yn ' f ( yn , t n ) So, yn is recursively calculated as y1 y0 hy1 ' y0 h f ( y1 , t1 ) y2 y1 h f ( y2 , t 2 ) yn yn 1 h f ( yn , t n ) 6 Example: solve

y ' ty 1, y0 y (0) 1, 0 t 1, h 0.25 Solution: Solving the problem using backward Euler method for yn yields yn yn 1 hyn ' yn 1 h(t n yn 1) yn ht n yn yn 1 h yn 1 h yn 1 ht n

So, we have for t1 0.25, y0 h 1 0.25 y1 1.333 1 ht1 1 0.25 * 0.25 7 for t 2 0.5, for t3 0.75, for t 4 1, y1 h 1.333 0.25 y2

1.8091 1 ht2 1 0.25 * 0.5 y2 h 1.8091 0.25 y3 2.5343 1 ht3 1 0.25 * 0.75 y3 h 2.5343 0.25 y4 3.7142 1 ht4 1 0.25 *1 8 Graph the solution 9

Modified Euler Method Modified Euler method is derived by applying the trapezoidal rule to integrating yn ' f ( y, t ) ; So, we have h ' yn 1 yn ( yn 1 yn' ), 2 yn ' f ( yn , t n ) If f is linear in y, we can solved for yn 1 similar as backward euler method If f is nonlinear in y, we necessary to used the method for solving nonlinear equations i.e. successive substitution method (fixed point) 10

Example: solve y ' ty 1, y0 y (0) 1, 0 t 1, h 0.25 Solution: f is linear in y. So, solving the problem using modified Euler method for yn yields h y n y n 1 ( y 'n 1 y 'n ) 2 h yn 1 (t n 1 yn 1 1 t n yn 1) 2 h h yn (1 t n ) yn 1 (1 t n 1 ) h

2 2 h (1 t n 1 ) 2 yn yn 1 h h (1 t n ) 11 2 Graph the solution 12 Second Order Runge-Kutta Method The second order Runge-Kutta (RK-2) method is derived

by applying the trapezoidal rule to integrating y ' f ( y , t ) over the interval [t n , t n 1 ] . So, we have t n1 yn 1 yn f ( y, t )dt tn h yn f ( yn , t n ) f ( yn 1 , t n 1 ) 2 We estimate yn 1 by the forward euler method. 13 So, we have

h yn 1 yn f ( yn , t n ) f ( yn hf ( yn , t n ), t n 1 ) 2 Or in a more standard form as 1 yn 1 yn k1 k 2 2 where k1 hf ( yn , t n ) k 2 hf ( yn k1 , t n 1 ) 14 Third Order Runge-Kutta Method The third order Runge-Kutta (RK-3) method is derived by applying the Simpsons 1/3 rule to integrating y ' f ( y , t ) over the interval [t n , t n 1 ] . So, we have

t n1 yn 1 yn f ( y, t )dt tn h yn f ( yn , t n ) 4 f ( yn 12 , t n 12 ) f ( yn 1 , t n 1 ) 6 We estimate yn 1 2 by the forward euler method. 15

The estimate yn 1 may be obtained by forward difference method, central difference method for h/2, or linear combination both forward and central difference method. One of RK-3 scheme is written as 1 yn 1 yn k1 4k 2 k3 6 where k1 hf ( yn , t n ) h k 2 hf ( yn k1 , t n ) 2 k3 hf ( yn k1 2k 2 , t n 1 ) 1 2 16 Fourth Order Runge-Kutta

Method The fourth order Runge-Kutta (RK-4) method is derived by applying the Simpsons 1/3 or Simpsons 3/8 rule to integrating y ' f ( y , t ) over the interval [t n , t n 1 ]. The formula of RK-4 based on the Simpsons 1/3 is written as 1 yn 1 yn k1 2k 2 2k3 k 4 6 where k1 hf ( yn , t n ) k 2 hf ( yn 12 k1 , t n h ) 2 k3 hf ( yn 12 k 2 , t n h ) 2 k 4 hf ( yn k3 , t n h) 17

The fourth order Runge-Kutta (RK-4) method is derived based on Simpsons 3/8 rule is written as 1 yn 1 yn k1 3k 2 3k3 k 4 8 where k1 hf ( yn , t n ) k 2 hf ( yn 13 k1 , t n h ) 3 k3 hf ( yn 13 k1 13 k 2 , t n 2h ) 3 k 4 hf ( yn 3k1 3k 2 k3 , t n h) 18

Recently Viewed Presentations

  • ECG NOTES - Marisa Bush

    ECG NOTES - Marisa Bush

    Arial Calibri Default Design Heart Anatomy The heart is a muscle Exterior anatomy of the heart Interior anatomy of the heart Heart Beat Pumping Action ECG The way it works Interior anatomy of the heart ECG Parts ECG R to...
  • On the role of formulas in the acquisition of L2 pragmatics

    On the role of formulas in the acquisition of L2 pragmatics

    On the role of formulas in the acquisition of L2 pragmatics Kathleen Bardovi-Harlig Indiana University Pragmatics and Language Learning Functions of formulas Communicative strategy, allows early communication (Rehbein, 1987; Weinert, 1995); elicits further input (Wong-Fillmore, 1976; Krashen, Dulay, & Burt,...
  • Three World Religions: Judaism, Christianity, & Islam

    Three World Religions: Judaism, Christianity, & Islam

    Islam Is the main religion of the Middle East, North Africa, & Asia Two largest groups of Muslims are the Sunnis and the Shiites The Sunnis account for 90% of the world's Muslims Number of followers is growing at a...
  • Recruiting Engaged Employees Selecting the Wrong Person Can

    Recruiting Engaged Employees Selecting the Wrong Person Can

    Baby Boomers - 1946 - 1964. Generation X - 1965 - 1980. Gen Y -1981 - 1995. No one generation is better or worse than the other generations. Changing your leadership approach is easier than changing the values developed over...
  • World History: Ancient Civilizations Through the Renaissance Chapter

    World History: Ancient Civilizations Through the Renaissance Chapter

    Islam spread from Mecca to Medina. - Rulers of Mecca began to threaten Muhammad with violence as Islam started to influence more people. - Muhammad left Mecca and went to Medina. - This departure became known in Muslim history as...
  • Preliminary Hsc Pdhpe

    Preliminary Hsc Pdhpe

    Resting heart rate and heart rate during sub-maximal work both fall as a result of aerobic training. However, heart rate during maximal exercise will be the same for both trained and untrained individuals. The difference is that the trained person...
  • EPA ICS UNIT LEADER Webinar - CLU-IN

    EPA ICS UNIT LEADER Webinar - CLU-IN

    * NOTE: This slide is generic unit leader responsibilities found on pages 3-3 through 3-4 of the IMH UNIT LEADER RESPONSIBILITIES - In ICS, a number of the Unit Leader's responsibilities are common to all units in all parts of...
  • Penman Analysis 17th June 2008

    Penman Analysis 17th June 2008

    Bowen ratio= 0.40 - this value shows that there was a larger latent heat flux than sensible heat flux again due to moisture evaporating from the ground. Evaporation= 0.48 mmh-ยน - this shows that the air was quite dry and...