What we ll do: Lecture 21. Ordinary Differential Equations (ODEs) Differential Equations. Ordinary Differential Equations

Size: px
Start display at page:

Download "What we ll do: Lecture 21. Ordinary Differential Equations (ODEs) Differential Equations. Ordinary Differential Equations"

Transcription

1 What we ll do: Lecture Ordinary Differential Equations J. Chaudhry Department of Mathematics and Statistics University of New Mexico Review ODEs Single Step Methods Euler s method (st order accurate) Runge-Kutta methods (higher order accuracy) Accuracy and stability of the methods J. Chaudhry (UNM) CS 357 / 34 Differential Equations J. Chaudhry (UNM) CS 357 / 34 Ordinary Differential Equations (ODEs) Its hard to model the state of a system Temperature in the room Pressure on the wing of an airplane Concentration of ions in a solvent and a million more However, its much simpler to model the rate of change of the state: differential equations Could involve change w.r.t to one variable (e.g. time): Ordinary Differential Equations Could involve change w.r.t multiple variables (e.g. x and y axis): Partial Differential Equations An ODE involves One function u(t) Its derivatives u (t), u (t), u (t), etc Order of ODE is the higest order derivative Examples: Generic First-order ODE u = f (t, u(t)) Harmonic Oscillator (Second-order ODE) mu (t) + cu (t) + ku(t) = f (t) m: mass, c damping coeff., k: elastic stiffness coeff, f (t): external force J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

2 Initial Value Problems (IVPs) Numerical Solution of IVPs ODEs in previous examples have infinitely many solutions Get unique solution by specifying initial conditions (ICs) Examples: IVP = ODE + IC u = f (t, u(t)), t (a, b] u(a) = u a mu (t) + cu (t) + ku(t) = f (t), t (0, T] u(0) = A, u (0) = B Many important ODEs have no closed form solution Analytical methods of limited use in such scenarios Approximate the solution using numerics Consider first order ODE u = f (t, u(t)), t (a, b] u(a) = u a Discretize [a, b] into equi-spaced points: with h = t i t i = (b a)/n a = t 0 < t < t < < t n < t n = b J. Chaudhry (UNM) CS / 34 Euler s method J. Chaudhry (UNM) CS / 34 Euler Example Simplest numerical methods to solve IVPs Taylor s thm u(t + h) = u(t) + hu (t) + (h /)u (c), Let u i be approximation to exact solution u(t i ) Drop O(h ) terms and utilize u (t) = f (t, u) t < c < t + h Apply Euler s method with h = 0. to the IVP u = tu + t 3, t [0, ] u(0) = h = (b a)/n = n = 5. Step i t i u i f (t i, u i ) u i+ = u i + hf (t i, u i ) u 0 = u a for i = 0 to n 3 u i+ = u i + h f (t i, u i ) Listing : Euler Algorithm J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

3 Euler Example Accuracy of Euler s method Exact solution is u(t) = 3e t / t Euler method with h = 0., 0., 0.05 As h decreases, approximation converges to exact solution Compute the error at final time, t = Error, e = O(h p ) loglog plot Exact Soln Euler (h=/5) Euler (h=/0) Euler (h=/0) Error u(t) t p appears to be h J. Chaudhry (UNM) CS / 34 Accuracy of Euler s method J. Chaudhry (UNM) CS / 34 Accuracy of Euler s method: Some Theory Compute the error at final time, t = Error, e = O(h p ) p p log(e k/e k ) log(h k /h k ) Experiment k e k e k h k h k p / /0 / /40 / /80 / /60 / Euler s method is first-order accurate method Can theoretically show this too Recall the derivation using Taylor s thm Exact solution Numerical soln u(t + h) = u(t) + hf (t, u) + O(h ) u i+ = u i + hf (t i, u i ) Assume u(t) = u i. Then the local error, u(t + h) u i+ is u(t + h) u i+ = O(h ) Global error is the error at final time: u(t n ) u n Local errors accumulates to give O(nh ) = O(h) accuracy since nh = (b a). The analysis for glocal error is complicated and we omit it. J. Chaudhry (UNM) CS 357 / 34 J. Chaudhry (UNM) CS 357 / 34

4 Systems of ODEs Euler method for first-order system of ODEs A first-order system of m ODEs has the form u = f (t, u, u,..., u m ) u = f (t, u, u,..., u m ) t (a, b]. u m = f m (t, u, u,..., u m ) In IVPs, each variable has its own initial condition: u (a) = u a u (a) = u a. u m (a) = u ma Apply scalar Euler s method to each component Example: apply Euler s method to u = u + u = f (t, u, u ), u (0) = 0 u = tu = f (t, u, u ), u (0) = Euler s method: u,i+ = u,i + h( u,i + u,i ) u,i+ = u,i + h( t i u,i ) J. Chaudhry (UNM) CS / 34 Higher order equations J. Chaudhry (UNM) CS / 34 Euler s method for Higher order equations Convert higher order ODE to system to first order ODEs Consider u + au + btu = c Introducte y = u y = u This leads to the following first-order ODE system y = y y = ay bty + c Now apply Euler s method! We get approximation to y = u. Solve the following IVP using Euler s method: u = (u ) uu + sin t, u(0) =, u (0) = 0, u (0) = Convert to first-order system: y = u, y = u, y 3 = u Euler s method: y = y, y (0) = y = y 3, y (0) = 0 y 3 = y 3 y y + sin t, y 3 (0) = y,i+ = y,i + hy,i y,i+ = y,i + hy 3,i y 3,i+ = y 3,i + h(y 3,i y,iy,i + sin t i ) J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

