Physics 299: Computational Physics II Project II

Size: px
Start display at page:

Download "Physics 299: Computational Physics II Project II"

Transcription

1 Physics 99: Computational Physics II Project II Due: Feb 01 Handed out: 6 Jan 01 This project begins with a description of the Runge-Kutta numerical integration method, and then describes a project to implement it in our simple harmonic oscillator class. Introduction and Background We ve already discussed the Euler and the Euler-Cromer methods; although they might be your first recourse for numerically integrating Newton s laws (or some other differential equation) we already know that you have to be careful Euler s method, for instance, does not conserve energy in a simple harmonic oscillator, whereas the Euler- Cromer method does (at least over the span of one complete oscillation). The Euler and Euler-Cromer methods are first order methods meaning that the truncation error is proportional to the time step, t. 1 We can do better than this by applying higher order methods 1 Described by Carl Runge and Martin Kutta around the workhorse method is the 4th order Runge-Kutta method. Rather than jump into the description of this method, we ll get there gently, by discussing the Euler method, then the nd order Runge-Kutta method, and finally, the full-blown 4th order technique. Basic Idea Consider a first order differential equation of the form = f (x, t) so that = f (x, t), and therefore the Euler method would tell us that x n+1 = x n + f (x n, t n ) t. The picture that goes along with this method is shown in Figure 1. Notice that in the arbitrary case chosen that the estimated shift x is greater than the actual increase in x(t). Of course, in some cases, the shift might be less, but the basic idea is that if t is sufficiently small, we can use the Euler method to estimate the change in x(t) to very high accuracy. But, for any finite interval of time T, the total error will be proportional to the size of the time step, t. So, how can we improve our estimate? Notice that the Euler method relies solely on the information from the beginning of the interval. Clearly, if we evaluate the slope at other points in the interval, we can get a better estimate. The Runge-Kutta methods do just that. Figure 1: The Euler method estimates x n+1 by using the position and the slope at the beginning of the interval. Notice that in this example, the Euler method overestimates the value of the function a the end of the interval because of the high slope at the beginning of the interval.

2 physics 99: computational physics ii project ii Second Order Runge-Kutta The second order Runge-Kutta method uses the Euler method to extrapolate to the estimated position at the middle of the time interval (i.e. at t = t n + t/) and then calculates the slope at this estimated point. This slope is then used to make a refined estimate of the total change in x. Here s the scheme in algebraic terms: and then k 1 f (x n, t n ) t ( Euler method ), k f (x n + k 1, t n + t ) t ( x via midpoint method ), finally, we estimate x n+1 via x n+1 = x n + k + O[( t) 3 ] The picture illustrating this method may be seen in Figure. In this figure, we see that Euler method is used to estimate the midpoint value of the function; it does so by using the slope at the beginning of the interval. Then we use the slope at this estimated midpoint to then form a better estimate of the change of the funtion over the time step t. Clearly, as Figure illustrates, the second order Runge- Kutta method is a much better approximation to the final value of the function at the end of the interval. In the final analysis, this method approximates the ending value of the function by performing two slope evaluations; one at the beginning of the interval, and one at the estimated midpoint. Figure : The nd order Runge-Kutta method estimates x n+1 by using the slope at the midpoint (as estimated by the Euler method) of the interval rather than at the beginning of the interval. Notice that k = f (x n + k 1 /, t n + t/) t, and the second order estimate is clearly much closer to the actual final value of the function at the end of the interval. A numerical example A numerical example will help illustrate the improvement the nd order Runge-Kutta method gives over the Euler method. Suppose we have the differential equation = x; where x(t = 0) = 1.0. It is a simple matter so show that the exact solution to this differential equation is x(t) = e t, and we ll calculate in detail how to estimate x(t = 0.4), both by the Euler method, and the nd order Runge-Kutta method. Euler method The Euler method tells us that x n+1 = x n + f (x n, t n ) t,

