
Computational Methods in Engineering: ODE Solutions
Explore ordinary differential equations (ODE) and computational methods in engineering with a focus on multi-step, BDF, and Runge-Kutta techniques. Learn about initial value problems, explicit and implicit methods, as well as applications to systems of ODEs. The content covers multi-step methods such as Euler Forward, Adams-Bashforth, Euler Backward, Trapezoidal, Runge-Kutta methods, and more. Gain insights into consistency, stability, and convergence in solving ODEs.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
ESO 208A: Computational Methods in Engineering Ordinary Differential Equation: Multi- Step, BDF, Runge-Kutta Abhas Singh Department of Civil Engineering IIT Kanpur Acknowledgements: Profs. Saumyen Guha and Shivam Tripathi (CE)
ODE: Introduction We will consider general problems of the form: ?? ??= ? ?,? Solution of this equation is a function y(t) Starting from ?0, we shall take discrete time steps ?1,?2, ?? of size h such that, ??= ?0+ ? Starting from the known initial value ?0, we shall compute values of y at each time step, ?1,?2, ?? , i.e., compute tab(y) An obvious way can be: + 2 2!?? Neglecting, h2 and higher order terms: ??+1 ??+1= ??+ ?? ? ?0 = ?0 ? 0 + 3 + 4 ??+ 5 ?+ 6 ?? ??+1= ??+ ?? 3!?? 4!?? 5!?? 6!?? ??+1= ??+ ? ??,??
ODE: Introduction ??+1 ?? ??+1= ??+ ? ??,?? = ? ??,?? The method is equivalent to making a forward difference approximation of dy/dt at the nth node. It is known as the Euler Forward Method. Why not make a backward difference approximation of dy/dt at the nth node? ?? ?? 1 This is known as the Euler Backward Method. Instead of evaluating the function f either at the nth node or at the (n + 1)th node, if we take the average of the two: ??+1= ??+ 2? ??+1,??+1 + ? ??,?? = ? ??,?? ??+1= ??+ ? ??+1,??+1
ODE: Introduction ??+1= ??+ 2? ??+1,??+1 + ? ??,?? This method may also be seen as follows: ??+1 ??+1 ?? ??= ? ?,? ?? = ? ?,? ?? ?? ?? Left side integral is straight forward. Use Trapezoidal Method for the right side integral. ??+1 ??= 2? ??+1,??+1 + ? ??,?? This is known as the Trapezoidal Method.
ODE: Introduction Blue: Euler Forward, Green: Euler Backward, Red: Trapezoidal Explicit vs. Implicit methods! ??+1= ??+ ? ??,?? ??+1= ??+ ? ??+1,??+1
Ordinary Differential Equation The methods for Initial Value Problems (IVPs): Multi-step Methods Explicit: Euler Forward, Adams-Bashforth Implicit: Euler Backward, Trapezoidal and Adams-Moulton Backward Difference Formulae (BDF) Runge-Kutta Methods Applications, Startup, Combination Methods (Predictor- Corrector) Consistency, Stability, Convergence Application to System of ODEs Boundary Value Problems (BVPs) Shooting Method Direct Methods
, Multi-Step Methods: Explicit General form of multi-step or Adams-Bashforth methods: ? ??+1 ??+1= ??+ ???? ? ?=0 k= 0, 1, 2, ., n and h is the uniform time step size Example: k = 3 ??+1= ??+ ?0??+ ?1?? 1+ ?2?? 2 ?? ??= ? = ? ??+1= ??+ ?0? ?+ ?1? ? 1+ ?2? ? 2 Let s expand all the terms in Taylor s series and equate LHS with RHS!
, Multi-Step Methods: Explicit ??+1= ??+ ?0? ?+ ?1? ? 1+ ?2? ? 2 Expanding all the terms in Taylor s series: ?+ 2 ?+ 3 ?+ 4 ??? = ??+1= ??+ ? 2!? 3!? ??+ ? 5 4!?? Now, ?+ 2 ? 3 2 2 2! ? ? 1= ? ? ? 2!? ??+ ? 4 2 3 3! 3!?? ? ? 2= ? ? 2 ? ? ??+ ? 4 ?+ ? ?? Put these in the original equation! RHS = ??+1 ?+ 2 ? 3 = ??+ ?0? ?+ ?1 ? ? ? 2!? ??+ ? 4 3!?? 2 2 2! 2 3 3! + ?2 ? ? 2 ? ? ??+ ? 4 ?+ ? ??
, Multi-Step Methods: Explicit Thus, we have reduced ??+1= ??+ ?0? ?+ ?1? ? 1+ ?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 ??+1= ??+ 3?? 1+ ?+ 4 ?= ??+1+ 4 ?+ 2 ?+ 2 ???,????? ??+1= ??+ ? 2!? 3!? ??+ ? 5 4!?? ???? ???? ?????:??+ ? ??+1= ??+1+ 4 2? ??+ ? 5 3?? ??+ ? 5+ 4 ??+ ? 5 3?? 23 12?? 4 4!?? 5 ?? 8 ??+ ? 5 ??+1= ??+ 3?? 1+ ?? Local truncation error (LTE) of this method is O(h4)! The method is non-self starting, or cannot be started with the given initial condition y = y0 at t = t0 or 0. Why???
, Multi-Step Methods: Explicit 5 12?? 2 +3 4 23 12?? 4 ??+ ??? ??+1= ??+ 3?? 1+ ?? 8 Let us assume that we have obtained y1 at t1 = t0 + h and y2 at t2 = t0 + 2h using another method and then applying this method for subsequent time steps: 23 12?2 4 23 12?3 4 23 12?2+ ?3 4 + ??? 5 12?0 +3 4 5 12?1 +3 4 ??+ ??? ?3= ?2+ 3?1+ ?2 8 ??+ ??? ?4= ?3+ 3?2+ ?3 8 5 12?0+ ?1 +3 4 ??+ ?3 ?? = ?2+ 3?1+ ?2 + ?2 8 This way, if we apply the method for n time steps, ?+1 ?? 4 ? ? 1 ?+1 ?? +3 4 23 12 ?=2 5 12 ?=0 ??+ ??? ??+2= ?2+ 3 ?=1 ??+ ?? 8 ?=2
, Multi-Step Methods: Explicit ?+1 ? ? 1 ?+1 ?? +3 4 23 12 ?=2 ?? 4 5 12 ?=0 ??+ ??? ??+2= ?2+ 3 ?=1 ??+ ?? 8 ?=2 Applying the first mean value theorem for integrals: ?+1 ????? = ????? =??+1 ?2 ???? ; ? ??+1,?2 ?=2 Therefore, ??+2 ?+1 ? ? 1 ?? +3 3 23 12 ?=2 ?? 4 5 12 ?=0 ??+1 ?2???? + ??? = ?2+ 3 ?=1 ??+ 8 Global truncation error (GTE) of this method is O(h3)! A method is always referred to with it s order of accuracy of GTE! Therefore, this is 3rd order Adams-Bashforth method!
, Multi-Step Methods: Explicit ? ??+1= ??+ ???? ? ?=0 Some commonly used explicit methods: GTE Order Name k Method Euler Forward 0 h ??+1= ??+ ?? 3 2?? 1 1 h2 ??+1= ??+ 2?? 1 Adams- Bashforth 23 12?? 4 5 2 h3 ??+1= ??+ 3?? 1+ 12?? 2 55 24?? 59 24?? 1+37 24?? 2 3 3 h4 ??+1= ??+ 8?? 3
, Multi-Step Methods: Implicit General form of multi-step implicit methods: ? ??+1 ??+1= ??+ ????+1 ? ?=0 k= 0, 1, 2, ., (n + 1) and h is the uniform time step size ??+1= ??+ ?0??+1+ ?1??+ ?2?? 1 Example: k = 2 ??+1= ??+ ?0??+1+ ?1??+ ?2?? 1 ?? ??= ? = ? + ?2?? 1 ??+1= ??+ ?0??+1 + ?1?? Let s expand all the terms in Taylor s series and equate LHS with RHS!
, Multi-Step Methods: Implicit + ?2?? 1 ??+1= ??+ ?0??+1 + ?1?? Expanding all the terms in Taylor s series: + 2 + 3 + 4 ??+ ? 5 ??? = ??+1= ??+ ?? 2!?? 3!?? 4!?? + 2 3 ?? ??+ ? 4 ?? 1 = ?? 2!?? 3!?? + 2 + 3 + ?? ??+ ? 4 ??+1 = ?? 2!?? 3!?? Put these in the original equation! RHS = ??+1 ??+1 + 2 + 3 + ?? ??+ ? 4 = ??+ ?0 ?? 2!?? 3!?? + ?1?? + 2 3 ?? ??+ ? 4 + ?2 ?? 2!?? 3!??
, Multi-Step Methods: Implicit + 2 + 3 + 4 ??+ ? 5 ??? = ??+1= ??+ ?? RHS = ??+1 ??+1 2!?? 3!?? 4!?? + 2 + 3 + ?? ??+ ? 4 = ??+ ?0 ?? 2!?? 3!?? + ?1?? + 2 3 ?? ??+ ? 4 + ?2 ?? 2!?? 3!?? + 3?0 2+?2 = ??+ ?0+ ?1+ ?2? ?+ 2?0 ?2?? ?? 2 + 4?0 6 ?2 ??+ ? 5 ?? 6 Comparing two sides: ?0 ?2=1 ?0+ ?2=1 ?0+ ?1+ ?2= 1; 2; 3
, Multi-Step Methods: Implicit ?0 ?2=1 ?2= 1 ?0+ ?2=1 ?0+ ?1+ ?2= 1; 5 12, The method is: 2; 3 ?1=2 ?0= 3, 12 5 12??+1+2 + 2 2!?? ?+ 2 2?? ??+ 4 4!?? 1 12?? 1 ??+1= ??+ 3?? + 4 + 3 ??+ ? 5 LHS = ??+1= ??+ ?? 3!?? 4!?? + 3 + 4 RHS = ??+1= ??+ ? ??+1= ??+1 4 ??+ ? 5 6?? 12?? ??+ ? 5= ??+1 4 ??? 5 12?? 24?? The LTE of the method is O(h4) and GTE is O(h3). This is the 3rd order Adams-Moulton method!
, Multi-Step Methods: Implicit ? ??+1 ??+1= ??+ ????+1 ? ?=0 Some commonly used implicit methods: GTE Order Name k Method Euler Backward 0 h ??+1= ??+ ??+1 1 2??+1+1 1 h2 Trapezoidal ??+1= ??+ 2?? 12??+1+2 5 1 2 h3 ??+1= ??+ 3?? 12?? 1 Adams- Moulton 3 8??+1+19 5 1 3 h4 ??+1= ??+ 24?? 24?? 1+ 24?? 2
, Backward Difference Formulae (BDF) Explicit multi-step methods: ? ?? ??= ? ?,? ??+1 ?? = ???? ? ?=0 k= 0, 1, 2, ., n and h is the uniform time step size Implicit multi-step methods: ? ?? ??= ? ?,? ??+1 ?? = ????+1 ? ?=0 k= 0, 1, 2, ., (n + 1) and h is the uniform time step size All variations were in the evaluations of f. What happens if we keep the f evaluation at only one point and use multi-point approximation of the derivative dy/dt?
, Backward Difference Formulae (BDF) Backward Difference Formulae or BDFs: ? ????+1 ?= ??+1 ?=0 k= 0, 1, 2, ., (n + 1) and h is the uniform time step size Example: k = 2 ?0??+1+ ?1??+ ?2??+1= ??+1 ?? ??= ? = ? Let s expand all the terms in Taylor s series and equate LHS with RHS! ?0??+1+ ?1??+ ?2?? 1= ??+1
, Backward Difference Formulae (BDF) ?0??+1+ ?1??+ ?2?? 1= ??+1 + 2 2!?? + 2 2!?? + 2 2!?? + 3 + 4 ??+ ? 5 ??+1= ??+ ?? 3!?? 4!?? 3 + 4 ??+ ? 5 ?? 1= ?? ?? 3!?? 4!?? + 3 + ?? ??+ ? 4 ??+1 ??? = = ?? 3!?? + 2 = ?0+ ?1+ ?2??+ ?0 ?2?? + 3 3! ?0+ ?2?? 2! + 4 ??+ ? 5 ?0 ?2?? ?0+ ?2?? + 4 4! + 3 + 2?? ??+ ? 5 ??? = ?? 2!?? 3!?? ?0+ ?1+ ?2= 0 ?0 ?2= 1 ?0+ ?2= 2
, Backward Difference Formulae (BDF) ?0??+1+ ?1??+ ?2?? 1= ??+1 ?0+ ?1+ ?2= 0 ?0 ?2= 1 ?0+ ?2= 2 ?0=3 ?2=1 2 ?1= 2 2 3??+1 4??+ ?? 1= 2 ??+1 Comparing LHS and RHS, the truncation error term is: ?? = 4 4! The LTE of the method is O(h4) and the GTE is O(h3). ??+ 4 ??+ ? 5= 4 ??+ ? 5 ?0+ ?2?? 3!?? 12?? This is the 3rd order BDF!