5 Runge-Kutta Methods (RK) Two-stage RK methods Integration both sides of u (t) = f (t, u(t)) from t i to t i+ u(t i+ ) u(t i ) = ti+ t i f (t, u(t)) dt Runge-Kutta methods are popular methods to solve IVPs Euler method is a single-stage RK method (RK) Higher order methods derived using higher order Taylor series, higher order integration techniques etc. Higher order methods have more stages Now apply (simple) trapezoidal rule on the RHS Let u i u(t i ) u(t i+ ) u(t i ) = h [f (t i, u(t i )) + f (t i+, u(t i+ ))] + O(h 3 ) u i+ = u i + h [f (t i, u i ) + f (t i + h, u i+ )] + O(h 3 ) Approx u i+ on RHS by Euler s method u i+ = u i + h [f (t i, u i ) + f (t i + h, u i + f (t i, u i ) + O(h )] + O(h 3 ) J. Chaudhry (UNM) CS / 34 RKa method J. Chaudhry (UNM) CS / 34 RKb method RKa Drop O(h 3 ) terms. Get method called RKa u i+ = u i + h [f (t i, u i ) + f (t i + h, u i + hf (t i, u i )] Written as a two-stage method K = f (t i, u i ) K = f (t i + h, u i + hk ) u i+ = u i + h( K + K ) K and K are called stages. RKa has has local error of O(h 3 ) for a global error of O(h ). Integration both sides of u (t) = f (t, u(t)) from t i to t i+ u(t i+ ) u(t i ) = Now apply midpoint rule on the RHS ti+ t i f (t, u(t)) dt u(t i+ ) u(t i ) = h[f (t i + h, u(t i + h ))] + O(h3 ) Use Euler s method to approx u(t i + h ) u(t i) + (h/)f (t i, u(t i ) Get RKb method u i+ = u i + hf (t i + h, u i + h f (t i, u i )) J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

6 RKb method RK4 method RKb Two-stage RKb method K = f (t i, u i ) K = f (t i + h, u i + h K ) u i+ = u i + hk Second order accurate as well RK4 Four stages Derived using Simpson s rule with two subintervals [t i, t i + h/] and [t i + h/, t i + h] K = f (t i, u i ) K = f (t i + h, u i + h K ) K 3 = f (t i + h, u i + h K ) K 4 = f (t i + h, u i + hk 3 ) u i+ = u i + h 6 (K + K + K 3 + K 4 ) Fourth order accurate Arguably the most widely use ODE integrator J. Chaudhry (UNM) CS 357 / 34 Geometric Interpretation of RK methods J. Chaudhry (UNM) CS 357 / 34 Stability: Euler method on a model problem Model problem (Dahlquist model problem) u (t) = λu(t), λ > 0, t [0, T] Euler (or RK) uses the slope at t i : u i = f (t i, u i ) RKa uses the slopes at t i and t i+ which are K and K RKb uses the slopes at t i and t i+ which are K and K RK4 uses the slopes t i K t i+ K +K 3 t i+ K 4 u(0) = u 0 Exact solution is: u(t) = u 0 e λt u t Solution u decays exponentially as t increases J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

7 Stability: Euler method on a model problem What went wrong? Euler method for the model problem: u i+ = u i + h( λu i ) = ( hλ)u i, i = 0,,,... E.g. choose λ = 30, u 0 =, h = 0. u Euler method converges when h is small enough What about when h is not sufficiently small? Local accuracy of Euler method is nd order from Taylor series But these local errors can propagate and increase exponentially! Stability quantifies the propagation of errors In the example above we chose a step size for which Euler method was not stable t Instead of exponential decay, the approximate solution has a growing oscillatory behavior! J. Chaudhry (UNM) CS / 34 Amplification factor J. Chaudhry (UNM) CS / 34 Amplification factor of Euler Method Euler method was u i+ = ( hλ)u i u i+ u i = hλ = G i = u i+ u i = hλ G i = u i+ /u i is called the amplification factor at time step i For Euler method, G i = hλ If amplification factor is less than one then numerical solution does not grow without bound. We say the numerical solution is stable For Euler method we need for stability G i < = hλ < = < hλ < = 0 < λh < This gives a step size restriction 0 < h < /λ In the earlier example h = 0., λ = 30 so hλ = 3 > = unstable J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

8 Region of Stability Region of Stability for Euler s method Let with λ R > 0 λ = λ R + iλ I Why complex number? For system of ODEs λ represents the eigenvalues of the coefficient matrix. Remember the eigenvalues can be complex even if the matrix is real Region of stability: Region in the λh plane where the numerical solver is stable. That is, the region in which the amplification factor G i < G j = hλ = h(λ R + iλ I ) = ( hλ R ) ihλ i = ( hλ R ) + (hλ I ) < Region of stability is circle with center (0, ) and radius : hλ I hλ R J. Chaudhry (UNM) CS / 34 Region of Stability for RKb For the model problem we get K = λu j, K = λ(u j h λu j) u j+ = u j ( hλ + (hλ) ) Amplification factor G j = u j+ u j = (hλ) + (hλ) < Want all z = hλ in the complex place such that z + z < Or, find all z such that for all φ [0, π] z + z < e iφ J. Chaudhry (UNM) CS / 34 Region of Stability for RKb Solve the quadratic equation Two solutions Im(z) z z + ( e iφ ) = 0 z, = ± ze iφ Re(z) Region of stability is the region inside the curves J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

9 Region of Stability for RK4 Region of Stability for RK4 After similar derivations as earlier we get G j = u j+ u j = (hλ) + (hλ) 6 (hλ)3 + 4 (λh)4 Want z = hλ such that G(z) = z + z 6 z3 + 4 z4 < Plot G j (z) for all possible z values and then plot the -contour of G j Listing : RK4 Stability [x,y] = meshgrid(linspace(-4,4,000), linspace(-4,4,000)); z = x + i*y; 3 contour(x,y, abs( - z + (/)*z.ˆ - (/6)*z.ˆ3 + (/4)*z.ˆ4 ),[, ], k- ); Im(z) Re(z) J. Chaudhry (UNM) CS / 34 J. Chaudhry (UNM) CS / 34

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Numerical solution of ODEs

Numerical solution of ODEs Numerical solution of ODEs Arne Morten Kvarving Department of Mathematical Sciences Norwegian University of Science and Technology November 5 2007 Problem and solution strategy We want to find an approximation

More information

Differential Equations

Differential Equations Differential Equations Overview of differential equation! Initial value problem! Explicit numeric methods! Implicit numeric methods! Modular implementation Physics-based simulation An algorithm that

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 6 Chapter 20 Initial-Value Problems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9 Lecture Notes to Accompany Scientific Computing An Introductory Survey Second Edition by Michael T. Heath Chapter 9 Initial Value Problems for Ordinary Differential Equations Copyright c 2001. Reproduction

More information

Numerical Methods for Initial Value Problems; Harmonic Oscillators

Numerical Methods for Initial Value Problems; Harmonic Oscillators Lab 1 Numerical Methods for Initial Value Problems; Harmonic Oscillators Lab Objective: Implement several basic numerical methods for initial value problems (IVPs), and use them to study harmonic oscillators.

More information

NUMERICAL SOLUTION OF ODE IVPs. Overview

NUMERICAL SOLUTION OF ODE IVPs. Overview NUMERICAL SOLUTION OF ODE IVPs 1 Quick review of direction fields Overview 2 A reminder about and 3 Important test: Is the ODE initial value problem? 4 Fundamental concepts: Euler s Method 5 Fundamental

More information

Ordinary Differential Equations

Ordinary Differential Equations Chapter 7 Ordinary Differential Equations Differential equations are an extremely important tool in various science and engineering disciplines. Laws of nature are most often expressed as different equations.

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 9 Initial Value Problems for Ordinary Differential Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign

More information

Numerical Methods for Initial Value Problems; Harmonic Oscillators

Numerical Methods for Initial Value Problems; Harmonic Oscillators 1 Numerical Methods for Initial Value Problems; Harmonic Oscillators Lab Objective: Implement several basic numerical methods for initial value problems (IVPs), and use them to study harmonic oscillators.

More information

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations ECE257 Numerical Methods and Scientific Computing Ordinary Differential Equations Today s s class: Stiffness Multistep Methods Stiff Equations Stiffness occurs in a problem where two or more independent

More information

Numerical Methods - Initial Value Problems for ODEs

Numerical Methods - Initial Value Problems for ODEs Numerical Methods - Initial Value Problems for ODEs Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Initial Value Problems for ODEs 2013 1 / 43 Outline 1 Initial Value

More information

Ordinary Differential Equations II

Ordinary Differential Equations II Ordinary Differential Equations II CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Ordinary Differential Equations II 1 / 29 Almost Done! No

More information

Ordinary differential equation II

Ordinary differential equation II Ordinary Differential Equations ISC-5315 1 Ordinary differential equation II 1 Some Basic Methods 1.1 Backward Euler method (implicit method) The algorithm looks like this: y n = y n 1 + hf n (1) In contrast

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 6 Chapter 20 Initial-Value Problems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Chap. 20: Initial-Value Problems

Chap. 20: Initial-Value Problems Chap. 20: Initial-Value Problems Ordinary Differential Equations Goal: to solve differential equations of the form: dy dt f t, y The methods in this chapter are all one-step methods and have the general

More information

Initial value problems for ordinary differential equations

Initial value problems for ordinary differential equations Initial value problems for ordinary differential equations Xiaojing Ye, Math & Stat, Georgia State University Spring 2019 Numerical Analysis II Xiaojing Ye, Math & Stat, Georgia State University 1 IVP

More information

Ordinary Differential Equations II

Ordinary Differential Equations II Ordinary Differential Equations II CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Ordinary Differential Equations II 1 / 33 Almost Done! Last

More information

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS The general form of a first order differential equations is = f(x, y) with initial condition y(a) = y a We seek the solution y = y(x) for x > a This is shown

More information

Euler s Method, cont d

Euler s Method, cont d Jim Lambers MAT 461/561 Spring Semester 009-10 Lecture 3 Notes These notes correspond to Sections 5. and 5.4 in the text. Euler s Method, cont d We conclude our discussion of Euler s method with an example

More information

8.1 Introduction. Consider the initial value problem (IVP):

8.1 Introduction. Consider the initial value problem (IVP): 8.1 Introduction Consider the initial value problem (IVP): y dy dt = f(t, y), y(t 0)=y 0, t 0 t T. Geometrically: solutions are a one parameter family of curves y = y(t) in(t, y)-plane. Assume solution

More information

Ordinary Differential Equations

Ordinary Differential Equations CHAPTER 8 Ordinary Differential Equations 8.1. Introduction My section 8.1 will cover the material in sections 8.1 and 8.2 in the book. Read the book sections on your own. I don t like the order of things

More information

Lecture Notes on Numerical Differential Equations: IVP

Lecture Notes on Numerical Differential Equations: IVP Lecture Notes on Numerical Differential Equations: IVP Professor Biswa Nath Datta Department of Mathematical Sciences Northern Illinois University DeKalb, IL. 60115 USA E mail: dattab@math.niu.edu URL:

More information

Ordinary Differential Equations

Ordinary Differential Equations Ordinary Differential Equations Introduction: first order ODE We are given a function f(t,y) which describes a direction field in the (t,y) plane an initial point (t 0,y 0 ) We want to find a function

More information

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations Finite Differences for Differential Equations 28 PART II Finite Difference Methods for Differential Equations Finite Differences for Differential Equations 29 BOUNDARY VALUE PROBLEMS (I) Solving a TWO

More information

Chapter 6 - Ordinary Differential Equations

Chapter 6 - Ordinary Differential Equations Chapter 6 - Ordinary Differential Equations 7.1 Solving Initial-Value Problems In this chapter, we will be interested in the solution of ordinary differential equations. Ordinary differential equations

More information

Lecture 5. Complex Numbers and Euler s Formula

Lecture 5. Complex Numbers and Euler s Formula Lecture 5. Complex Numbers and Euler s Formula University of British Columbia, Vancouver Yue-Xian Li March 017 1 Main purpose: To introduce some basic knowledge of complex numbers to students so that they

More information

CS520: numerical ODEs (Ch.2)

CS520: numerical ODEs (Ch.2) .. CS520: numerical ODEs (Ch.2) Uri Ascher Department of Computer Science University of British Columbia ascher@cs.ubc.ca people.cs.ubc.ca/ ascher/520.html Uri Ascher (UBC) CPSC 520: ODEs (Ch. 2) Fall

More information

Initial value problems for ordinary differential equations

Initial value problems for ordinary differential equations AMSC/CMSC 660 Scientific Computing I Fall 2008 UNIT 5: Numerical Solution of Ordinary Differential Equations Part 1 Dianne P. O Leary c 2008 The Plan Initial value problems (ivps) for ordinary differential

More information

Consistency and Convergence

Consistency and Convergence Jim Lambers MAT 77 Fall Semester 010-11 Lecture 0 Notes These notes correspond to Sections 1.3, 1.4 and 1.5 in the text. Consistency and Convergence We have learned that the numerical solution obtained

More information

Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers

Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers Math 660 Lecture 4: FDM for evolutionary equations: ODE solvers Consider the ODE u (t) = f(t, u(t)), u(0) = u 0, where u could be a vector valued function. Any ODE can be reduced to a first order system,

More information

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS LECTURE 10 APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS Ordinary Differential Equations Initial Value Problems For Initial Value problems (IVP s), conditions are specified

More information

[ ] is a vector of size p.

[ ] is a vector of size p. Lecture 11 Copyright by Hongyun Wang, UCSC Recap: General form of explicit Runger-Kutta methods for solving y = F( y, t) k i = hfy n + i1 j =1 c ij k j, t n + d i h, i = 1,, p + p j =1 b j k j A Runge-Kutta

More information

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of Scientific Computing with Case Studies SIAM Press, 2009 http://www.cs.umd.edu/users/oleary/sccswebpage Lecture Notes for Unit V Solution of Differential Equations Part 1 Dianne P. O Leary c 2008 1 The

More information

Numerical Differential Equations: IVP

Numerical Differential Equations: IVP Chapter 11 Numerical Differential Equations: IVP **** 4/16/13 EC (Incomplete) 11.1 Initial Value Problem for Ordinary Differential Equations We consider the problem of numerically solving a differential

More information

ODE Runge-Kutta methods

ODE Runge-Kutta methods ODE Runge-Kutta methods The theory (very short excerpts from lectures) First-order initial value problem We want to approximate the solution Y(x) of a system of first-order ordinary differential equations

More information

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Mathematics for chemical engineers. Numerical solution of ordinary differential equations Mathematics for chemical engineers Drahoslava Janovská Numerical solution of ordinary differential equations Initial value problem Winter Semester 2015-2016 Outline 1 Introduction 2 One step methods Euler

More information

Solving scalar IVP s : Runge-Kutta Methods

Solving scalar IVP s : Runge-Kutta Methods Solving scalar IVP s : Runge-Kutta Methods Josh Engwer Texas Tech University March 7, NOTATION: h step size x n xt) t n+ t + h x n+ xt n+ ) xt + h) dx = ft, x) SCALAR IVP ASSUMED THROUGHOUT: dt xt ) =