3 physics 99: computational physics ii project ii 3 so we start with x(0) = 1.0 and then calculate successive values of x by noting that f (x, t) = x, and with t = 0.1, we find x(0.1) = ( 1.0)0.1 = 0.9 x(0.) = ( 0.9)0.1 = 0.81 x(0.3) = ( 0.81)0.1 = 0.79 x(0.4) = ( 0.79)0.1 = and, since the exact value is e 0.4 = , we see that the Euler method (with time step 0.1) gives a.1% error. nd order Runge-Kutta Since the nd order Runge-Kutta method makes twice as many evaluations of the derivative in the interval, we will increase our time step by a factor of to make a more fair comparison; this way we perform about the same number of computational steps to traverse the interval, and we ll see if we still improve our estimate. So, we use t = 0. and then calculate carry through the nd order calcuations; recall that the second order Runga-Kutta steps are k 1 f (x n, t n ) t and k f (x n + k 1 t n + t ) t where in our case, f (x, t) = x, so that we have for the first time step: k 1 = f (x 0, t 0 ) 0. = 0. and for the second time step: k = f ( ) 0. = 0.18 x(0.) = x(0) + k = 0.8 Notice that in this example, the derivative, f (x, t), has no time dependence. Thus, in the calculation of k 1, we merely have f (x 0, t 0 ) = f (1, 0) = 1. k 1 = (0.8) 0. = k = f ( ) 0. = x(0.) = x(0.) + k = and, recalling that the exact answer is , we see that the nd order method (with time step 0.) gives a 0.3% error, almost 10 times smaller than the Euler method! 4th order Runge-Rutta This is the real deal; it s the workhorse numerical integration technique. It s a forth order method, so that when integrating over a finite

4 physics 99: computational physics ii project ii 4 time T, the truncation error is of order ( t) 4. The 4th order Runge- Kutta method evaluates the derivative at the beginning of the interval, at two different points in the middle of the interval, and once at the end of the interval. It weights the two middle estimates more heavily than the endpoints. Here s the method: and then, k 1 = f (x n, t n ) t (slope at beginning) k = f (x n + k 1, t n + t ) t (same as nd order) k 3 = f (x n + k, t n + t ) t (slope at middle) k 4 = f (x n + k 3, t n + t) t (slope at end) x n+1 = x n (k 1 + k + k 3 + k 4 ) + O[( t) 5 ] 4th Order Runge-Kutta & Newton s Law More often than not, we have to integrate a second order equation such as d x = 1 F(x, v, t) = a(x, v, t); m to accomplish this, we use the standard trick of breaking this up into two first order equations: = v(t) and dv = a(x, v, t). Now we have the following scheme for implementing 4th order Runge- Kutta: k 1v = a(x n, v n, t n ) t k 1x = v n t k v = a(x n + k 1x, v n + k 1v, t n + t ( ) ) t k x = v n + k 1v t k 3v = a(x n + k x, v n + k v, t n + t ( ) ) t k 3x = v n + k v t and finally: k 4v = a(x n + k 3x, v n + k 3v, t n + t) t k 4x = (v n + k 3v ) t v n+1 = v n (k 1v + k v + k 3v + k 4v ) x n+1 = x n (k 1x + k x + k 3x + k 4x )

5 physics 99: computational physics ii project ii 5 Project For this project, take your code from Project 1, and add the ability to numerically integrate using the second order Runge-Kutta method or the 4th order method. Then, I d like you to 1. Compare the accuracy of the Euler-Cromer method, nd order Runge- Kutta, and 4th order Runge-Kutta method; typeset a nice table in LATEX that shows numerically the solutions given by the methods. For instance, you might want to let the oscillator make 1,000,000 oscillations and see if it returns to it s starting point. How does the accuracy depend on the time step for the different methods? How much bigger can your time step be in 4th order Runge-Kutta be and achieve the same accuracy as the Euler-Cromer method?. Make a nice plot (or likely several) that illustrate the accuracy of the methods. 3. Write this all up in a nice LATEX document; I wrote this using the Tufte-LaTeX handout class (google it).

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

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

