Section 7.2 Euler s Method

Similar documents
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)

NUMERICAL SOLUTION OF ODE IVPs. Overview

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

Section 7.4 Runge-Kutta Methods

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

Introduction to Initial Value Problems

Numerical Methods. King Saud University

Numerical Methods - Initial Value Problems for ODEs

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

Euler s Method, cont d

Numerical Differential Equations: IVP

Higher Order Taylor Methods

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

TS Method Summary. T k (x,y j 1 ) f(x j 1,y j 1 )+ 2 f (x j 1,y j 1 ) + k 1

Numerical Analysis Exam with Solutions

Numerical methods for solving ODEs

Section 1.3 Integration

Lecture Notes on Numerical Differential Equations: IVP

Time Integration Methods for the Heat 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

Taylor polynomials. 1. Introduction. 2. Linear approximation.

Physics 584 Computational Methods

Math 252 Fall 2002 Supplement on Euler s Method

Initial value problems for ordinary differential equations

1 Error Analysis for Solving IVP

Introduction - Motivation. Many phenomena (physical, chemical, biological, etc.) are model by differential equations. f f(x + h) f(x) (x) = lim

Scientific Computing: An Introductory Survey

2.1 Differential Equations and Solutions. Blerina Xhabli

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

Math 128A Spring 2003 Week 12 Solutions

Numerical Solution of ODE IVPs

AN OVERVIEW. Numerical Methods for ODE Initial Value Problems. 1. One-step methods (Taylor series, Runge-Kutta)

Consistency and Convergence

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

Chapter 6 - Ordinary Differential Equations

Ordinary Differential Equations (ODEs)

Ph 22.1 Return of the ODEs: higher-order methods

Introduction to the Numerical Solution of IVP for ODE

Initial value problems for ordinary differential equations

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

A Brief Introduction to Numerical Methods for Differential Equations

Chap. 20: Initial-Value Problems

Numerical Methods for Initial Value Problems; Harmonic Oscillators

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

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

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

Computational Physics (6810): Session 8

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

Lecture 4: Numerical solution of ordinary differential equations

Numerical Methods for Initial Value Problems; Harmonic Oscillators

4 Stability analysis of finite-difference methods for ODEs

0.1 Solution by Inspection

Qualitative analysis of differential equations: Part I

You may not use your books, notes; calculators are highly recommended.

Checking the Radioactive Decay Euler Algorithm

Chapter 4. A simple method for solving first order equations numerically

Section 6.3 Richardson s Extrapolation. Extrapolation (To infer or estimate by extending or projecting known information.)

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

Example 1 Which of these functions are polynomials in x? In the case(s) where f is a polynomial,

Ordinary Differential Equations

Applied Math for Engineers

Ordinary differential equation II

MATH 312 Section 1.2: Initial Value Problems

Ordinary Differential Equations

Introductory Numerical Analysis

CONVERGENCE AND STABILITY CONSTANT OF THE THETA-METHOD

NUMERICAL ANALYSIS 2 - FINAL EXAM Summer Term 2006 Matrikelnummer:

Physically Based Modeling: Principles and Practice Differential Equation Basics

Physically Based Modeling Differential Equation Basics

1 Systems of First Order IVP

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS

Numerical Methods for Ordinary Differential Equations

9.2 Euler s Method. (1) t k = a + kh for k = 0, 1,..., M where h = b a. The value h is called the step size. We now proceed to solve approximately

5. Hand in the entire exam booklet and your computer score sheet.

AN INTERVAL METHOD FOR INITIAL VALUE PROBLEMS IN LINEAR ORDINARY DIFFERENTIAL EQUATIONS

Notation Nodes are data points at which functional values are available or at which you wish to compute functional values At the nodes fx i

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Euler s Method applied to the control of switched systems

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Do not turn over until you are told to do so by the Invigilator.

Numerical Methods of Approximation

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

5.2 - Euler s Method

Notes on uniform convergence

Exponential Growth and Decay

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

Section 3.9. The Geometry of Graphs. Difference Equations to Differential Equations

Homework and Computer Problems for Math*2130 (W17).

SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question.

Direct Proof Floor and Ceiling

Ordinary Differential Equations I

Introduction to Nonlinear Optimization Paul J. Atzberger

Autonomous means conditions are constant in time, though they may depend on the current value of y.

Computation Fluid Dynamics

Interval Methods and Taylor Model Methods for ODEs

Design and Analysis of Algorithms Lecture Notes on Convex Optimization CS 6820, Fall Nov 2 Dec 2016

Series Solutions. 8.1 Taylor Polynomials

Ordinary Differential Equations I

Transcription:

Section 7.2 Euler s Method Key terms Scalar first order IVP (one step method) Euler s Method Derivation Error analysis Computational procedure Difference equation Slope field or Direction field Error

Euler's method is the simplest of the one-step methods for approximating the solution to the initial value problem. An outline of the general procedure follows. A scalar, first-order initial value problem is given as We want to determine a numerical approximation to y(t) at discrete points in the interval [a, b]. The true solution of the IVP is denoted y(t) and we adopt the notational convention that w i represents the approximation to y i = y(t i ). (Note that y i is a short hand notation for the value of the true solution at t i.) For simplicity, the approximate solution will be sought at equally spaced points; that is, for some positive integer N, we will define the step size h = (b a)/n and t i will be given by t i = a + ih, (I = 0, 1, 2,, N). For a number of techniques we develop the step size will be constant; i.e. equispaced points.