More information

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take

Math Numerical Analysis Homework #4 Due End of term. y = 2y t 3y2 t 3, 1 t 2, y(1) = 1. n=(b-a)/h+1; % the number of steps we need to take Math 32 - Numerical Analysis Homework #4 Due End of term Note: In the following y i is approximation of y(t i ) and f i is f(t i,y i ).. Consider the initial value problem, y = 2y t 3y2 t 3, t 2, y() =.

More information

Introduction to standard and non-standard Numerical Methods

Introduction to standard and non-standard Numerical Methods Introduction to standard and non-standard Numerical Methods Dr. Mountaga LAM AMS : African Mathematic School 2018 May 23, 2018 One-step methods Runge-Kutta Methods Nonstandard Finite Difference Scheme

More information

Finite Difference and Finite Element Methods

Finite Difference and Finite Element Methods Finite Difference and Finite Element Methods Georgy Gimel farb COMPSCI 369 Computational Science 1 / 39 1 Finite Differences Difference Equations 3 Finite Difference Methods: Euler FDMs 4 Finite Element

More information

Fourth Order RK-Method

Fourth Order RK-Method Fourth Order RK-Method The most commonly used method is Runge-Kutta fourth order method. The fourth order RK-method is y i+1 = y i + 1 6 (k 1 + 2k 2 + 2k 3 + k 4 ), Ordinary Differential Equations (ODE)

