FORTRAN 77 Lesson 7. Reese Haywood Ayan Paul

Size: px
Start display at page:

Download "FORTRAN 77 Lesson 7. Reese Haywood Ayan Paul"

Transcription

1 FORTRAN 77 Lesson 7 Reese Haywood Ayan Paul 1 Numerical Integration A general all purpose Numerical Integration technique is the Trapezoidal Method. For most functions, this method is fast and accurate. Other functions, may require more sofisticated methods, which can be found in Numerical Recipes, but we will stick to simple funcitons in this class. 1.1 Trapezoidal Rule If we are given the function that represents the curve, we can evaluate the function at points spaced along the interval of interest. If we join the points onthecurve withstraight linesegments, weformagroupoftrapezoidswhose combined areas approximate the are under the curve. The closer the points are together on the curve the more trapezoids there are in the interval, and thus the more accurate will be our approximation to the integral. Recall that the area of a trapezoid is equal to one-half the base times the sum of the two heights (or sides): area = 1 base(height1 +height2). Thus, 2 the area of the trapezoid is computed using the pair of points (x 1,y 1 ) and (x 2,y 2 ): A = 1(x 2 2 x 1 )(y 1 +y 2 ). If all of our points are equally spaced, then (x 2 x 1 ) is a constant, and if there are N trapezoids that represent the curve then the integral can be approximated by: base N 2 (y 1 +2 y k +y N+1 ) (1) k=2 When computing an integral with this technique, we need to remember that the data points on the curve could come from different sources. If we have the equation of the curve, we can choose the data points to be close 1

2 together or far apart. Another possibility is that the points are experimentally collected; in this case, we have discrete x and y values, and we cannot change the size of the base, it is fixed by x, but this does not keep us from using the trapezoid rule. 1.2 Simpson s Rule The Simpson s Rule (or Simpson s 1 Rule) makes the assumption that the 3 function can be approximated by a series of overlapping second order curves. Thus we always need even number of intervals to do an integral by this method. The detailed derivation of this method can be found in any book on Numerical Integration or Statistics. The formula for the integration is xn+1 y(x) = h x 1 3 [y 1 +4(y 2 +y )+2(y 3 +y )+y N+1 ] (2) with N odd. The Simpson s Rule is more accurate as it uses second order approximation as compared to the first order approximation used by the Trapezoidal Rule and thus uses more computing time and resources. For most problems the Trapezoidal Rule will be good enough, however, you might sometime have to appeal to the Simpson s Rule for more complicated integrals. 2 Solving Ordinary Differential Equations Before we can write a Fortran program to solve an Ordinary Differential Equation (ODE) we must learn a little about solving ODE s by hand. For this section I will quote from Introduction to Ordinary Differential Equations with Mathematica by Gray, Mezzino and Pinsky. Also, I will quote from Numerical Recipes, which we used last time. Second order ODE s can always be reduced to the study of sets of firstorder differential equations. For exmple d 2 y +q(x)dy = r(x) 2 (3) can be rewritten as two first-order equations dy = z(x) (4) dz = r(x) q(x)z(x) (5) 2

3 where z is a new variable. The generic problem in ordinary differential equations is thus reduced to the study of a set of N coupled first-order differential equations for the functions y i,i = 1,2,3,...,N, Having the general form dy i (x) = f i (x,y 1,...,y N ),i = 1,...,N (6) where the functions f i on the right-hand side are known. Most differential equations do not have exact solutions. Even if a differential equation has an exact solution, the solution may be so complicated that it is useless for practical purposes. On the other hand, we can try to find an approximation to the solution of a differential equation with an initial condition. For example, suppose we are given a first-order initial value problem y = f(t,y) (7) y(a) = Y 0 (8) onanintervala t b. Althoughwemaynotbeabletoobtainaformulafor the solution of eqn. s 5 and 6, we can subdivide the interval as a = t 0 < t 1 <... < t N = b and try to assign approximate values y(t n ) to t n for n = 1,...,N. Instead of a formula we will have an approximation to the solution expressed as a table of the y(t n ) s in terms of the t n s. By graphing the table we can visualize the solution. 2.1 The Euler Method The Euler method was the first method used to find numerical solutions to differential equaitons. In spite of the fact that it is rarely used in practice, we need to study it because it serves as a model for more complicated methods such as the Rung-Kutta method, an all purpose method we will write our program with. Suppose we want to construct a solution to equation (5) above. If we know the solution exactly, and that it is twice differentiable, we can write the Taylor expansion as y(t 1 ) = y(t 0 )+(t 1 t 0 )y (t 0 )+ (t 1 t 0 ) 2 y (t 0 ) (9) 2 3