Derivation of Euler s Method The derivation is another application of Taylor series. Assume that the true solution y(t) of the IVP has two continuous derivatives. Expanding this true solution in a Taylor series about the point t = t i produces where ξ is guaranteed to lie between t and t i. Evaluating the above Taylor expansion at t = t i+1 and substituting for y i ꞌ from the right-hand side of the differential equation, we obtain the next estimate Euler's method arises by dropping the error term and replacing y i (exact solution) by w i (approximate solution):

Example: Approximate IVP For this problem, f(t, x) is given by f(t, x) = 1 + x/t, so that the Euler's method difference equation takes the form Let's use a step size of h = 0.5, which will require ten steps to advance from t = 1 to t = 6. With t 0 = 1 and w 0 = 1, we calculate Advancing the value of the independent variable from t 0 to t 1 = t 0 + h = 1.5, we then calculate ETC. The exact solution is x(t) = t(1 + ln t). Thus we shall compare the Euler approximation and the exact solution.

Error Inspect the scales for the graphs. Approximate (solid) + True Soln (dotted) 18 1.4 ABS. ERROR 16 14 12 10 8 6 4 2 0 0 2 4 6 1.2 1 0.8 0.6 0.4 0.2 0 0 2 4 6

Observe the slow but steady growth in the global error as t increases. Since each step introduces new error into the computed approximate solution, we might expect this type of behavior in every problem; however, the actual accumulation of global error is very problem dependent.

Essentially, the error introduced by each step of the time marching process moves us from one solution of the differential equation onto a different solution. (At each step we encounter a new IVP; a perturbed IVP.) If, nearby solutions separate from one another as t increases, we can expect to see a steady increase in the global error. Note that a change of initial conditions had those solution curves move away from the solution curve for the original IVP. On the other hand, if nearby solutions move closer together as t increases, we could expect to observe a steady decline in the global error. The next example demonstrates this situation.

Another Example: IVP Here the Euler's method difference equation takes the form The exact solution is Here nearby solutions move closer together as t increases, so we observe a steady decline in the global error.

Approximate (solid) + True Soln (dotted) 5.5 0.18 ABS. ERROR 5 4.5 0.16 0.14 4 3.5 3 2.5 2 1.5 1 0 2 4 6 0.12 0.1 0.08 0.06 0.04 0.02 0 0 2 4 6

In this case changes in the initial conditions have the nearby solutions move closer together as t increases. So we could expect to observe a steady decline in the global error.

Next we need to determine the rate of convergence of Euler s method as the stepsize h decreases; h 0. Let's perform a numerical experiment. We expect that the accuracy of the approximate solution generated by Euler's method will improve if we decrease the step size h, but how much improvement will we obtain? Is the global error O(h)? Is it O(h 2 )? Is it O(h 3 )? The idea is that for each of our two examples we investigate the approximation at the end of solution interval for decreasing step sizes h. We halve the stepsize and look at how the error changes. Approx at t = 6. Note each time the step size is cut by a factor of 2, the absolute error shrinks by roughly the same factor. This suggests that the global error associated with Euler's method is O(h).

Approx at t = 5 Once again, each time the step size is cut by a factor of 2, the absolute error shrinks by roughly the same factor. So we conjecture that the rate of convergence of Euler s method is O(h).

Analysis of Euler s Method Euler s method is the simplest one-step method for approximating the solution of an IVP. Even so analyzing the error in Euler s method is not easy. We will outline the results. We start with the local truncation error which is

Basically this says, that if we choose h small enough we may get reasonable results. But we still need to see how the global error behaves. Here is where things get mathematically messy. We need the following condition: it is a vertical growth condition within a set D in the domain. Definition: A function f(t, y) satisfies a Lipschitz Condition in y on a set D in R 2 if there exists a constant L > 0 such that f(t, y 1) f(t, y 2 ) L y1 y2 For all ordered pairs (t, y 1 ) and (t, y 2 ) in set D. The constant L is called the Lipschitz Constant. A given function may satisfy a Lipschitz condition on one set, but not on another. Also, value of L may depend on the set D.

The next theorem deals with the accumulated error since w i depends on the previous approximations, w i-1, w i-2,, w 1. (We state this without a proof which requires some results involving sequences.) Note y i w i is the accumulated error in approximation w i at t = t i, assuming all the arithmetic was done exactly.

Global error at t = t i.

When the effect of roundoff is included the global error is composed of two competing forces. Finally if f(t,y) satisfies a Lipschitz condition in y, then it can be shown that Euler s method is stable with respect to perturbations of the initial conditions.

The truncation error in Euler's method can be reduced by using a smaller step size h; the reduction in error being linear with h. As the value of h is reduced, the number of steps to be used increases, thereby, increasing the round-off error. Thus, the round-off error increases as the truncation error decreases, as shown qualitatively in the figure. Although this figure shows that there is an optimum step size to minimize the total error, usually its value is not known. Hence, in practice, for a given differential equation, a series of solutions, each with a smaller step size, can be generated until two successive step sizes give essentially the same solution. At that stage, the solution can be assumed to have converged to the exact solution. However, it is to be noted that, due to the presence of round-off error, the numerical solution will always be different from the exact solution. In the absence of round-off errors, if a numerical solution approaches the exact solution as the step size (h) approaches zero, the numerical method is said to be convergent.