Higher Order Taylor Methods

Similar documents
Initial value problems 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

Euler s Method, cont d

Numerical methods for solving ODEs

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

Consistency and Convergence

Numerical Differential Equations: IVP

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

Math 128A Spring 2003 Week 12 Solutions

Initial value problems for ordinary differential equations

Numerical Methods - Initial Value Problems for ODEs

Ordinary differential equation II

Section 7.2 Euler s Method

Ordinary Differential Equations

Series Solutions. 8.1 Taylor Polynomials

Numerical Analysis: Interpolation Part 1

WORD: EXAMPLE(S): COUNTEREXAMPLE(S): EXAMPLE(S): COUNTEREXAMPLE(S): WORD: EXAMPLE(S): COUNTEREXAMPLE(S): EXAMPLE(S): COUNTEREXAMPLE(S): WORD:

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

Ordinary differential equations - Initial value problems

Calculus for the Life Sciences

Ordinary Differential Equations

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

Checking the Radioactive Decay Euler Algorithm

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

Initial-Value Problems for ODEs. Introduction to Linear Multistep Methods

Section 7.4 Runge-Kutta Methods

FORTRAN 77 Lesson 7. Reese Haywood Ayan Paul

1 Error Analysis for Solving IVP

Lecture Notes on Numerical Differential Equations: IVP

Ordinary Differential Equations

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

Solving Ordinary Differential Equations

9.6 Predictor-Corrector Methods

Ordinary Differential Equations

CS 257: Numerical Methods

CHAPTER 5: Linear Multistep Methods

Numerical solution of ODEs

Physics 584 Computational Methods

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo

CHALLENGE! (0) = 5. Construct a polynomial with the following behavior at x = 0:

Part IB Numerical Analysis

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

Scientific Computing: An Introductory Survey

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Fourth Order RK-Method

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

Chapter 7. Homogeneous equations with constant coefficients

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

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

An Analysis of Numerical Methods on Traffic Flow Models

Lecture 4: Numerical solution of ordinary differential equations

Introductory Numerical Analysis

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

NUMERICAL SOLUTION OF ODE IVPs. Overview

The Simplex Method: An Example

Ordinary Differential Equations I

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

Numerical Methods for the Solution of Differential Equations

CONVERGENCE AND STABILITY CONSTANT OF THE THETA-METHOD

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

Numerical Methods for Initial Value Problems; Harmonic Oscillators

1 Solutions to selected problems

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

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

1 Solutions to selected problems

Error, Accuracy and Convergence

Modeling & Simulation 2018 Lecture 12. Simulations

1 Systems of First Order IVP

Section 2.4: Add and Subtract Rational Expressions

5x 2 = 10. x 1 + 7(2) = 4. x 1 3x 2 = 4. 3x 1 + 9x 2 = 8

Module 4: Numerical Methods for ODE. Michael Bader. Winter 2007/2008

Chapter 8: Taylor s theorem and L Hospital s rule

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

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

FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS III: Numerical and More Analytic Methods David Levermore Department of Mathematics University of Maryland

Runge-Kutta and Collocation Methods Florian Landis

Ma 530 Power Series II

Numerical Methods - Boundary Value Problems for ODEs

Numerical Methods for Differential Equations

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

Numerical Analysis Exam with Solutions

Integration of Ordinary Differential Equations

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

The Definition and Numerical Method of Final Value Problem and Arbitrary Value Problem Shixiong Wang 1*, Jianhua He 1, Chen Wang 2, Xitong Li 1

Solution of ordinary Differential Equations

Eigenspaces in Recursive Sequences

Introduction to the Numerical Solution of IVP for ODE

Applied Math for Engineers

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

Numerical Analysis II. Problem Sheet 9

multistep methods Last modified: November 28, 2017 Recall that we are interested in the numerical solution of the initial value problem (IVP):

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

Mathematics for chemical engineers. Numerical solution of ordinary differential equations

Solving Ordinary Differential equations

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

Ordinary Differential Equations I

in a given order. Each of and so on represents a number. These are the terms of the sequence. For example the sequence

