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

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

Integration of Ordinary Differential Equations

Interpolation and Approximation

Fourth Order RK-Method

Initial Value Problems

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

Math 225 Differential Equations Notes Chapter 1

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

Section 7.2 Euler s Method

Nonconstant Coefficients

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

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

Numerical Differential Equations: IVP

Numerical Methods. King Saud University

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

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

Applied Math for Engineers

Additional exercises with Numerieke Analyse

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Ordinary Differential Equations

THE TRAPEZOIDAL QUADRATURE RULE

Sec. 1.1: Basics of Vectors

Introduction to the Numerical Solution of IVP for ODE

Module Two: Differential Calculus(continued) synopsis of results and problems (student copy)

Euler s Method applied to the control of switched systems

Numerical Methods in Physics and Astrophysics

Lecture 6. Numerical Solution of Differential Equations B21/B1. Lecture 6. Lecture 6. Initial value problem. Initial value problem

1 Fundamental Concepts From Algebra & Precalculus

Chapter 4. Higher-Order Differential Equations

Exercises, module A (ODEs, numerical integration etc)

Mini project ODE, TANA22

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

Interval Methods and Taylor Model Methods for ODEs

Solution of First Order Initial Value Problem by Sixth Order Predictor Corrector Method

Numerical Analysis and Computer Science DN2255 Spring 2009 p. 1(8)

First and Second Order ODEs

Power series solutions for 2nd order linear ODE s (not necessarily with constant coefficients) a n z n. n=0

Numerical solutions of nonlinear systems of equations

3 Applications of partial differentiation

Computation Fluid Dynamics

Initial value problems for ordinary differential equations

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

Lecture Notes on Numerical Differential Equations: IVP

Series Solution of Linear Ordinary Differential Equations

Partial Derivatives October 2013

INFINITE SEQUENCES AND SERIES

First Order ODEs, Part I

EXAMPLE OF ONE-STEP METHOD

Example: Limit definition. Geometric meaning. Geometric meaning, y. Notes. Notes. Notes. f (x, y) = x 2 y 3 :

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

Principles of Scientific Computing Local Analysis

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 AND MACLAURIN SERIES

14 Lecture 14 Local Extrema of Function

Higher order derivative

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

Numerical Solution of Differential Equations

Ordinary Differential Equations

(1) Rate of change: A swimming pool is emptying at a constant rate of 90 gal/min.

8.3 Partial Fraction Decomposition

Calculus of Variations Summer Term 2015

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

Practice Final Exam Solutions

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

Power series and Taylor series

Lesson 6. Diana Pell. Monday, March 17. Section 4.1: Solve Linear Inequalities Using Properties of Inequality

Numerical Solutions to Partial Differential Equations

SYSTEMS OF ODES. mg sin ( (x)) dx 2 =

Solution of a Fourth Order Singularly Perturbed Boundary Value Problem Using Quintic Spline

Explicit One-Step Methods

Equations with regular-singular points (Sect. 5.5).

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

SOLUTIONS to Exercises from Optimization

MTH4101 CALCULUS II REVISION NOTES. 1. COMPLEX NUMBERS (Thomas Appendix 7 + lecture notes) ax 2 + bx + c = 0. x = b ± b 2 4ac 2a. i = 1.

MA22S3 Summary Sheet: Ordinary Differential Equations

Series Solutions Near a Regular Singular Point

Multiplication of Polynomials

0.1 Solution by Inspection

MATH 1231 MATHEMATICS 1B Calculus Section 4.4: Taylor & Power series.

Lectures 9-10: Polynomial and piecewise polynomial interpolation

Review: Power series define functions. Functions define power series. Taylor series of a function. Taylor polynomials of a function.

The p-adic Numbers. Akhil Mathew

AE/ME 339. Computational Fluid Dynamics (CFD) K. M. Isaac. Momentum equation. Computational Fluid Dynamics (AE/ME 339) MAEEM Dept.

MATH 1231 MATHEMATICS 1B Calculus Section 3A: - First order ODEs.

Numerical and Statistical Methods

Review of Power Series

Chapter #4 EEE8086-EEE8115. Robust and Adaptive Control Systems

Taylor and Maclaurin Series. Copyright Cengage Learning. All rights reserved.

Lecture IX. Definition 1 A non-singular Sturm 1 -Liouville 2 problem consists of a second order linear differential equation of the form.

POWER SERIES REVIEW SOLUTIONS

Numerical and Statistical Methods

MA102: Multivariable Calculus

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

Math 104: l Hospital s rule, Differential Equations and Integration

2.12: Derivatives of Exp/Log (cont d) and 2.15: Antiderivatives and Initial Value Problems