More information

4 Stability analysis of finite-difference methods for ODEs

4 Stability analysis of finite-difference methods for ODEs MATH 337, by T. Lakoba, University of Vermont 36 4 Stability analysis of finite-difference methods for ODEs 4.1 Consistency, stability, and convergence of a numerical method; Main Theorem In this Lecture

More information

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1 Lectures - Week 11 General First Order ODEs & Numerical Methods for IVPs In general, nonlinear problems are much more difficult to solve than linear ones. Unfortunately many phenomena exhibit nonlinear

More information

Differential Equations

Differential Equations Differential Equations Definitions Finite Differences Taylor Series based Methods: Euler Method Runge-Kutta Methods Improved Euler, Midpoint methods Runge Kutta (2nd, 4th order) methods Predictor-Corrector

More information

Integration of Ordinary Differential Equations

Integration of Ordinary Differential Equations Integration of Ordinary Differential Equations Com S 477/577 Nov 7, 00 1 Introduction The solution of differential equations is an important problem that arises in a host of areas. Many differential equations

More information

DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science

DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science DELFT UNIVERSITY OF TECHNOLOGY Faculty of Electrical Engineering, Mathematics and Computer Science ANSWERS OF THE TEST NUMERICAL METHODS FOR DIFFERENTIAL EQUATIONS ( WI3097 TU AESB0 ) Thursday April 6

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 5 Chapter 21 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University 1 All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