Runga-Kutta Schemes. Exact evolution over a small time step: Expand both sides in a small time increment: d(δt) F (x(t + δt),t+ δt) Ft + FF x ( t)

Runga-Kutta Schemes. Exact evolution over a small time step: Expand both sides in a small time increment: d(δt) F (x(t + δt),t+ δt) Ft + FF x ( t) Runga-Kutta Schemes Exact evolution over a small time step: x(t + t) =x(t)+ t 0 d(δt) F (x(t + δt),t+ δt) Expand both sides in a small time increment: x(t + t) =x(t)+x (t) t + 1 2 x (t)( t) 2 + 1 6 x (t)+

More information

4.9 Anti-derivatives. Definition. An anti-derivative of a function f is a function F such that F (x) = f (x) for all x.

4.9 Anti-derivatives. Definition. An anti-derivative of a function f is a function F such that F (x) = f (x) for all x. 4.9 Anti-derivatives Anti-differentiation is exactly what it sounds like: the opposite of differentiation. That is, given a function f, can we find a function F whose derivative is f. Definition. An anti-derivative

More information

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion Peter Young (Dated: April 14, 2009) I. INTRODUCTION One frequently obtains detailed dynamical

More information

Predicting the future with Newton s Second Law

Predicting the future with Newton s Second Law Predicting the future with Newton s Second Law To represent the motion of an object (ignoring rotations for now), we need three functions x(t), y(t), and z(t), which describe the spatial coordinates of

More information

Computational Physics (6810): Session 8

Computational Physics (6810): Session 8 Computational Physics (6810): Session 8 Dick Furnstahl Nuclear Theory Group OSU Physics Department February 24, 2014 Differential equation solving Session 7 Preview Session 8 Stuff Solving differential

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

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

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

Summary of Derivative Tests

Summary of Derivative Tests Summary of Derivative Tests Note that for all the tests given below it is assumed that the function f is continuous. Critical Numbers Definition. A critical number of a function f is a number c in the

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

δ Substituting into the differential equation gives: x i+1 x i δ f(t i,x i ) (3)

δ Substituting into the differential equation gives: x i+1 x i δ f(t i,x i ) (3) Solving Differential Equations Numerically Differential equations are ubiquitous in Physics since the laws of nature often take on a simple form when expressed in terms of infinitesimal changes of the

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

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion Peter Young (Dated: April 17, 23) I. INTRODUCTION One frequently obtains detailed dynamical information

More information

Linear Algebra, Summer 2011, pt. 2

Linear Algebra, Summer 2011, pt. 2 Linear Algebra, Summer 2, pt. 2 June 8, 2 Contents Inverses. 2 Vector Spaces. 3 2. Examples of vector spaces..................... 3 2.2 The column space......................... 6 2.3 The null space...........................

More information

Lecture 10: Powers of Matrices, Difference Equations

Lecture 10: Powers of Matrices, Difference Equations Lecture 10: Powers of Matrices, Difference Equations Difference Equations A difference equation, also sometimes called a recurrence equation is an equation that defines a sequence recursively, i.e. each

More information

TP 3:Runge-Kutta Methods-Solar System-The Method of Least Squares

TP 3:Runge-Kutta Methods-Solar System-The Method of Least Squares TP :Runge-Kutta Methods-Solar System-The Method of Least Squares December 8, 2009 1 Runge-Kutta Method The problem is still trying to solve the first order differential equation dy = f(y, x). (1) dx In

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

Math 1270 Honors ODE I Fall, 2008 Class notes # 14. x 0 = F (x; y) y 0 = G (x; y) u 0 = au + bv = cu + dv

Math 1270 Honors ODE I Fall, 2008 Class notes # 14. x 0 = F (x; y) y 0 = G (x; y) u 0 = au + bv = cu + dv Math 1270 Honors ODE I Fall, 2008 Class notes # 1 We have learned how to study nonlinear systems x 0 = F (x; y) y 0 = G (x; y) (1) by linearizing around equilibrium points. If (x 0 ; y 0 ) is an equilibrium