Differentiation. Table of contents Definition Arithmetics Composite and inverse functions... 5

Differential Equations

2 Numerical Methods for Initial Value Problems

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

Numerical Methods for Initial Value Problems; Harmonic Oscillators

Transcription:

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 example, from physics we know that Newtons laws of motion describe trajectory or gravitational problems in terms of relationships between velocities, accelerations and positions. These can often be described as IVPs, where the ODE has the form, y (x) = f(x, y) or y (x) = f(x, y, y ). CSCC51H- Numerical Approx, Int and ODEs p.130/177

Second Order ODEs (cont) A Second-order scalar ODE can be reduced to an equivalent system of first-order ODEs as follows: With y = f(x, y, y ) we let Z(x) be defined by, Z(x) = [z 1 (x), z 2 (x)] T, where z 1 (x) y(x) and z 2 (x) y (x). It is then clear that Z(x) is the solution of the first order system of IVPs: Z = z 1(x) = y (x) z 2(x) y (x) = z 2(x) = z 2(x) f(x, y, y ) f(x, z 1, z 2 ) F (x, Z). CSCC51H- Numerical Approx, Int and ODEs p.131/177

Observations re 2 nd -order ODEs Note that in solving this equivalent system for Z(x), we determine an approximation to y (x) as well as to y(x). This has implications for numerical methods as, when working with this equivalent system, we will also be trying to accurately approximate y (x) and this may be more difficult than just approximating y(x). Note also that to determine a unique solution to our problem we must prescribe initial conditions for Z(a), that is for both y(a) and y (a). Second order systems of ODEs can be reduced to first order systems similarly (doubling the number of equations). Higher order equations can be reduced to first order systems in a similar way. CSCC51H- Numerical Approx, Int and ODEs p.132/177

Numerical Methods for IVPs Taylor Series Methods: If f(x, y) is sufficiently differentiable wrt x and y then we can determine the Taylor series expansion of the unique solution y(x) to y = f(x, y), y(a) = y 0, by differentiating the ODE at the point x 0 = a. That is, for x near x 0 = a we have, y(x) = y(x 0 ) + (x x 0 )y (x 0 ) + (x x 0) 2 y (x 0 ) +, 2 CSCC51H- Numerical Approx, Int and ODEs p.133/177

Taylor Series Methods (cont) To generate the TS coefficients, y (n) (x 0 )/ n!, we differentiate the ODE and evaluate at x = x 0 = a. The first few terms are computed from the expressions, y (x) = f(x, y) = f, y (x) = d dx f(x, y) = f x + f y y = f x + f y f, y (x) = d dx [y (x)] = (f xx + f xy f) + (f yx + f yy f)f + f y (f x + f y f) = f xx + 2f xy f + f yy f 2 + f y f x + f 2 y f. CSCC51H- Numerical Approx, Int and ODEs p.134/177

Key Observation for TS Methods In general, if f(x,y) is sufficiently differentiable, we can use the first (k + 1) terms of the Taylor series as an approximation to y(x) for (x x 0 ) small. That is, we can approximate y(x) by ẑ k,0 (x), ẑ k,0 (x) y 0 + (x x 0 )y 0 + + (x x 0) k y0 k. k! Note that the derivatives of y become quite complicated so one usually chooses a small value of k (k 6 or 7). CSCC51H- Numerical Approx, Int and ODEs p.135/177

Key Observation for TS (cont) One can use ẑ k,0 (x 1 ) as an approximation, y 1, to y(x 1 ). We can then evaluate the derivatives of y(x) at x = x 1 to define a new polynomial ẑ k,1 (x) as an approximation to y(x) for (x x 1 ) small and repeat the procedure. Note: The resulting ẑ k,j (x) for j = 0, 1, define a piecewise polynomial approximation to y(x) that is continuous on [a, b]. How do we choose h j = (x j x j 1 ) and k? CSCC51H- Numerical Approx, Int and ODEs p.136/177

TS Method Summary Let T k (x, y j 1 ) denote the first k + 1 terms of the Taylor series expanded about the discrete approximation, (x j 1, y j 1 ), and ẑ k,j (x) be the polynomial approximation (to y(x)) associated with this truncated Taylor series, ẑ k,j (x) = y j 1 + T k (x, y j 1 ), T k (x, y j 1 ) f(x j 1, y j 1 ) + 2 f (x j 1, y j 1 ) + k 1 f (k 1) (x j 1, y j 1 ), k! where = (x x j 1 ). A simple, constant stepsize (fixed h) TS method is then given by: -Set h = (b a)/n; -for j = 1, 2, N -end x j = x j 1 + h; y j = y j 1 + h T k (x j, y j 1 ); CSCC51H- Numerical Approx, Int and ODEs p.137/177