4 Letting h = t 1 t 0 we can rewrite (7) as y(t 1 ) = y(t 0 )+hf(t 0,Y 0 )+ h2 2 y (t 0 ) (10) where we have just substituted equation (5) evaluated at (t 0,y 0 ) for y (t 0 ) and also substituted h for (t 1 t 0 ). With h small this becomes simply and, since y(t 0 ) = Y 0 we can define y(t 1 ) y(t 0 )+hf(t 0,Y 0 ) (11) Y 1 = Y 0 +hf(t 0,Y 0 ) (12) Then Y 1 is an approximation to y(t 1 ). More generally, we define Y n+1 = Y n +hf(t n,y n ) (13) for 0 n N 1. The Euler method, or tangent method, consists in approximating the solution to (5) by means of (11), which we call the Euler method formula. 2.2 The Runge-Kutta Method The Runge-Kutta method is an improvement of the Euler method, and is derived in much the same way. However, the Taylor series is truncated in the 5 th power of (t 1 t 0 ), so the order of the method is fourth-order, and errors are introduced on the order of h 5. A derivation of the Runge-Kutta method is in most Numerical Analysis book. I will only give the results of the derivation here. The general form of the Runge-Kutta method is where Y n+1 = Y n + h 6 (a 1,n +2a 2,n +2a 3,n +a 4,n ), (14) a 1,n = f(t n,y n ) a 2,n = f(t n + h 2,Y n + h 2 a 1,n) a 3,n = f(t n + h 2,Y n + h 2 a 2,n) a 4,n = f(t n +h,y n +h a 3,n ) (15) 4

5 2.3 Coding the Equations Whether we are going to code the Euler or Runge-Kutta method we need to stop and think about what needs to happen throughout the code. We should ask ourselves the following kinds of questions, do we only want to write the answers y(t n ) at each t n to a file to view them graphically later? Do we need an array that holds the values of the function at each t n so that we can use it in another program, or as a comparision to what we think the answer should be? Once you have decided on all of the factors, you can successfully write your differential equation solver. Be warned though, it will not be easy to make a very general program, most will be specific to the problem at hand. 3 Your next task 1. Write a program to use the trapezoid method and integrate the following function: 0 (1 exp( τ 0e x2 )). You should first write you trapezoid function or subroutine and check it with an easy function, i.e. x 2 from 0,1. Then modify the function to be the function given above andcheck toseeifyougetthefollowinganswers, forτ 0 = 1,2,10,10000, your answer for the integral should be: INT = , , , Write a program that will solve the following differential equations: you should start by writing a mini-program that contains all of the elements of the solver, then you can copy and paste the main components into each program. Consider the problem dy = t+y, y(0) = 1. (16) use the Runge-Kutta method, with h = 0.1 to find a solution from t = 0,1. Compare the results you get with the actual solution, given in tabular form below. 5

6 t y = 2e t 1 t Writing the the acceleration of a mass under the influence of Hooke s Law we get the following second order differential equation. x +ω 2 x = 0 (17) where ω 2 = k. We already know the answer, upto normalization constants and phase angles. The general solution m is x = C 1 cosωt+c 2 sinωt (18) The initial conditions determine which function cos or sin gives the final answer. We will let ω = 1. Then we have the equation d ( x +x = 0 ) +x = 0 (19) Here I have rewitten the equation to show the dependence on t. To use the Euler or Runge-Kutta method, we need to make this second order equation into a first order equation. So, let s define y = /. Then we get the new set of equations, dy = ωx = y (20) Now we have a set of two coupled first order differential equations, which we can solve using the Runge-Kutta method. You should be able to modify the program you wrote to solve number (1) to solve this problem. Use h = 0.1,0.01 with y(0) = 1, x(0) = 0 over the range t = 0,2π, and compare the answer you get to (sint) evaluated at each t. 6