EXAMPLE OF ONE-STEP METHOD

AM 205 Final Project The N-Body Problem

Transcription:

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 solutions to differential equations whenever explicit solutions do not exist or when they are too hard to find. These numerical solutions are approximated though a variety of methods, some of which we set out to explore in this project. We require two conditions when computing differential equations numerically. First, we require that the solution is continuous with initial value. Otherwise, numerical error introduced in the representation of the number in computer systems would produce results very far from the actual solution. Second, we require that the solution changes continuously with respect to the differential equation itself. Otherwise, we cannot expect the method that approximates the differential equation to give accurate results. The most common methods for computing differential equations numerically include Euler s method, Higher Order Taylor method and Runge-Kutta methods. In this project, we concentrate on the Higher Order Taylor Method. This method employs the Taylor polynomial of the solution to the equation. It approximates the zeroth order term by using the previous step s value (which is the initial condition for the first step), and the subsequent terms of the Taylor expansion by using the differential equation. We call it Higher Order Taylor Method, the lower order method being Euler s Method. Under certain conditions, the Higher Order Taylor Method limits the error to O(h n ), where n is the order used. We will present several examples to test this idea. We will look into two main parameters as a measure of the effectiveness of the method, namely accuracy and efficiency.

2 Theory of the Higher Order Taylor Method Definition 2. Consider the differential equation given by y (t) = f(t, y), y(a) = c. Then for b > a, the nth order Taylor approximation to y(b) with K steps is given by y K, where {y i } is defined recursively as: t 0 = a y 0 = y(a) = c t i+ = t i + h h 2 f h n n f y i+ = y i + hf(t i, y i ) + (t i, y i ) +... + (t i, y i ) 2 t n! t n with h = (b a)/k. It makes sense to formulate such a definition in view of the Taylor series expansion that is used when y(t) is known explicitly. All we have done is use f(t, y) for y (t), f t (t, y) for y (t), and so forth. The next task is to estimate the error that this approximation introduces. We know by Taylor s Theorem that, for any solution that admits a Taylor expansion at the point t i, we have h 2 h n h (n+) y(t i+ ) = y(t i ) + hy (t i ) + y (t i ) +... + y (n) (t i ) + y (n+) (σ) 2 n! (n + )! where σ is between t i and t i+ Using y = f(t, y), this translates to h 2 f h n (n ) f h (n+) (n) f y(t i+ ) = y(t i )+hf(t i, y i )+ (t i, y i )+...+ (t i, y i )+ (σ, y(σ)) 2 t n! t (n ) (n + )! t (n) Therefore, the local error, that is to say, the error introduced at each step if the values calculated previously were exact, is given by: which means that (n) f E i = (h n+ ) (σ, y(σ)) (n + )! t n (n) f E max (h n+ i ) (σ, y(σ)) σ [a,b] (n + )! t n 2

We can say E i = O(h n+ ). Now, since the number of steps from a to b is proportional to /h, we multiply the error per step by the number of steps to find a total error E = O(h n ). 3 In Practice: Examples We will consider differential equations that we can solve explicitly to obtain an equation for y(t) such that y (t) = f(t, y). This way, we can calculate the actual error by subtracting the exact value for y(b) from the value that the Higher Order Taylor method predicts for it. To approximate values in the following examples, the derivatives of f(t, y) were computed by hand. MATLAB then performed the iteration and arrived at the approximation. Notice that the definitions given in the previous section could also have been adapted for varying step size h. However, for ease of computation we have kept the step size constant. In our computations, we have chosen step size of (b a)/2 k, which resulted in K = 2 k evenly spaced points in the interval. Example 3. We consider the differential equation + t y (t) = f(t, y) = + y with initial condition y() = 2. It is clear that y(t) = t 2 + 2t + 6 solves this equation. Thus we calculate the error for y(2) by subtracting the approximation of y(2) from y(2), which is the exact value. Recall that we are using h = 2 k because (b a) =. The following table displays the errors calculated. k = k = 2 k = 3 k = 4 order =.0333.058.0077.0038 order = 2.0038.0009.0002.000 order = 3.0003269.0000383.0000046.0000006 For the first order case (also known as Euler s method), we expect the error to be proportional to h, where h is the length of the intervals tested. This means that, when k increases by, we expect the error to be halved (approximately). Observing the values in the table confirms this expectation. For the second order case, we expect the error to be proportional to h 2, so we expect the error to be divided by 4 as we move to the right on the table. For third order, we expect the error to be proportional to h 3, so we expect the error to be divided by 8 as we move to the right. Again, this seems to be the case. 3