More information

Physics 200 Lecture 4. Integration. Lecture 4. Physics 200 Laboratory

Physics 200 Lecture 4. Integration. Lecture 4. Physics 200 Laboratory Physics 2 Lecture 4 Integration Lecture 4 Physics 2 Laboratory Monday, February 21st, 211 Integration is the flip-side of differentiation in fact, it is often possible to write a differential equation

More information

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2.

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2. Midterm 1 Review Comments about the midterm The midterm will consist of five questions and will test on material from the first seven lectures the material given below. No calculus either single variable

More information

Computers, Lies and the Fishing Season

Computers, Lies and the Fishing Season 1/47 Computers, Lies and the Fishing Season Liz Arnold May 21, 23 Introduction Computers, lies and the fishing season takes a look at computer software programs. As mathematicians, we depend on computers

More information

Integration of Differential Equations

Integration of Differential Equations Integration of Differential Equations Gabriel S. Cabrera August 4, 018 Contents 1 Introduction 1 Theory.1 Linear 1 st Order ODEs................................. 3.1.1 Analytical Solution...............................

More information

Coupled differential equations

Coupled differential equations Coupled differential equations Example: dy 1 dy 11 1 1 1 1 1 a y a y b x a y a y b x Consider the case with b1 b d y1 a11 a1 y1 y a1 ay dy y y e y 4/1/18 One way to address this sort of problem, is to

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

4.2: What Derivatives Tell Us

4.2: What Derivatives Tell Us 4.2: What Derivatives Tell Us Problem Fill in the following blanks with the correct choice of the words from this list: Increasing, decreasing, positive, negative, concave up, concave down (a) If you know

More information

Ordinary Differential Equations. Monday, October 10, 11

Ordinary Differential Equations. Monday, October 10, 11 Ordinary Differential Equations Monday, October 10, 11 Problems involving ODEs can always be reduced to a set of first order differential equations. For example, By introducing a new variable z, this can

More information

Sequences and infinite series

Sequences and infinite series Sequences and infinite series D. DeTurck University of Pennsylvania March 29, 208 D. DeTurck Math 04 002 208A: Sequence and series / 54 Sequences The lists of numbers you generate using a numerical method

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

Using the Derivative. Chapter Local Max and Mins. Definition. Let x = c be in the domain of f(x).

