Taylor series in numerical computations (review, cont.)

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Chapter 10 Infinite Series by: Anna Levina edited: Rhett Chien.
Numerical Computation
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
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.
Math Calculus I Part 8 Power series, Taylor series.
Part 3 Truncation Errors.
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Math Calculus I Part 8 Power series, Taylor series.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Lecture 35 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
© 2010 Pearson Education Inc.Goldstein/Schneider/Lay/Asmar, CALCULUS AND ITS APPLICATIONS, 12e– Slide 1 of 57 Chapter 11 Taylor Polynomials and Infinite.
Taylor Series & Error. Series and Iterative methods Any series ∑ x n can be turned into an iterative method by considering the sequence of partial sums.
Lecture 2 Number Representation and accuracy
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
Consider the following: Now, use the reciprocal function and tangent line to get an approximation. Lecture 31 – Approximating Functions
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 5a.
Chapter 8-Infinite Series Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
Copyright © Cengage Learning. All rights reserved. 11 Infinite Sequences and Series.
Lecture 8 Numerical Analysis. Solution of Non-Linear Equations Chapter 2.
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.
NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Warm up Construct the Taylor polynomial of degree 5 about x = 0 for the function f(x)=ex. Graph f and your approximation function for a graphical comparison.
9.7 and 9.10 Taylor Polynomials and Taylor Series.
Elliptic PDEs and the Finite Difference Method
Finite Difference Methods Definitions. Finite Difference Methods Approximate derivatives ** difference between exact derivative and its approximation.
Engineering Analysis – Computational Fluid Dynamics –
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.
9.3 Taylor’s Theorem: Error Analysis for Series
9.3 Taylor’s Theorem Quick Review Tell whether the function has derivatives of all orders at the given values of a.
Remainder Theorem. The n-th Talor polynomial The polynomial is called the n-th Taylor polynomial for f about c.
Numerical Analysis CC413 Propagation of Errors.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
9.3 Taylor’s Theorem: Error Analysis yes no.
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Introduction to error analysis Class II "The purpose of computing is insight, not numbers", R. H. Hamming.
Copyright © Cengage Learning. All rights reserved Applications of Taylor Polynomials.
Convergence of Taylor Series Objective: To find where a Taylor Series converges to the original function; approximate trig, exponential and logarithmic.
1 Week 11 Numerical methods for ODEs 1.The basics: finite differences, meshes 2.The Euler method.
INFINITE SEQUENCES AND SERIES In general, it is difficult to find the exact sum of a series.  We were able to accomplish this for geometric series and.
Machine arithmetic and associated errors Introduction to error analysis Class II.
Splash Screen.
Notes are from D. R. Wilton, Dept. of ECE
NUMERICAL DIFFERENTIATION Forward Difference Formula
Derivative of f (x) =sin (x)
DIFFERENTIATION RULES
Lecture 25 – Power Series Def: The power series centered at x = a:
Machine arithmetic and associated errors Introduction to error analysis (cont.) Class III.
11.4 The Comparison Tests In this section, we will learn:
The Taylor Polynomial Remainder (aka: the Lagrange Error Bound)
Copyright © Cengage Learning. All rights reserved.
Taylor series in numerical computations (review)
Copyright © Cengage Learning. All rights reserved.
9.3 Taylor’s Theorem: Error Analysis for Series
Class Notes 9: Power Series (1/3)
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
Clicker Question 1 What is the interval of convergence of A. (-, )
Expressing functions as infinite series
Clicker Question 1 What is the interval of convergence of A. (-, )
Copyright © Cengage Learning. All rights reserved.
Section 11.6 – Taylor’s Formula with Remainder
Taylor’s Theorem: Error Analysis for Series
Functions as Infinite Series
Copyright © Cengage Learning. All rights reserved.
Notes are from D. R. Wilton, Dept. of ECE
L’Hôpital’s Rule Chapter 9.2.
Presentation transcript:

Taylor series in numerical computations (review, cont.) Class V

Last time We reviewed a definition of Taylor series. We considered examples of Taylor expansions for several well known functions and applied them to estimate the values of some of them at specific values of their arguments, ln(1.1) and exp(8). The conclusion we drew: a Taylor series converges rapidly near the point of expansion and slowly (or not at all) at more remote points. We looked at the behavior of a few partial sums of a Taylor series for sin(x) and exp(x) that confirmed the above conclusion: more terms are needed with x deviating from the expansion point. We reformulated Taylor series for F(x+h).

In this lecture: We will continue consider other examples of Taylor series, their properties and some useful applications