1 Systems of First Order IVP

1 Systems of First Order IVP cs412: introduction to numerical analysis 12/09/10 Lecture 24: Systems of First Order Differential Equations Instructor: Professor Amos Ron Scribes: Yunpeng Li, Mark Cowlishaw, Nathanael Fillmore 1 Systems

More information

Applied Math for Engineers

Applied Math for Engineers Applied Math for Engineers Ming Zhong Lecture 15 March 28, 2018 Ming Zhong (JHU) AMS Spring 2018 1 / 28 Recap Table of Contents 1 Recap 2 Numerical ODEs: Single Step Methods 3 Multistep Methods 4 Method

More information

Ordinary Differential Equations

Ordinary Differential Equations Ordinary Differential Equations Professor Dr. E F Toro Laboratory of Applied Mathematics University of Trento, Italy eleuterio.toro@unitn.it http://www.ing.unitn.it/toro September 19, 2014 1 / 55 Motivation

More information

The family of Runge Kutta methods with two intermediate evaluations is defined by

The family of Runge Kutta methods with two intermediate evaluations is defined by AM 205: lecture 13 Last time: Numerical solution of ordinary differential equations Today: Additional ODE methods, boundary value problems Thursday s lecture will be given by Thomas Fai Assignment 3 will

More information

Simple ODE Solvers - Derivation