Using the Derivative. Chapter Local Max and Mins. Definition. Let x = c be in the domain of f(x). Chapter 4 Using the Derivative 4.1 Local Max and Mins Definition. Let x = c be in the domain of f(x). x = c is a local maximum if f(x) apple f(c) for all x near c x = c is a local minimum if f(x) (we allow

More information

AM 205 Final Project The N-Body Problem

AM 205 Final Project The N-Body Problem AM 205 Final Project The N-Body Problem Leah Birch Elizabeth Finn Karen Yu December 14, 2012 Abstract The N-Body Problem can be solved using a variety of numeric integrators. Newton s Law of Universal

More information

Distance and Velocity

Distance and Velocity Distance and Velocity - Unit #8 : Goals: The Integral Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite integral and

More information

Physics 115/242 Romberg Integration

Physics 115/242 Romberg Integration Physics 5/242 Romberg Integration Peter Young In this handout we will see how, starting from the trapezium rule, we can obtain much more accurate values for the integral by repeatedly eliminating the leading

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

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

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

5.1 Area and Estimating with Finite Sums

5.1 Area and Estimating with Finite Sums 5.1 Area and Estimating with Finite Sums Ideas for this section The ideas for this section are Left-Hand Sums Ideas for this section The ideas for this section are Left-Hand Sums Right-Hand Sums Ideas

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

Project 1: Riemann Sums

Project 1: Riemann Sums MS 00 Integral Calculus and Differential Equations 1 Project 1: Riemann Sums In this project you prove some summation identities and then apply them to calculate various integrals from first principles.

More information

Runge - Kutta Methods for first and second order models

Runge - Kutta Methods for first and second order models Runge - Kutta Methods for first and second order models James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 3, 2013 Outline 1 Runge -

More information

Sums of Squares (FNS 195-S) Fall 2014

Sums of Squares (FNS 195-S) Fall 2014 Sums of Squares (FNS 195-S) Fall 014 Record of What We Did Drew Armstrong Vectors When we tried to apply Cartesian coordinates in 3 dimensions we ran into some difficulty tryiing to describe lines and

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

Written Homework 7 Solutions

Written Homework 7 Solutions Written Homework 7 Solutions MATH 0 - CSM Assignment: pp 5-56 problem 6, 8, 0,,, 5, 7, 8, 20. 6. Find formulas for the derivatives of the following functions; that is, differentiate them. Solution: (a)

More information

MATH 408N PRACTICE FINAL

MATH 408N PRACTICE FINAL 2/03/20 Bormashenko MATH 408N PRACTICE FINAL Show your work for all the problems. Good luck! () Let f(x) = ex e x. (a) [5 pts] State the domain and range of f(x). Name: TA session: Since e x is defined

More information

4.1 Areas and Distances. The Area Problem: GOAL: Find the area of the region S that lies under the curve y = f(x) from a to b.

4.1 Areas and Distances. The Area Problem: GOAL: Find the area of the region S that lies under the curve y = f(x) from a to b. 4.1 Areas and Distances The Area Problem: GOAL: Find the area of the region S that lies under the curve y = f(x) from a to b. Easier Problems: Find the area of a rectangle with length l and width w. Find

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

Compound Damped Pendulum: An Example

Compound Damped Pendulum: An Example Compound Damped Pendulum: An Example Temple H. Fay Department of Mathematical Technology 1 Tshwane University of Technology Pretoria, South Africa thf ay@hotmail:com Abstract: In this article, we use an

More information

Math 312 Lecture Notes Linear Two-dimensional Systems of Differential Equations

Math 312 Lecture Notes Linear Two-dimensional Systems of Differential Equations Math 2 Lecture Notes Linear Two-dimensional Systems of Differential Equations Warren Weckesser Department of Mathematics Colgate University February 2005 In these notes, we consider the linear system of

More information

CDS 101 Precourse Phase Plane Analysis and Stability

CDS 101 Precourse Phase Plane Analysis and Stability CDS 101 Precourse Phase Plane Analysis and Stability Melvin Leok Control and Dynamical Systems California Institute of Technology Pasadena, CA, 26 September, 2002. mleok@cds.caltech.edu http://www.cds.caltech.edu/

More information

is the intuition: the derivative tells us the change in output y (from f(b)) in response to a change of input x at x = b.

is the intuition: the derivative tells us the change in output y (from f(b)) in response to a change of input x at x = b. Uses of differentials to estimate errors. Recall the derivative notation df d is the intuition: the derivative tells us the change in output y (from f(b)) in response to a change of input at = b. Eamples.

More information

CHAPTER 12 Numerical Solution of Differential Equations

CHAPTER 12 Numerical Solution of Differential Equations CHAPTER 12 Numerical Solution of Differential Equations We have considered numerical solution procedures for two kinds of equations: In chapter 10 the unknown was a real number; in chapter 6 the unknown

More information

Linear Independence Reading: Lay 1.7

Linear Independence Reading: Lay 1.7 Linear Independence Reading: Lay 17 September 11, 213 In this section, we discuss the concept of linear dependence and independence I am going to introduce the definitions and then work some examples and

More information

Numerical Methods for Ordinary Differential Equations

Numerical Methods for Ordinary Differential Equations Numerical Methods for Ordinary Differential Equations By Brian D. Storey 1. Introduction Differential equations can describe nearly all systems undergoing change. They are ubiquitous is science and engineering

More information

MATH 320, WEEK 2: Slope Fields, Uniqueness of Solutions, Initial Value Problems, Separable Equations

MATH 320, WEEK 2: Slope Fields, Uniqueness of Solutions, Initial Value Problems, Separable Equations MATH 320, WEEK 2: Slope Fields, Uniqueness of Solutions, Initial Value Problems, Separable Equations 1 Slope Fields We have seen what a differential equation is (relationship with a function and its derivatives),

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

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

Introduction to First Order Equations Sections

Introduction to First Order Equations Sections A B I L E N E C H R I S T I A N U N I V E R S I T Y Department of Mathematics Introduction to First Order Equations Sections 2.1-2.3 Dr. John Ehrke Department of Mathematics Fall 2012 Course Goals The

More information

Topic 4 Notes Jeremy Orloff

Topic 4 Notes Jeremy Orloff Topic 4 Notes Jeremy Orloff 4 auchy s integral formula 4. Introduction auchy s theorem is a big theorem which we will use almost daily from here on out. Right away it will reveal a number of interesting

More information

LECTURE 16: TENSOR PRODUCTS

LECTURE 16: TENSOR PRODUCTS LECTURE 16: TENSOR PRODUCTS We address an aesthetic concern raised by bilinear forms: the source of a bilinear function is not a vector space. When doing linear algebra, we want to be able to bring all

More information

2.1 How Do We Measure Speed? Student Notes HH6ed. Time (sec) Position (m)

2.1 How Do We Measure Speed? Student Notes HH6ed. Time (sec) Position (m) 2.1 How Do We Measure Speed? Student Notes HH6ed Part I: Using a table of values for a position function The table below represents the position of an object as a function of time. Use the table to answer

More information

Calculus: What is a Limit? (understanding epislon-delta proofs)

Calculus: What is a Limit? (understanding epislon-delta proofs) Calculus: What is a Limit? (understanding epislon-delta proofs) Here is the definition of a limit: Suppose f is a function. We say that Lim aa ff() = LL if for every εε > 0 there is a δδ > 0 so that if

More information

Ordinary differential equations. Phys 420/580 Lecture 8

Ordinary differential equations. Phys 420/580 Lecture 8 Ordinary differential equations Phys 420/580 Lecture 8 Most physical laws are expressed as differential equations These come in three flavours: initial-value problems boundary-value problems eigenvalue

More information

We saw in Section 5.1 that a limit of the form. arises when we compute an area.

We saw in Section 5.1 that a limit of the form. arises when we compute an area. INTEGRALS 5 INTEGRALS Equation 1 We saw in Section 5.1 that a limit of the form n lim f ( x *) x n i 1 i lim[ f ( x *) x f ( x *) x... f ( x *) x] n 1 2 arises when we compute an area. n We also saw that

More information

Designing Information Devices and Systems II Fall 2015 Note 22

Designing Information Devices and Systems II Fall 2015 Note 22 EE 16B Designing Information Devices and Systems II Fall 2015 Note 22 Notes taken by John Noonan (11/12) Graphing of the State Solutions Open loop x(k + 1) = Ax(k) + Bu(k) y(k) = Cx(k) Closed loop x(k

More information

MATH 215/255 Solutions to Additional Practice Problems April dy dt

MATH 215/255 Solutions to Additional Practice Problems April dy dt . For the nonlinear system MATH 5/55 Solutions to Additional Practice Problems April 08 dx dt = x( x y, dy dt = y(.5 y x, x 0, y 0, (a Show that if x(0 > 0 and y(0 = 0, then the solution (x(t, y(t of the

More information

Numerical Solution of Differential

Numerical Solution of Differential Chapter 14 Numerical Solution of Differential Equations We have considered numerical solution procedures for two kinds of equations: In chapter 10 the unknown was a real number; in chapter 6 the unknown

More information

ENGI9496 Lecture Notes State-Space Equation Generation

ENGI9496 Lecture Notes State-Space Equation Generation ENGI9496 Lecture Notes State-Space Equation Generation. State Equations and Variables - Definitions The end goal of model formulation is to simulate a system s behaviour on a computer. A set of coherent

More information

X. Numerical Methods

X. Numerical Methods X. Numerical Methods. Taylor Approximation Suppose that f is a function defined in a neighborhood of a point c, and suppose that f has derivatives of all orders near c. In section 5 of chapter 9 we introduced

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

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx.

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx. Capter 2 Integrals as sums and derivatives as differences We now switc to te simplest metods for integrating or differentiating a function from its function samples. A careful study of Taylor expansions

More information

1 Ordinary differential equations

1 Ordinary differential equations Numerical Analysis Seminar Frühjahrssemester 08 Lecturers: Prof. M. Torrilhon, Prof. D. Kressner The Störmer-Verlet method F. Crivelli (flcrivel@student.ethz.ch May 8, 2008 Introduction During this talk

More information

Slope Fields: Graphing Solutions Without the Solutions

Slope Fields: Graphing Solutions Without the Solutions 8 Slope Fields: Graphing Solutions Without the Solutions Up to now, our efforts have been directed mainly towards finding formulas or equations describing solutions to given differential equations. Then,

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

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

Integration, differentiation, and root finding. Phys 420/580 Lecture 7 Integration, differentiation, and root finding Phys 420/580 Lecture 7 Numerical integration Compute an approximation to the definite integral I = b Find area under the curve in the interval Trapezoid Rule:

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

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. (25 points) A man bails out of an airplane at the altitute of 12,000 ft, falls freely for 20 s, then opens his parachute. Assuming linear air resistance ρv ft/s 2, taking

More information

Orthogonality. Orthonormal Bases, Orthogonal Matrices. Orthogonality

Orthogonality. Orthonormal Bases, Orthogonal Matrices. Orthogonality Orthonormal Bases, Orthogonal Matrices The Major Ideas from Last Lecture Vector Span Subspace Basis Vectors Coordinates in different bases Matrix Factorization (Basics) The Major Ideas from Last Lecture

More information

The area under a curve. Today we (begin to) ask questions of the type: How much area sits under the graph of f(x) = x 2 over the interval [ 1, 2]?

The area under a curve. Today we (begin to) ask questions of the type: How much area sits under the graph of f(x) = x 2 over the interval [ 1, 2]? The area under a curve. Today we (begin to) ask questions of the type: How much area sits under the graph of f(x) = x 2 over the interval [ 1, 2]? Before we work on How we will figure out Why velocity

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

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations S. Y. Ha and J. Park Department of Mathematical Sciences Seoul National University Sep 23, 2013 Contents 1 Logistic Map 2 Euler and

More information

Math 32A Discussion Session Week 2 Notes October 10 and 12, 2017

Math 32A Discussion Session Week 2 Notes October 10 and 12, 2017 Math 32A Discussion Session Week 2 Notes October 10 and 12, 2017 Since we didn t get a chance to discuss parametrized lines last week, we may spend some time discussing those before moving on to the dot

More information

Leaving Cert Differentiation

Leaving Cert Differentiation Leaving Cert Differentiation Types of Differentiation 1. From First Principles 2. Using the Rules From First Principles You will be told when to use this, the question will say differentiate with respect

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

The Implicit Function Theorem

The Implicit Function Theorem The Implicit Function Theorem Case 1: A linear equation with m = n = 1 (We ll say what m and n are shortly.) Suppose we know that x and y must always satisfy the equation ax + by = c. (1) Let s write the

More information

A secant line is a line drawn through two points on a curve. The Mean Value Theorem relates the slope of a secant line to the slope of a tangent line.

A secant line is a line drawn through two points on a curve. The Mean Value Theorem relates the slope of a secant line to the slope of a tangent line. The Mean Value Theorem 10-1-005 A secant line is a line drawn through two points on a curve. The Mean Value Theorem relates the slope of a secant line to the slope of a tangent line. The Mean Value Theorem.

More information

CHAPTER 1 INTRODUCTION TO NUMERICAL METHOD

CHAPTER 1 INTRODUCTION TO NUMERICAL METHOD CHAPTER 1 INTRODUCTION TO NUMERICAL METHOD Presenter: Dr. Zalilah Sharer 2018 School of Chemical and Energy Engineering Universiti Teknologi Malaysia 16 September 2018 Chemical Engineering, Computer &

More information

Precalculus idea: A picture is worth 1,000 words

Precalculus idea: A picture is worth 1,000 words Six Pillars of Calculus by Lorenzo Sadun Calculus is generally viewed as a difficult subject, with hundreds of formulas to memorize and many applications to the real world. However, almost all of calculus

More information

Vector equations of lines in the plane and 3-space (uses vector addition & scalar multiplication).

Vector equations of lines in the plane and 3-space (uses vector addition & scalar multiplication). Boise State Math 275 (Ultman) Worksheet 1.6: Lines and Planes From the Toolbox (what you need from previous classes) Plotting points, sketching vectors. Be able to find the component form a vector given

More information

Notes on numerical solution of differential equations

Notes on numerical solution of differential equations Notes on numerical solution of differential equations Some definitions, for those who don t know: A differential equation is any equation that relates a thing to its derivatives. For instance, Newton s

More information

Numerical Analysis Exam with Solutions

Numerical Analysis Exam with Solutions Numerical Analysis Exam with Solutions Richard T. Bumby Fall 000 June 13, 001 You are expected to have books, notes and calculators available, but computers of telephones are not to be used during the

More information

Lecture 21: Numerical Solution of Differential Equations

Lecture 21: Numerical Solution of Differential Equations cs41: introduction to numerical analysis 11/30/10 Lecture 1: Numerical Solution of Differential Equations Instructor: Professor Amos Ron Scribes: Yunpeng Li, Mark Cowlishaw, Nathanael Fillmore 1 Introduction

More information

LB 220 Homework 4 Solutions

LB 220 Homework 4 Solutions LB 220 Homework 4 Solutions Section 11.4, # 40: This problem was solved in class on Feb. 03. Section 11.4, # 42: This problem was also solved in class on Feb. 03. Section 11.4, # 43: Also solved in class

More information

2. If the values for f(x) can be made as close as we like to L by choosing arbitrarily large. lim

2. If the values for f(x) can be made as close as we like to L by choosing arbitrarily large. lim Limits at Infinity and Horizontal Asymptotes As we prepare to practice graphing functions, we should consider one last piece of information about a function that will be helpful in drawing its graph the

More information

Lecture 9 4.1: Derivative Rules MTH 124

Lecture 9 4.1: Derivative Rules MTH 124 Today we will see that the derivatives of classes of functions behave in similar ways. This is nice because by noticing this general pattern we can develop derivative rules which will make taking derivative

More information

First-Order Differential Equations

First-Order Differential Equations CHAPTER 1 First-Order Differential Equations 1. Diff Eqns and Math Models Know what it means for a function to be a solution to a differential equation. In order to figure out if y = y(x) is a solution

More information

Sketchy Notes on Lagrangian and Hamiltonian Mechanics

Sketchy Notes on Lagrangian and Hamiltonian Mechanics Sketchy Notes on Lagrangian and Hamiltonian Mechanics Robert Jones Generalized Coordinates Suppose we have some physical system, like a free particle, a pendulum suspended from another pendulum, or a field

More information

Math 1120 Calculus, section 2 Test 1

Math 1120 Calculus, section 2 Test 1 February 6, 203 Name The problems count as marked. The total number of points available is 49. Throughout this test, show your work. Using a calculator to circumvent ideas discussed in class will generally

More information

Copyright (c) 2006 Warren Weckesser

Copyright (c) 2006 Warren Weckesser 2.2. PLANAR LINEAR SYSTEMS 3 2.2. Planar Linear Systems We consider the linear system of two first order differential equations or equivalently, = ax + by (2.7) dy = cx + dy [ d x x = A x, where x =, and

More information

Concepts of graphs of functions:

Concepts of graphs of functions: Concepts of graphs of functions: 1) Domain where the function has allowable inputs (this is looking to find math no-no s): Division by 0 (causes an asymptote) ex: f(x) = 1 x There is a vertical asymptote

More information