Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.

Slides:



Advertisements
Similar presentations
Ordinary Differential Equations
Advertisements

Truncation Errors and Taylor Series
Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Calculus I – Math 104 The end is near!. Series approximations for functions, integrals etc.. We've been associating series with functions and using them.
Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Numerical Computation
High Accuracy Differentiation Formulas
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 61.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Ordinary Differential Equations Equations which are.
Part 3 Truncation Errors Second Term 05/06.
Taylor Series (11/12/08) Given a nice smooth function f (x): What is the best constant function to approximate it near 0? Best linear function to approximate.
Revision.
Part 3 Truncation Errors.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Martin Mendez UASLP Chapter 61 Unit II.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 181 Interpolation Chapter 18 Estimation of intermediate.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 181 Interpolation.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Interpolation Chapter 18.
Copyright © The McGraw-Hill Companies, Inc
Copyright © 2005 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Standing.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 Least.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Newton-Cotes.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Standing.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 2 Image Slides.
Chapter 8 Traffic-Analysis Techniques. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 8-1.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Part 6 Calculus.
Computer Programming (TKK-2144) 13/14 Semester 1 Instructor: Rama Oktavian Office Hr.: M.13-15, W Th , F
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 31.
MMJ 1113 Computational Methods for Engineers Mohsin Mohd Sies Fakulti Kejuruteraan Mekanikal, Universiti Teknologi Malaysia.
Lecture 2 Number Representation and accuracy
Chapter 8-Infinite Series Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
Truncation Error and the Taylor Series
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University 1 Chapter 1 Mathematical.
Now that you’ve found a polynomial to approximate your function, how good is your polynomial? Find the 6 th degree Maclaurin polynomial for For what values.
MECN 3500 Lecture 4 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Open Methods Chapter 6 Credit:
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Integration.
17.16 Synthesis of Thyroid Hormone (TH) Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Slide number: 1.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 71.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 7.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 22.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
The Convergence Problem Recall that the nth Taylor polynomial for a function f about x = x o has the property that its value and the values of its first.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapter 21.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 7 - Chapter 25.
Numerical Analysis CC413 Propagation of Errors.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Three Statics of Structures Reactions.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Fifteen Approximate Analysis of Indeterminate Structures.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 7.
Chapter 13 Transportation Demand Analysis. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display
Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.
Convergence of Taylor Series Objective: To find where a Taylor Series converges to the original function; approximate trig, exponential and logarithmic.
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.
Taylor series in numerical computations (review)
Taylor series in numerical computations (review, cont.)
Numerical Differentiation
Roundoff and Truncation Errors
Clicker Question 1 What is the interval of convergence of A. (-, )
Expressing functions as infinite series
Section 11.3 Power Series.
Clicker Question 1 What is the interval of convergence of A. (-, )
Roundoff and Truncation Errors
Applications For practice we denote
Presentation transcript:

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 2 How does a CPU compute the following functions for a specific x value? cos(x) sin(x) e x log(x) etc. Non-elementary functions such as trigonometric, exponential, and others are expressed in an approximate fashion using Taylor series when their values, derivatives, and integrals are computed. Taylor series provides a means to predict the value of a function at one point in terms of the function value and its derivatives at another point.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3 Define the step size as h=(x i+1 - x i ), the series becomes: Taylor Series (n th order approximation): The Reminder term, R n, accounts for all terms from (n+1) to infinity.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. n th order approximation: Second order approximation: first order approximation Any smooth function can be approximated as a polynomial. Take x = x i+1 Then f(x) ≈ f(x i ) zero order approximation Each additional term will contribute some improvement to the approximation. Only if an infinite number of terms are added will the series yield an exact result. In most cases, only a few terms will result in an approximation that is close enough to the true value for practical purposes

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5 Example Approximate the function f(x) = x - 0.5x x x 4 from x i = 0 with h = 1 and predict f(x) at x i+1 = 1.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 6 Choose x = x i+1 and x i = 0 Then f(x i+1 ) = f(x) and (x i+1 – x i ) = x Since First Derivative of e x is also e x : (2.) (e x ) ” = e x (3.) (e x ) ”’ = e x, … (n th.) (e x ) (n) = e x As a result we get: Example: computing f(x) = e x using Taylor Series expansion Looks familiar? Maclaurin series for e x

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 7 Choose x= x i+1 and x i =0 Then f(x i+1 ) = f(x) and ( x i+1 – x i ) = x Derivatives of cos(x): (1.) (cos(x) ) ’ = -sin(x) (2.) (cos(x) )” = -cos(x), (3.) (cos(x) ) ”’ = sin(x) (4.) (cos(x) ) ”” = cos(x), …… As a result we get: Yet another example: computing f(x) = cos(x) using Taylor Series expansion

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 8 Notes on Taylor expansion: Each additional term will contribute some improvement to the approximation. Only if an infinite number of terms are added will the series yield an exact result. In most cases, several terms will result in an approximation that is close enough to the true value for practical purposes Reminder value R represents the truncation error The order of truncation error is h n+1  R=O(h n+1 ), If R=O(h), halving the step size will halve the error. If R=O(h 2 ), halving the step size will quarter the error.

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9 Error Propagation Let x fl refer to the floating point representation of the real number x. Since computer has fixed word length, there is a difference between x and x fl (round-off error) and we would like to estimate the error in the calculation of f(x) : Both x and f(x) are unknown. If x fl is close to x, then we can use first order Taylor expansion and compute: Result: If f’(x fl ) and  x are known, then we can estimate the error using this formula Solve from Example 4.5 p.95