Simple ODE Solvers - Derivation Simple ODE Solvers - Derivation These notes provide derivations of some simple algorithms for generating, numerically, approximate solutions to the initial value problem y (t =f ( t, y(t y(t 0 =y 0 Here

More information

10 Numerical Solutions of PDEs

10 Numerical Solutions of PDEs 10 Numerical Solutions of PDEs There s no sense in being precise when you don t even know what you re talking about.- John von Neumann (1903-1957) Most of the book has dealt with finding exact solutions

More information

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods Numerical Analysis by Dr. Anita Pal Assistant Professor Department of Mathematics National Institute of Technology Durgapur Durgapur-71309 email: anita.buie@gmail.com 1 . Chapter 8 Numerical Solution of

More information

Numerical Methods for Partial Differential Equations. CAAM 452 Spring 2005 Lecture 2 Instructor: Tim Warburton

Numerical Methods for Partial Differential Equations. CAAM 452 Spring 2005 Lecture 2 Instructor: Tim Warburton Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 2 Instructor: Tim Warburton Note on textbook for finite difference methods Due to the difficulty some students have experienced

More information

Numerical Methods for Differential Equations

Numerical Methods for Differential Equations CHAPTER 5 Numerical Methods for Differential Equations In this chapter we will discuss a few of the many numerical methods which can be used to solve initial value problems and one-dimensional boundary

More information

Numerical Methods for Differential Equations

Numerical Methods for Differential Equations Numerical Methods for Differential Equations Chapter 2: Runge Kutta and Linear Multistep methods Gustaf Söderlind and Carmen Arévalo Numerical Analysis, Lund University Textbooks: A First Course in the

More information

Introduction to the Numerical Solution of IVP for ODE

Introduction to the Numerical Solution of IVP for ODE Introduction to the Numerical Solution of IVP for ODE 45 Introduction to the Numerical Solution of IVP for ODE Consider the IVP: DE x = f(t, x), IC x(a) = x a. For simplicity, we will assume here that

More information

7 Hyperbolic Differential Equations

7 Hyperbolic Differential Equations Numerical Analysis of Differential Equations 243 7 Hyperbolic Differential Equations While parabolic equations model diffusion processes, hyperbolic equations model wave propagation and transport phenomena.

More information

Solution via Laplace transform and matrix exponential

Solution via Laplace transform and matrix exponential EE263 Autumn 2015 S. Boyd and S. Lall Solution via Laplace transform and matrix exponential Laplace transform solving ẋ = Ax via Laplace transform state transition matrix matrix exponential qualitative

More information

Ordinary Differential Equations

Ordinary Differential Equations Ordinary Differential Equations We call Ordinary Differential Equation (ODE) of nth order in the variable x, a relation of the kind: where L is an operator. If it is a linear operator, we call the equation

More information

MB4018 Differential equations

MB4018 Differential equations MB4018 Differential equations Part II http://www.staff.ul.ie/natalia/mb4018.html Prof. Natalia Kopteva Spring 2015 MB4018 (Spring 2015) Differential equations Part II 0 / 69 Section 1 Second-Order Linear

More information

Numerical Solution of Differential Equations

Numerical Solution of Differential Equations 1 Numerical Solution of Differential Equations A differential equation (or "DE") contains derivatives or differentials. In a differential equation the unknown is a function, and the differential equation

More information

Modeling and Experimentation: Compound Pendulum

Modeling and Experimentation: Compound Pendulum Modeling and Experimentation: Compound Pendulum Prof. R.G. Longoria Department of Mechanical Engineering The University of Texas at Austin Fall 2014 Overview This lab focuses on developing a mathematical

More information

Second Order ODEs. CSCC51H- Numerical Approx, Int and ODEs p.130/177

Second Order ODEs. CSCC51H- Numerical Approx, Int and ODEs p.130/177 Second Order ODEs Often physical or biological systems are best described by second or higher-order ODEs. That is, second or higher order derivatives appear in the mathematical model of the system. For

More information

1 Error Analysis for Solving IVP

1 Error Analysis for Solving IVP cs412: introduction to numerical analysis 12/9/10 Lecture 25: Numerical Solution of Differential Equations Error Analysis Instructor: Professor Amos Ron Scribes: Yunpeng Li, Mark Cowlishaw, Nathanael Fillmore

More information

Lecture 4: Numerical solution of ordinary differential equations

Lecture 4: Numerical solution of ordinary differential equations Lecture 4: Numerical solution of ordinary differential equations Department of Mathematics, ETH Zürich General explicit one-step method: Consistency; Stability; Convergence. High-order methods: Taylor

More information

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

INTRODUCTION TO COMPUTER METHODS FOR O.D.E. INTRODUCTION TO COMPUTER METHODS FOR O.D.E. 0. Introduction. The goal of this handout is to introduce some of the ideas behind the basic computer algorithms to approximate solutions to differential equations.

More information

Selected HW Solutions

Selected HW Solutions Selected HW Solutions HW1 1 & See web page notes Derivative Approximations. For example: df f i+1 f i 1 = dx h i 1 f i + hf i + h h f i + h3 6 f i + f i + h 6 f i + 3 a realmax 17 1.7014 10 38 b realmin

More information

Numerical method for approximating the solution of an IVP. Euler Algorithm (the simplest approximation method)

Numerical method for approximating the solution of an IVP. Euler Algorithm (the simplest approximation method) Section 2.7 Euler s Method (Computer Approximation) Key Terms/ Ideas: Numerical method for approximating the solution of an IVP Linear Approximation; Tangent Line Euler Algorithm (the simplest approximation

More information

Dynamics of Adaptive Time-Stepping ODE solvers

Dynamics of Adaptive Time-Stepping ODE solvers Dynamics of Adaptive Time-Stepping ODE solvers A.R. Humphries Tony.Humphries@mcgill.ca Joint work with: NICK CHRISTODOULOU PAUL FENTON RATNAM VIGNESWARAN ARH acknowledges support of the Engineering and

More information

Ordinary Differential Equations (ODEs)

Ordinary Differential Equations (ODEs) Ordinary Differential Equations (ODEs) NRiC Chapter 16. ODEs involve derivatives wrt one independent variable, e.g. time t. ODEs can always be reduced to a set of firstorder equations (involving only first

More information

Lecture IV: Time Discretization

Lecture IV: Time Discretization Lecture IV: Time Discretization Motivation Kinematics: continuous motion in continuous time Computer simulation: Discrete time steps t Discrete Space (mesh particles) Updating Position Force induces acceleration.

More information

EXAMPLE OF ONE-STEP METHOD

EXAMPLE OF ONE-STEP METHOD EXAMPLE OF ONE-STEP METHOD Consider solving y = y cos x, y(0) = 1 Imagine writing a Taylor series for the solution Y (x), say initially about x = 0. Then Y (h) = Y (0) + hy (0) + h2 2 Y (0) + h3 6 Y (0)

More information

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn Review Taylor Series and Error Analysis Roots of Equations Linear Algebraic Equations Optimization Numerical Differentiation and Integration Ordinary Differential Equations Partial Differential Equations

More information

Numerical Methods for the Solution of Differential Equations

Numerical Methods for the Solution of Differential Equations Numerical Methods for the Solution of Differential Equations Markus Grasmair Vienna, winter term 2011 2012 Analytical Solutions of Ordinary Differential Equations 1. Find the general solution of the differential

More information

Section 7.4 Runge-Kutta Methods

Section 7.4 Runge-Kutta Methods Section 7.4 Runge-Kutta Methods Key terms: Taylor methods Taylor series Runge-Kutta; methods linear combinations of function values at intermediate points Alternatives to second order Taylor methods Fourth

More information

MA/CS 615 Spring 2019 Homework #2

MA/CS 615 Spring 2019 Homework #2 MA/CS 615 Spring 019 Homework # Due before class starts on Feb 1. Late homework will not be given any credit. Collaboration is OK but not encouraged. Indicate on your report whether you have collaborated

More information

Solving Ordinary Differential Equations

Solving Ordinary Differential Equations Solving Ordinary Differential Equations Sanzheng Qiao Department of Computing and Software McMaster University March, 2014 Outline 1 Initial Value Problem Euler s Method Runge-Kutta Methods Multistep Methods

More information

Stability regions of Runge-Kutta methods. Stephan Houben Eindhoven University of Technology

Stability regions of Runge-Kutta methods. Stephan Houben Eindhoven University of Technology Stability regions of Runge-Kutta methods Stephan Houben Eindhoven University of Technology February 19, 2002 1 Overview of the talk 1. Quick review of some concepts 2. Stability regions 3. L-stability

More information

Ordinary Differential Equations

Ordinary Differential Equations Chapter 13 Ordinary Differential Equations We motivated the problem of interpolation in Chapter 11 by transitioning from analzying to finding functions. That is, in problems like interpolation and regression,

More information

Woods Hole Methods of Computational Neuroscience. Differential Equations and Linear Algebra. Lecture Notes

Woods Hole Methods of Computational Neuroscience. Differential Equations and Linear Algebra. Lecture Notes Woods Hole Methods of Computational Neuroscience Differential Equations and Linear Algebra Lecture Notes c 004, 005 William L. Kath MCN 005 ODE & Linear Algebra Notes 1. Classification of differential

More information

A Brief Introduction to Numerical Methods for Differential Equations

A Brief Introduction to Numerical Methods for Differential Equations A Brief Introduction to Numerical Methods for Differential Equations January 10, 2011 This tutorial introduces some basic numerical computation techniques that are useful for the simulation and analysis

More information

Numerical Methods for Differential Equations

Numerical Methods for Differential Equations Numerical Methods for Differential Equations Chapter 2: Runge Kutta and Multistep Methods Gustaf Söderlind Numerical Analysis, Lund University Contents V4.16 1. Runge Kutta methods 2. Embedded RK methods

More information

The integrating factor method (Sect. 1.1)

The integrating factor method (Sect. 1.1) The integrating factor method (Sect. 1.1) Overview of differential equations. Linear Ordinary Differential Equations. The integrating factor method. Constant coefficients. The Initial Value Problem. Overview

More information

Mathematics 22: Lecture 10

Mathematics 22: Lecture 10 Mathematics 22: Lecture 10 Euler s Method Dan Sloughter Furman University January 22, 2008 Dan Sloughter (Furman University) Mathematics 22: Lecture 10 January 22, 2008 1 / 14 Euler s method Consider the

More information

Solution: (a) Before opening the parachute, the differential equation is given by: dv dt. = v. v(0) = 0

Solution: (a) Before opening the parachute, the differential equation is given by: dv dt. = v. v(0) = 0 Math 2250 Lab 4 Name/Unid: 1. (35 points) Leslie Leroy Irvin bails out of an airplane at the altitude of 16,000 ft, falls freely for 20 s, then opens his parachute. Assuming linear air resistance ρv ft/s

More information

The Finite Element Method for the Analysis of Non-Linear and Dynamic Systems: Non-Linear Dynamics Part I

The Finite Element Method for the Analysis of Non-Linear and Dynamic Systems: Non-Linear Dynamics Part I The Finite Element Method for the Analysis of Non-Linear and Dynamic Systems: Non-Linear Dynamics Part I Prof. Dr. Eleni Chatzi Dr. Giuseppe Abbiati, Dr. Konstantinos Agathos Lecture 5/Part A - 23 November,

More information

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20 2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20 REVIEW Lecture 19: Finite Volume Methods Review: Basic elements of a FV scheme and steps to step-up a FV scheme One Dimensional examples d x j x j 1/2

More information

Physically Based Modeling: Principles and Practice Differential Equation Basics

Physically Based Modeling: Principles and Practice Differential Equation Basics Physically Based Modeling: Principles and Practice Differential Equation Basics Andrew Witkin and David Baraff Robotics Institute Carnegie Mellon University Please note: This document is 1997 by Andrew

More information

The Plan. Initial value problems (ivps) for ordinary differential equations (odes) Review of basic methods You are here: Hamiltonian systems

The Plan. Initial value problems (ivps) for ordinary differential equations (odes) Review of basic methods You are here: Hamiltonian systems Scientific Computing with Case Studies SIAM Press, 2009 http://www.cs.umd.edu/users/oleary/sccswebpage Lecture Notes for Unit V Solution of Differential Equations Part 2 Dianne P. O Leary c 2008 The Plan

More information

4. Numerical analysis II

4. Numerical analysis II 4. Numerical analysis II 1. Numerical differentiation 2. Numerical integration 3. Ordinary differential equations (ODEs). First order ODEs 4. Numerical methods for initial value problems (individual ODEs)

More information

Physically Based Modeling Differential Equation Basics

Physically Based Modeling Differential Equation Basics Physically Based Modeling Differential Equation Basics Andrew Witkin and David Baraff Pixar Animation Studios Please note: This document is 2001 by Andrew Witkin and David Baraff. This chapter may be freely

More information

Part 1. The diffusion equation

Part 1. The diffusion equation Differential Equations FMNN10 Graded Project #3 c G Söderlind 2016 2017 Published 2017-11-27. Instruction in computer lab 2017-11-30/2017-12-06/07. Project due date: Monday 2017-12-11 at 12:00:00. Goals.

More information

Ordinary Differential Equations: Initial Value problems (IVP)

Ordinary Differential Equations: Initial Value problems (IVP) Chapter Ordinary Differential Equations: Initial Value problems (IVP) Many engineering applications can be modeled as differential equations (DE) In this book, our emphasis is about how to use computer

More information

25 Self-Assessment. 26 Eigenvalue Stability for a Linear ODE. Chapter 7 Eigenvalue Stability

25 Self-Assessment. 26 Eigenvalue Stability for a Linear ODE. Chapter 7 Eigenvalue Stability Chapter 7 Eigenvalue Stability As we have seen, while numerical methods can be convergent, they can still exhibit instabilities as the number of timesteps n increases for finite t. For example, when applying

More information

Mathematics 22: Lecture 11

Mathematics 22: Lecture 11 Mathematics 22: Lecture 11 Runge-Kutta Dan Sloughter Furman University January 25, 2008 Dan Sloughter (Furman University) Mathematics 22: Lecture 11 January 25, 2008 1 / 11 Order of approximations One

More information

Lecture V: The game-engine loop & Time Integration

Lecture V: The game-engine loop & Time Integration Lecture V: The game-engine loop & Time Integration The Basic Game-Engine Loop Previous state: " #, %(#) ( #, )(#) Forces -(#) Integrate velocities and positions Resolve Interpenetrations Per-body change

More information

Finite Difference Methods for Boundary Value Problems

Finite Difference Methods for Boundary Value Problems Finite Difference Methods for Boundary Value Problems October 2, 2013 () Finite Differences October 2, 2013 1 / 52 Goals Learn steps to approximate BVPs using the Finite Difference Method Start with two-point

More information