7 I have included my programs in my website, named rungtest.f and rung.f, that solve problems (1) and (2) respectively, along with the data files that were output by the programs, rungtest.dat and rung.dat, respectively. Feel free to look at them and get ideas on how to write your programs. 7

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

Physics 584 Computational Methods

Physics 584 Computational Methods Physics 584 Computational Methods Introduction to Matlab and Numerical Solutions to Ordinary Differential Equations Ryan Ogliore April 18 th, 2016 Lecture Outline Introduction to Matlab Numerical Solutions

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

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

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

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

Variable Step Size Differential Equation Solvers

Variable Step Size Differential Equation Solvers Math55: Differential Equations 1/30 Variable Step Size Differential Equation Solvers Jason Brewer and George Little Introduction The purpose of developing numerical methods is to approximate the solution

More information

Ph 22.1 Return of the ODEs: higher-order methods

Ph 22.1 Return of the ODEs: higher-order methods Ph 22.1 Return of the ODEs: higher-order methods -v20130111- Introduction This week we are going to build on the experience that you gathered in the Ph20, and program more advanced (and accurate!) solvers

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

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

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

Math 128A Spring 2003 Week 12 Solutions

Math 128A Spring 2003 Week 12 Solutions Math 128A Spring 2003 Week 12 Solutions Burden & Faires 5.9: 1b, 2b, 3, 5, 6, 7 Burden & Faires 5.10: 4, 5, 8 Burden & Faires 5.11: 1c, 2, 5, 6, 8 Burden & Faires 5.9. Higher-Order Equations and Systems

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

Numerical methods for solving ODEs

Numerical methods for solving ODEs Chapter 2 Numerical methods for solving ODEs We will study two methods for finding approximate solutions of ODEs. Such methods may be used for (at least) two reasons the ODE does not have an exact solution

More information

Higher Order Taylor Methods

Higher Order Taylor Methods Higher Order Taylor Methods Marcelo Julio Alvisio & Lisa Marie Danz May 6, 2007 Introduction Differential equations are one of the building blocks in science or engineering. Scientists aim to obtain numerical

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

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

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers Chapter 9b: Numerical Methods for Calculus and Differential Equations Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers Acceleration Initial-Value Problems Consider a skydiver

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

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

