Part 3 Truncation Errors.

Slides:



Advertisements
Similar presentations
Truncation Errors and Taylor Series
Advertisements

Section 11.6 – Taylor’s Formula with Remainder
Roundoff and truncation errors
Taylor’s Theorem Section 9.3a. While it is beautiful that certain functions can be represented exactly by infinite Taylor series, it is the inexact Taylor.
Calculus I – Math 104 The end is near!. Series approximations for functions, integrals etc.. We've been associating series with functions and using them.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Copyright © Cengage Learning. All rights reserved.
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.
Curve-Fitting Polynomial Interpolation
Second Term 05/061 Part 3 Truncation Errors (Supplement)
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
Calculus I – Math 104 The end is near!. 1. Limits: Series give a good idea of the behavior of functions in the neighborhood of 0: We know for other reasons.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
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:
Infinite Series Copyright © Cengage Learning. All rights reserved.
ES 240: Scientific and Engineering Computation. Chapter 4 Chapter 4: Errors Uchechukwu Ofoegbu Temple University.
Taylor’s Polynomials & LaGrange Error Review
Consider the following: Now, use the reciprocal function and tangent line to get an approximation. Lecture 31 – Approximating Functions
11 INFINITE SEQUENCES AND SERIES Applications of Taylor Polynomials INFINITE SEQUENCES AND SERIES In this section, we will learn about: Two types.
Chapter 8-Infinite Series Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
Round-off Errors.
9.3 Taylor’s Theorem: Error Analysis for Series
Copyright © Cengage Learning. All rights reserved. 11 Infinite Sequences and Series.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
9.7 and 9.10 Taylor Polynomials and Taylor Series.
Remainder Estimation Theorem
Taylor’s Theorem: Error Analysis for Series. Taylor series are used to estimate the value of functions (at least theoretically - now days we can usually.
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
Finite Difference Methods Definitions. Finite Difference Methods Approximate derivatives ** difference between exact derivative and its approximation.
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
In this section we develop general methods for finding power series representations. Suppose that f (x) is represented by a power series centered at.
This is an example of an infinite series. 1 1 Start with a square one unit by one unit: This series converges (approaches a limiting value.) Many 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.
Taylor series are used to estimate the value of functions (at least theoretically - now days we can usually use the calculator or computer to calculate.
Copyright © Cengage Learning. All rights reserved Applications of Taylor Polynomials.
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
1 Week 11 Numerical methods for ODEs 1.The basics: finite differences, meshes 2.The Euler method.
NUMERICAL DIFFERENTIATION Forward Difference Formula
Copyright © Cengage Learning. All rights reserved.
Lecture 25 – Power Series Def: The power series centered at x = a:
Section 11.3 – Power Series.
The Taylor Polynomial Remainder (aka: the Lagrange Error Bound)
Taylor series in numerical computations (review)
Taylor series in numerical computations (review, cont.)
The LaGrange Error Estimate
9.3 Taylor’s Theorem: Error Analysis for Series
Taylor Polynomials & Approximation (9.7)
Calculus BC AP/Dual, Revised © : Lagrange's Error Bound
Remainder of a Taylor Polynomial
Clicker Question 1 What is the interval of convergence of A. (-, )
Section 11.3 Power Series.
Clicker Question 1 What is the interval of convergence of A. (-, )
Taylor Series and Maclaurin Series
Section 11.6 – Taylor’s Formula with Remainder
Taylor’s Theorem: Error Analysis for Series
In the case where all the terms are positive,
9.3 Taylor’s Theorem: Error Analysis for Series
Chapter 1 / Error in Numerical Method
Copyright © Cengage Learning. All rights reserved.
Lagrange Remainder.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Part 3 Truncation Errors

Key Concepts Truncation errors Taylor's Series To approximate functions To estimate truncation errors Estimating truncation errors using other methods Alternating Series, Geometry series, Integration

Introduction How do we calculate on a computer using only +, -, x, ÷? One possible way is via summation of infinite series. e.g.,

Introduction How to derive the series for a given function? How many terms should we add? or How good is our approximation if we only sum up the first N terms?

A general form of approximation is in terms of Taylor Series.

Taylor's Theorem Taylor's Theorem: If the function f and its first n+1 derivatives are continuous on an interval containing a and x, then the value of the function at x is given by where the remainder Rn is defined as (the integral form)

Derivative or Lagrange Form of the remainder The remainder Rn can also be expressed as (the Lagrange form) for some c between a and x The Lagrange form of the remainder makes analysis of truncation errors easier.

Taylor Series Taylor series provides a mean to approximate any smooth function as a polynomial. Taylor series provides a mean to predict a function value at one point x in terms of the function and its derivatives at another point a. We call the series "Taylor series of f at a" or "Taylor series of f about a".

Example – Taylor Series of ex at 0 Note: Taylor series of a function f at 0 is also known as the Maclaurin series of f.

Exercise – Taylor Series of cos(x) at 0

Question What will happen if we sum up only the first n+1 terms?

Truncation Errors Truncation errors are the errors that result from using an approximation in place of an exact mathematical procedure. Approximation Truncation Errors Exact mathematical formulation

How good is our approximation? How big is the truncation error if we only sum up the first n+1 terms? To answer the question, we can analyze the remainder term of the Taylor series expansion.

Analyzing the remainder term of the Taylor series expansion of f(x)=ex at 0 The remainder Rn in the Lagrange form is for some c between a and x For f(x) = ex and a = 0, we have f(n+1)(x) = ex. Thus We can estimate the largest possible truncation error through analyzing Rn.

Example Estimate the truncation error if we calculate e as This is the Maclaurin series of f(x)=ex with x = 1 and n = 7. Thus the bound of the truncation error is The actual truncation error is about 0.2786 x 10-4.

Observation For the same problem, with n = 8, the bound of the truncation error is With n = 10, the bound of the truncation error is More terms used implies better approximation.

Example (Backward Analysis) This is the Maclaurin series expansion for ex If we want to approximate e0.01 with an error less than 10-12, at least how many terms are needed?

So we need at least 5 terms Note:1.1100 is about 13781 > e To find the smallest n such that Rn < 10-12, we can find the smallest n that satisfies With the help of a computer: n=0 Rn=1.100000e-02 n=1 Rn=5.500000e-05 n=2 Rn=1.833333e-07 n=3 Rn=4.583333e-10 n=4 Rn=9.166667e-13 So we need at least 5 terms

Same problem with larger step size Note:1.72 is 2.89 > e With the help of a computer: n=0 Rn=8.500000e-01 n=1 Rn=2.125000e-01 n=2 Rn=3.541667e-02 n=3 Rn=4.427083e-03 n=4 Rn=4.427083e-04 n=5 Rn=3.689236e-05 n=6 Rn=2.635169e-06 n=7 Rn=1.646980e-07 n=8 Rn=9.149891e-09 n=9 Rn=4.574946e-10 n=10 Rn=2.079521e-11 n=11 Rn=8.664670e-13 So we need at least 12 terms

To approximate e10.5 with an error less than 10-12, we will need at least 55 terms. (Not very efficient) How can we speed up the calculation?

Exercise If we want to approximate e10.5 with an error less than 10-12 using the Taylor series for f(x)=ex at 10, at least how many terms are needed? The smallest n that satisfy Rn < 10-12 is n = 18. So we need at least 19 terms.

Observation A Taylor series converges rapidly near the point of expansion and slowly (or not at all) at more remote points.

Taylor Series Approximation Example: More terms used implies better approximation f(x) = 0.1x4 - 0.15x3 - 0.5x2 - 0.25x + 1.2

Taylor Series Approximation Example: Smaller step size implies smaller error Errors Reduced step size f(x) = 0.1x4 - 0.15x3 - 0.5x2 - 0.25x + 1.2

Taylor Series (Another Form) If we let h = x – a, we can rewrite the Taylor series and the remainder as When h is small, hn+1 is much smaller. h is called the step size. h can be +ve or –ve.

The Remainder of the Taylor Series Expansion Summary To reduce truncation errors, we can reduce h or/and increase n. If we reduce h, the error will get smaller quicker (with less n). This relationship has no implication on the magnitude of the errors because the constant term can be huge! It only give us an estimation on how much the truncation error would reduce when we reduce h or increase n.

Other methods for estimating truncation errors of a series By Geometry Series By Integration Alternating Convergent Series Theorem Note: Some Taylor series expansions may exhibit certain characteristics which would allow us to use different methods to approximate the truncation errors.

Estimation of Truncation Errors By Geometry Series If |tj+1| ≤ k|tj| where 0 ≤ k < 1 for all j ≥ n, then

Example (Estimation of Truncation Errors by Geometry Series) What is |R6| for the following series expansion? Solution: Is there a k (0 ≤ k < 1) s.t. |tj+1| ≤ k|tj| or |tj+1|/|tj| ≤ k for all j ≤ n (n=6)? If you can find this k, then

Estimation of Truncation Errors By Integration If we can find a function f(x) s.t. |tj| ≤ f(j) j ≥ n and f(x) is a decreasing function x ≥ n, then

Example (Estimation of Truncation Errors by Integration) Estimate |Rn| for the following series expansion. Solution: We can pick f(x) = x–3 because it would provide a tight bound for |tj|. That is So

Alternating Convergent Series Theorem (Leibnitz Theorem) If an infinite series satisfies the conditions It is strictly alternating. Each term is smaller in magnitude than that term before it. The terms approach to 0 as a limit. Then the series has a finite sum (i.e., converge) and moreover if we stop adding the terms after the nth term, the error thus produced is between 0 and the 1st non-zero neglected term not taken.

Alternating Convergent Series Theorem Example 1: Eerror estimated using the althernating convergent series theorem Actual error

Alternating Convergent Series Theorem Example 2: Eerror estimated using the althernating convergent series theorem Actual error

Exercise If the sine series is to be used to compute sin(1) with an error less than 0.5x10-14, how many terms are needed? R0 R1 R2 R3 R4 R5 R6 R7 Solution: This series satisfies the conditions of the Alternating Convergent Series Theorem. Solving for the smallest n yield n = 7 (We need 8 terms)

Exercise How many terms should be taken in order to compute π4/90 with an error of at most 0.5x10-8? Solution (by integration): Note: If we use f(x) = x-3 (which is easier to analyze) instead of f(x) = (x+1)-3 to bound the error, we will get n >= 406 (just one more term).

Summary Understand what truncation errors are Taylor's Series Derive Taylor's series for a "smooth" function Understand the characteristics of Taylor's Series approximation Estimate truncation errors using the remainder term Estimating truncation errors using other methods Alternating Series, Geometry series, Integration