Local/Global Errors Note that, strictly speaking, z k,j (x) is not a direct approximation to y(x) but to the solution of the local IVP: z j = f(x, z j ), z j (x j 1 ) = y j 1. Since y j 1 will not be equal to y(x j 1 ) in general, the solution to this local problem, z j (x), will not then be the same as y(x). To understand and appreciate the implications of this observation we distinguish between the local and global errors. Definitions: The local error associated with step j is z j (x j ) y j. The global error at x j is y(x j ) y j. CSCC51H- Numerical Approx, Int and ODEs p.138/177

A Classical Approach A Classical (pre 1965) numerical method approximates y(x) by dividing [a, b] into equally spaced subintervals, x j = a + j h (where h = (b a)/n ) and, proceeding in a step-by-step fashion, generates y j after y 1, y 2, y j 1 have been determined. If the Taylor series method is used in this way, then the TS theorem with remainder shows that the local error on step j (for the TS method of order k) is: E j = hk+ 1 f (k) (η j, z j (η j )) = hk+ 1 (k+ 1) z j (η j ). (k + 1))! (k + 1)! If k = 1 we have Eulers Method where y j = y j 1 + h f(x j 1, y j 1 ), and the associated local error satisfies, L E j = h2 2 y (η j ). CSCC51H- Numerical Approx, Int and ODEs p.139/177

Error Bounds for IVP Methods Definition: A method is said to converge iff, { lim h 0,(N ) ma x y(x j) y j j= 1,2, N } 0. Theorem: (typical of classical convergence results) Let [x j, y j ] N j= 0 be the approximate solution of the IVP, y = f(x, y), y(a) = y 0 over [a, b] generated by Euler s method with constant stepsize h = (b a)/n. If the exact solution, y(x), C 2 [a, b] and f y < L, y (x) < Y then the associated GE, e j = y(x j ) y j, x j = a + j h satisfies (for all j > 0), e j hy 2L (e(x j x 0 )L 1 ) + e (x j x 0 )L e 0, hy 2L (e(b a)l 1 ) + e (b a)l e 0. CSCC51H- Numerical Approx, Int and ODEs p.140/177

Observations re Convergence 1. e 0 will usually be equal to zero. 2. This bound is generally pessimistic as it is exponential in (b a) where linear error growth is often observed on practical or realistic problems. 3. In the general case one can show that when local error is O(h p+ 1 ) the global error is O(h p ). CSCC51H- Numerical Approx, Int and ODEs p.141/177

Proof of Conv Th (outline) Eulers Method satisfies, y j = y j 1 + hf(x j 1, y j 1 ). A Taylor series expansion of y(x) about x = x j 1 implies y(x j ) = y(x j 1 ) + hf(x j 1, y(x j 1 )) + h2 2 y Subtracting the first equation from the second we obtain, (η j ). y(x j ) y j = y(x j 1 ) y j 1 +h[f(x j 1, y(x j 1 )) f(x j 1, y j 1 )] + h2 2 y (η j ). If Y = m a x x [a,b ] y (x) and f y L, then, from the definition of e j and the observation that f(x, y) satisfies a Lipschitz condition with respect to y, we have... CSCC51H- Numerical Approx, Int and ODEs p.142/177

Proof (cont) e j e j 1 + hl y(x j 1 ) y j 1 + h2 2 y (η j ), e j 1 + hl e j 1 + h2 2 Y, = e j 1 (1 + hl) + h2 2 Y. This is a linear recurrence relation (or inequality) which after some work (straightforward) can be shown to imply our desired result, e j hy 2L (e(b a)l 1 ) + e (b a)l e 0. Note that this is only an upper bound on the global error and it may not be sharp. CSCC51H- Numerical Approx, Int and ODEs p.143/177

Consider the following equation, An Example y = y, y(0) = 1, on [0, 1]. Now since f y = 1, L = 1 and since y(x) = ex, we have Y = e and e 0 = 0. Applying our error bound with h = 1/N and y N y(1) = e we obtain, G E N = y N e he (e 1) < 2.4h. 2 But for h =.1 we observe that y 1 0 = 2.5 9 3 7.. with an associated true error of.1246.. ( e y 1 0 ). This error bound is.24. This is an overestimate by a factor of 2. Exercise: Compare the bound to the true error for h =.01, h =.001. CSCC51H- Numerical Approx, Int and ODEs p.144/177

Limitations of Classical Approach Analysis is valid only in the limit as h 0. Bounds are usually very pessimistic (can overestimate the error by several orders of magnitude). Analysis does not consider the affect of f.p. arithmetic. CSCC51H- Numerical Approx, Int and ODEs p.145/177