Expansion of f(x+h) An expansion of f(x+h) about point x can be written as 𝒇 𝒙+𝒉 =𝒇 𝒙 + 𝒇 ′ 𝒙 𝒉+ 𝒇 ′′ 𝒙 𝒉 𝟐 𝟐! + 𝒇 𝟑 𝒙 𝒉 𝟑 𝟑! + …+ 𝒇 𝒏 𝒙 𝒉 𝒏 𝒏! + 𝑬 𝒏+𝟏 where the error term is given as 𝐸 𝑛+1 = 𝒇 𝒏+𝟏 (𝝃) 𝒉 𝒏+𝟏 (𝒏+𝟏)! and 𝑥< 𝜉<𝑥+ℎ (h positive) or 𝑥+ℎ< 𝜉<𝑥 (h is negative) Note that 𝐸 𝑛+1 ~ 𝒉 𝒏+𝟏 . As h converges to 0, 𝐸 𝑛+1 converges to 0 as fast as 𝒉 𝒏+𝟏 . This relation is expressed as 𝐸 𝑛+1 = O( 𝒉 𝒏+𝟏 ) (big O notation) and is equivalent to |𝐸 𝑛+1 | ≤𝑪 | 𝒉 𝒏+𝟏 | where C is a constants.

Expansion of f(x+h) with the error term can be written for any n=0,1,2 𝐸 𝑛+1 = 𝒇 𝒏+𝟏 (𝝃) 𝒉 𝒏+𝟏 (𝒏+𝟏)! = O( 𝒉 𝒏+𝟏 ) n=0 𝒇 𝒙+𝒉 =𝒇 𝒙 + 𝒇 ′ 𝝃 𝒉= 𝒇 𝒙 + O(𝒉) n=1 𝒇 𝒙+𝒉 =𝒇 𝒙 + 𝒇 ′ 𝒙 𝒉+ 𝒇 ′′ 𝝃 𝒉 𝟐 𝟐! =𝒇 𝒙 + 𝒇 ′ 𝒙 𝒉+ O( 𝒉 𝟐 ) n=3 𝒇 𝒙+𝒉 =𝒇 𝒙 + 𝒇 ′ 𝒙 𝒉+ 𝒇 ′′ 𝒙 𝒉 𝟐 𝟐! + 𝒇 𝟑 𝝃 𝒉 𝟑 𝟑! =𝒇 𝒙 + 𝒇 ′ 𝒙 𝒉+ 𝒇 ′′ 𝒙 𝒉 𝟐 𝟐! +O( 𝒉 𝟑 )

Example: expand sqrt(1+h) in powers of h. Then compute sqrt(1 Example: expand sqrt(1+h) in powers of h. Then compute sqrt(1.00001) and sqrt(0.99999) Calculate derivatives of function f(x) = sqrt(x)= 𝑥 1/2 Use Taylor expansion with x=1 and expand f(x+h):

Example: expand sqrt(1+h) in powers of h. Then compute sqrt(1 Example: expand sqrt(1+h) in powers of h. Then compute sqrt(1.00001) and sqrt(0.99999) Calculate derivatives of function f(x) = sqrt(x)= 𝑥 1/2 Use Taylor expansion with x=1 and expand f(x+h) taking n=2 1+ℎ =1+ 1 2 ℎ − 1 8 ℎ 2 + 1 16 ℎ 3 𝜉 −5/2 Here 1< 𝜉<1+ℎ (h positive) Let h=10^(-5). Calculate the approximate value of sqrt(1.00001). 3. Substitute –h for h in the above equation 1−ℎ =1− 1 2 ℎ − 1 8 ℎ 2 − 1 16 ℎ 3 𝜉 −5/2 4. Estimate the error

Alternating series Suppose we have a series: S = a1 – a2 + a3 – a4 + … Then if magnitudes of the terms converge monotonically to 0, i.e. a1 ≥ a2 ≥ a3 ≥ ... ≥ a_n ≥ .... ≥ 0 for all terms, and lim_{n->infinity} a_n = 0 Then the error in truncating the series is no larger than the magnitude of the first ommited term: S – exact series, S_n – the sum up to n term, |S – S_n| ≤ a_{n+1} Example: S = ln(2) = ln (1+1) ~ 1 – 1/2 + 1/3 – 1/4 + … + (-1)^{n-1} / n = S_n Then the error |S – S_n| ≤ 1/(n+1) If we want the error to be less than 0.5*10^{-6), then 1/(n+1) < 0.5*10^{-6) leading to n ~ 2*10^6 - two million terms are needed.

Example: estimate sin(x)/x, limit of x -> 0?

Example: estimate sin(x)/x, limit of x -> 0? Recall that

Example: estimate sin(x)/x, limit of x -> 0? Recall that 𝑛=0 ∞ (−1) 𝑛 𝑥 2𝑛 2𝑛+1 ! sin 𝑥 𝑥 = The first term (n=0) is 1 𝑥 2(𝑛+1) 2𝑛+3 ! Error: |S – S_n| ≤ a_{n+1} =

Example: estimate sin(x) - x