2.1 NUMERICAL SOLUTION OF SIMULTANEOUS FIRST ORDER ORDINARY DIFFERENTIAL EQUATIONS. differential equations with the initial values y(x 0. ; l.

2.1 NUMERICAL SOLUTION OF SIMULTANEOUS FIRST ORDER ORDINARY DIFFERENTIAL EQUATIONS. differential equations with the initial values y(x 0. ; l. Numerical Methods II UNIT.1 NUMERICAL SOLUTION OF SIMULTANEOUS FIRST ORDER ORDINARY DIFFERENTIAL EQUATIONS.1.1 Runge-Kutta Method of Fourth Order 1. Let = f x,y,z, = gx,y,z be the simultaneous first order

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

Ordinary Differential Equations (ODEs)

Ordinary Differential Equations (ODEs) Ordinary Differential Equations (ODEs) 1 Computer Simulations Why is computation becoming so important in physics? One reason is that most of our analytical tools such as differential calculus are best

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

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for solving higher order ODEs and

More information

DIFFERENTIAL EQUATIONS

DIFFERENTIAL EQUATIONS DIFFERENTIAL EQUATIONS Chapter 1 Introduction and Basic Terminology Most of the phenomena studied in the sciences and engineering involve processes that change with time. For example, it is well known

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

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations Reading: Numerical Recipes, chapter on Integration of Ordinary Differential Equations (which is ch. 15, 16, or 17 depending on

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

Math 308 Week 8 Solutions

Math 308 Week 8 Solutions Math 38 Week 8 Solutions There is a solution manual to Chapter 4 online: www.pearsoncustom.com/tamu math/. This online solutions manual contains solutions to some of the suggested problems. Here are solutions

More information

The Princeton Review AP Calculus BC Practice Test 2

The Princeton Review AP Calculus BC Practice Test 2 0 The Princeton Review AP Calculus BC Practice Test CALCULUS BC SECTION I, Part A Time 55 Minutes Number of questions 8 A CALCULATOR MAY NOT BE USED ON THIS PART OF THE EXAMINATION Directions: Solve each

More information

Comparison of Numerical Ordinary Differential Equation Solvers

Comparison of Numerical Ordinary Differential Equation Solvers Adrienne Criss Due: October, 008 Comparison of Numerical Ordinary Differential Equation Solvers Many interesting physical systems can be modeled by ordinary differential equations (ODEs). Since it is always

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

Runge-Kutta methods. With orders of Taylor methods yet without derivatives of f (t, y(t))

Runge-Kutta methods. With orders of Taylor methods yet without derivatives of f (t, y(t)) Runge-Kutta metods Wit orders of Taylor metods yet witout derivatives of f (t, y(t)) First order Taylor expansion in two variables Teorem: Suppose tat f (t, y) and all its partial derivatives are continuous

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

Ordinary differential equations - Initial value problems

Ordinary differential equations - Initial value problems Education has produced a vast population able to read but unable to distinguish what is worth reading. G.M. TREVELYAN Chapter 6 Ordinary differential equations - Initial value problems In this chapter

More information

Taylor series. Chapter Introduction From geometric series to Taylor polynomials

Taylor series. Chapter Introduction From geometric series to Taylor polynomials Chapter 2 Taylor series 2. Introduction The topic of this chapter is find approximations of functions in terms of power series, also called Taylor series. Such series can be described informally as infinite

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 75 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP. Use MATLAB solvers for solving higher order ODEs and systems

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

Calculus for the Life Sciences

Calculus for the Life Sciences Improved Calculus for the Life Sciences ntial Equations Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center

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

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise:

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise: Math 2250-004 Week 4 notes We will not necessarily finish the material from a given day's notes on that day. We may also add or subtract some material as the week progresses, but these notes represent

More information

DIFFERENTIAL EQUATIONS

DIFFERENTIAL EQUATIONS DIFFERENTIAL EQUATIONS Basic Concepts Paul Dawkins Table of Contents Preface... Basic Concepts... 1 Introduction... 1 Definitions... Direction Fields... 8 Final Thoughts...19 007 Paul Dawkins i http://tutorial.math.lamar.edu/terms.aspx

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

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MATLAB sessions: Laboratory 4 MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for

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

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

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

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

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

Initial Value Problems

Initial Value Problems Numerical Analysis, lecture 13: Initial Value Problems (textbook sections 10.1-4, 10.7) differential equations standard form existence & uniqueness y 0 y 2 solution methods x 0 x 1 h h x 2 y1 Euler, Heun,

More information

Infinite series, improper integrals, and Taylor series

Infinite series, improper integrals, and Taylor series Chapter 2 Infinite series, improper integrals, and Taylor series 2. Introduction to series In studying calculus, we have explored a variety of functions. Among the most basic are polynomials, i.e. functions

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

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

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

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 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations Lecture 8: Calculus and Differential Equations Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 9. Numerical Methods MATLAB provides

More information

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations Lecture 8: Calculus and Differential Equations Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE21: Computer Applications. See Textbook Chapter 9. Numerical Methods MATLAB provides

More information

Virtual University of Pakistan

Virtual University of Pakistan Virtual University of Pakistan File Version v.0.0 Prepared For: Final Term Note: Use Table Of Content to view the Topics, In PDF(Portable Document Format) format, you can check Bookmarks menu Disclaimer:

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

Numerical Integration of Ordinary Differential Equations for Initial Value Problems

Numerical Integration of Ordinary Differential Equations for Initial Value Problems Numerical Integration of Ordinary Differential Equations for Initial Value Problems Gerald Recktenwald Portland State University Department of Mechanical Engineering gerry@me.pdx.edu These slides are a

More information

Solution of ordinary Differential Equations

Solution of ordinary Differential Equations 42 Chapter 4 Solution of ordinary Differential Equations Highly suggested Reading Press et al., 1992. Numerical Recipes, 2nd Edition. Chapter 16. (Good description). See also chapter 17. And Matlab help

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 42 Determining Internal Node Values

Lecture 42 Determining Internal Node Values Lecture 42 Determining Internal Node Values As seen in the previous section, a finite element solution of a boundary value problem boils down to finding the best values of the constants {C j } n, which

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

Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 2017, Professor David Levermore

Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 2017, Professor David Levermore Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 207, Professor David Levermore () (a) Give the integral being evaluated by the following Matlab command. int( x/(+xˆ4), x,0,inf)

More information

A First Course on Kinetics and Reaction Engineering Supplemental Unit S5. Solving Initial Value Differential Equations

A First Course on Kinetics and Reaction Engineering Supplemental Unit S5. Solving Initial Value Differential Equations Supplemental Unit S5. Solving Initial Value Differential Equations Defining the Problem This supplemental unit describes how to solve a set of initial value ordinary differential equations (ODEs) numerically.

More information

Numerical Methods - Boundary Value Problems for ODEs

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

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

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

+ h4. + h5. 6! f (5) i. (C.3) Since., it yields

+ h4. + h5. 6! f (5) i. (C.3) Since., it yields Appendix C. Derivation of the Numerical Integration Formulae C.1. Derivation of the Numerical Integration of dy(x) / dx = f (x) For a given analytical or taulated function f (x), the left column in Tale

More information

Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras

Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras Computational Techniques Prof. Dr. Niket Kaisare Department of Chemical Engineering Indian Institute of Technology, Madras Module No. # 07 Lecture No. # 04 Ordinary Differential Equations (Initial Value

More information

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2. Chapter 5 Exercises From: Finite Difference Methods for Ordinary and Partial Differential Equations by R. J. LeVeque, SIAM, 2007. http://www.amath.washington.edu/ rjl/fdmbook Exercise 5. (Uniqueness for

More information

Outline Calculus for the Life Sciences II. Pollution in a Lake 1. Introduction. Lecture Notes Numerical Methods for Differential Equations

Outline Calculus for the Life Sciences II. Pollution in a Lake 1. Introduction. Lecture Notes Numerical Methods for Differential Equations Improved Improved Outline Calculus for the Life Sciences II tial Equations Joseph M. Mahaffy, mahaffy@math.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences

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

Numerical Methods in Physics and Astrophysics

Numerical Methods in Physics and Astrophysics Kostas Kokkotas 2 October 17, 2017 2 http://www.tat.physik.uni-tuebingen.de/ kokkotas Kostas Kokkotas 3 TOPICS 1. Solving nonlinear equations 2. Solving linear systems of equations 3. Interpolation, approximation

More information

FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS II: Graphical and Numerical Methods David Levermore Department of Mathematics University of Maryland

FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS II: Graphical and Numerical Methods David Levermore Department of Mathematics University of Maryland FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS II: Graphical and Numerical Methods David Levermore Department of Mathematics University of Maryland 9 January 0 Because the presentation of this material in

More information

Euler s Method, Taylor Series Method, Runge Kutta Methods, Multi-Step Methods and Stability.

Euler s Method, Taylor Series Method, Runge Kutta Methods, Multi-Step Methods and Stability. Euler s Method, Taylor Series Method, Runge Kutta Methods, Multi-Step Methods and Stability. REVIEW: We start with the differential equation dy(t) dt = f (t, y(t)) (1.1) y(0) = y 0 This equation can be

More information

Solution. Your sketch should show both x and y axes marked from 5 to 5 and circles of radius 1, 3, and 5 centered at the origin.

Solution. Your sketch should show both x and y axes marked from 5 to 5 and circles of radius 1, 3, and 5 centered at the origin. Solutions of the Sample Problems for the First In-Class Exam Math 246, Fall 208, Professor David Levermore () (a) Sketch the graph that would be produced by the following Matlab command. fplot(@(t) 2/t,

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

1.4 Techniques of Integration

1.4 Techniques of Integration .4 Techniques of Integration Recall the following strategy for evaluating definite integrals, which arose from the Fundamental Theorem of Calculus (see Section.3). To calculate b a f(x) dx. Find a function

More information

Math 216 Final Exam 14 December, 2012

Math 216 Final Exam 14 December, 2012 Math 216 Final Exam 14 December, 2012 This sample exam is provided to serve as one component of your studying for this exam in this course. Please note that it is not guaranteed to cover the material that

More information

MATH 100 Introduction to the Profession

MATH 100 Introduction to the Profession MATH 100 Introduction to the Profession Differential Equations in MATLAB Greg Fasshauer Department of Applied Mathematics Illinois Institute of Technology Fall 2012 fasshauer@iit.edu MATH 100 ITP 1 What

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

Ordinary Differential Equations II: Runge-Kutta and Advanced Methods

Ordinary Differential Equations II: Runge-Kutta and Advanced Methods Ordinary Differential Equations II: Runge-Kutta and Advanced Methods Sam Sinayoko Numerical Methods 3 Contents 1 Learning Outcomes 2 2 Introduction 2 2.1 Note................................ 4 2.2 Limitations

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK KINGS COLLEGE OF ENGINEERING MA5-NUMERICAL METHODS DEPARTMENT OF MATHEMATICS ACADEMIC YEAR 00-0 / EVEN SEMESTER QUESTION BANK SUBJECT NAME: NUMERICAL METHODS YEAR/SEM: II / IV UNIT - I SOLUTION OF EQUATIONS

More information

F = ma, F R + F S = mx.

F = ma, F R + F S = mx. Mechanical Vibrations As we mentioned in Section 3.1, linear equations with constant coefficients come up in many applications; in this section, we will specifically study spring and shock absorber systems

More information

(A) Opening Problem Newton s Law of Cooling

(A) Opening Problem Newton s Law of Cooling Lesson 55 Numerical Solutions to Differential Equations Euler's Method IBHL - 1 (A) Opening Problem Newton s Law of Cooling! Newton s Law of Cooling states that the temperature of a body changes at a rate

More information

Diff. Eq. App.( ) Midterm 1 Solutions

Diff. Eq. App.( ) Midterm 1 Solutions Diff. Eq. App.(110.302) Midterm 1 Solutions Johns Hopkins University February 28, 2011 Problem 1.[3 15 = 45 points] Solve the following differential equations. (Hint: Identify the types of the equations

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

Numerical and Statistical Methods

Numerical and Statistical Methods F.Y. B.Sc.(IT) : Sem. II Numerical and Statistical Methods Time : ½ Hrs.] Prelim Question Paper Solution [Marks : 75 Q. Attempt any THREE of the following : [5] Q.(a) What is a mathematical model? With

More information

Day 2 Notes: Riemann Sums In calculus, the result of f ( x)

Day 2 Notes: Riemann Sums In calculus, the result of f ( x) AP Calculus Unit 6 Basic Integration & Applications Day 2 Notes: Riemann Sums In calculus, the result of f ( x) dx is a function that represents the anti-derivative of the function f(x). This is also sometimes

More information

dt 2 The Order of a differential equation is the order of the highest derivative that occurs in the equation. Example The differential equation

dt 2 The Order of a differential equation is the order of the highest derivative that occurs in the equation. Example The differential equation Lecture 18 : Direction Fields and Euler s Method A Differential Equation is an equation relating an unknown function and one or more of its derivatives. Examples Population growth : dp dp = kp, or = kp

More information

THE UNIVERSITY OF NEW SOUTH WALES SCHOOL OF PHYSICS PHYS2020 COMPUTATIONAL PHYSICS FINAL EXAM SESSION I Answer all questions

THE UNIVERSITY OF NEW SOUTH WALES SCHOOL OF PHYSICS PHYS2020 COMPUTATIONAL PHYSICS FINAL EXAM SESSION I Answer all questions THE UNIVERSITY OF NEW SOUTH WALES SCHOOL OF PHYSICS PHYS2020 COMPUTATIONAL PHYSICS FINAL EXAM SESSION I 2007 Answer all questions Time allowed =2 hours Total number of questions =5 Marks =40 The questions

More information

Section 5.2 Series Solution Near Ordinary Point

Section 5.2 Series Solution Near Ordinary Point DE Section 5.2 Series Solution Near Ordinary Point Page 1 of 5 Section 5.2 Series Solution Near Ordinary Point We are interested in second order homogeneous linear differential equations with variable

More information

Numerical and Statistical Methods

Numerical and Statistical Methods F.Y. B.Sc.(IT) : Sem. II Numerical and Statistical Methods Time : ½ Hrs.] Prelim Question Paper Solution [Marks : 75 Q. Attempt any THREE of the following : [5] Q.(a) What is a mathematical model? With

More information

MA 102 Mathematics II Lecture Feb, 2015

MA 102 Mathematics II Lecture Feb, 2015 MA 102 Mathematics II Lecture 1 20 Feb, 2015 Differential Equations An equation containing derivatives is called a differential equation. The origin of differential equations Many of the laws of nature

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

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester HIGHER ORDER METHODS School of Mathematics Semester 1 2008 OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY OUTLINE

More information