In figure, the graph on the left show the approximations of y(t) plotted against t by using Euler s method. Each line corresponds to one row of the table above, that is, to different step sizes h = /2, /4, /8 and /6. The graphs on the right show the error plotted against t, so the errors at t = 2 are those given in the table. Here again, each line corresponds to a different step size h = /2, /4, /8 and /6, Obviously, the lines with error closer to zero correspond to higher values of k. Figure : Euler s Method: numerical computation of the solution with step size (on the left) and the corresponding error (on the right). Similarly, we have produced the same graphs using Taylor s method of Second and Third order. They are show in figure 2 and 3 respectively. Now we will consider more examples to compare the pattern of the error values. We will not include the new graphs since their similarity with the graphs for the first example makes them uninteresting. Example 3.2 Here we consider the equation f(t, y) = 2 y, with initial condition y(0) = 2. Its explicit solution is y(t) = t + 4. If we generate the error as above, we obtain the following table for t =. k = k = 2 k = 3 k = 4 order =.0066.0032.006.0008 order = 2.0003852.000097.0000224.0000055 order = 3.00002837.00000330.00000040.00000005 4

Figure 2: Second order Taylor s Method: numerical computation of the solution with step size (on the left) and the corresponding error (on the right). Figure 3: Third order Taylor s Method: numerical computation of the solution with step size (on the left) and the corresponding error (on the right). 5

This second example again meets our expectations as stated in Example. Upon inspection, it is clear that first order errors are roughly halved with each increase in k, second order entries are divided by 4, and third order entries are divided by 8. The examples that follow will again illustrate this phenomenon. Example 3.3 Consider the differential equation y (t) = f(t, y) = t + y, with initial condition y(0) = 0. The explicit solution is y(t) = t + e t. This gives the following data for t =. k = k = 2 k = 3 k = 4 order =.4683.2769.525.0804 order = 2.0777.0234.0064.007 order = 3.0095.004.0002.0000 Note that the error in the lower right is not actually zero; this is just from the computer rounding off. Example 3.4 Consider the differential equation y (t) = f(t, y) = ty with initial condition y(0) =. Thus the explicit solution is g(t) = e 2 t 2. This gives the following data for t =. k = k = 2 k = 3 k = 4 order =.3987.2293.247.0653 order = 2.0667.0225.0065.008 order = 3.0286.0045.0006.000 4 Evaluation of the method As we have seen in these examples, and as our theory would suggest, the Higher Order Taylor Method is able to arrive at very accurate approximations with relatively large step size. However, we have used the information of the derivatives of f(t, y). Differentiation in general can be costly. In practice, there are cases where the differential equation is a black box: f(t 0, y 0 ) can be found by empirical methods given t 0 and y 0, but the explicit equation f(t, y) is unknown. In such cases, the Higher Order Taylor Method simply does not work. There is a class of differential equations, known as stiff equations, to which this method cannot be readily applied. The solutions of stiff equations are characterized by decaying as t increases, while the derivatives do not. This can cause wildly inaccurate approximations unless h is within a certain bound. It is generally easier to use an alternate method rather than worry about keeping 6

h within its bound. Indeed, other methods have been developed specifically to accomodate stiff equations. We have also assumed that the solution has a Taylor expansion that converges to the actual solution. Although this is the case for a wide variety of functions, it is advisable to take this into consideration. Alternative ways of verifying the approximation are advisable. In summary, the Higher Order Taylor Method is not universally applicable. When it does apply, it can be fairly accurate. In our examples, the error decays with decreasing h just as the theory would predict. In fact, the rate of decay is proportional to h n, where n is the order of approximation used. 7