0% found this document useful (0 votes)
19 views16 pages

Chapter 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views16 pages

Chapter 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Numerical Methods in Engineering

ENGG222, Spring 2025

Chapter 4
Truncation Errors and the Taylor Series

Ramin Masoudi
Associate Professor of the Department of Mechanical Engineering
American University in Dubai

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 1


INTRODUCTION
 Truncation errors are those that result from using an approximation in
place of an exact mathematical procedure, for example

 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

 The Taylor series provides a means to predict a function value at one


point in terms of the function value and its derivatives at another point

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 2


THE TAYLOR SERIES
 The zero-order approximation gives a perfect estimate for a
constant function

 The first-order approximation gives a perfect estimate for


a straight trend

 The second-order approximation capture some of the


curvature that the function might exhibit

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 3


The complete Taylor series expansion

𝑥𝑥𝑖𝑖 ≤ 𝜉𝜉 ≤ 𝑥𝑥𝑖𝑖+1

The Remainder term, 𝑅𝑅𝑛𝑛 , accounts for all terms from (𝑛𝑛 + 1) to infinity

ℎ = 𝑥𝑥𝑖𝑖+1 − 𝑥𝑥𝑖𝑖  Step size

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 4


This remainder relationship, 𝑅𝑅𝑛𝑛 , has two major drawbacks:

 First, 𝜉𝜉 is not known exactly but merely lies somewhere between 𝑥𝑥𝑖𝑖 and 𝑥𝑥𝑖𝑖+1

 Second, to evaluate remainder equation 𝑅𝑅𝑛𝑛 , we need to determine the


(𝑛𝑛 + 1)th derivative of 𝑓𝑓(𝑥𝑥). To do this, we need to know 𝑓𝑓(𝑥𝑥). However, if we
knew 𝑓𝑓(𝑥𝑥), there would be no need to perform the Taylor series expansion in
the present context!

Despite this dilemma, the remainder relation is still useful for


gaining insight into truncation errors. This is because we do
have control over the term ℎ in the equation

where the nomenclature 𝑂𝑂(ℎ𝑛𝑛+1 ) means that


the truncation error is of the order of ℎ𝑛𝑛+1 .

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 5


Sample Problem: Use zero- through fourth-order Taylor series expansions to approximate
the function from 𝑥𝑥𝑖𝑖 = 0 with ℎ = 1

In general, the 𝑛𝑛th −order Taylor series expansion


will be exact for an 𝑛𝑛th −order polynomial

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 6


Sample Problem:

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 7


 The Remainder for the Taylor Series Expansion
Suppose that we truncated the Taylor series expansion after the zero-order term to yield

It is obviously inconvenient to deal with the


remainder in this infinite series format. One
simplification might be to truncate the remainder
itself

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 8


 The derivative mean-value theorem:

If a function 𝑓𝑓(𝑥𝑥) and its first derivative are


continuous over an interval from 𝑥𝑥𝑖𝑖 to 𝑥𝑥𝑖𝑖+1 ,
then there exists at least one point on the
function that has a slope, designated by
𝑓𝑓 ′ (𝜉𝜉), that is parallel to the line joining
𝑓𝑓(𝑥𝑥𝑖𝑖 ) and 𝑓𝑓(𝑥𝑥𝑖𝑖+1 )

Using the same logic:

…….

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 9


 Using the Taylor Series to Estimate Truncation Errors
For the jumper problem, the goal was to estimate velocity

let us truncate the series after the first derivative term

On the other hand, from the previous slide

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 10


Numerical Differentiation
Finite divided difference is a method of numerical differentiation in numerical methods,
based on the Taylor series expansion

 Forward Finite-divided Difference


Approximation

first forward difference

Step size

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 11


 Backward Finite-divided Difference
Approximation

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 12


 Centered Finite-divided Difference
Approximation

From the forward Taylor series expansion:

Substituting 𝑓𝑓(𝑥𝑥𝑖𝑖 ) from the Taylor formulation in


the backward finite-divided difference mentioned in
the previous slide, we have

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 13


Sample Problem: Use forward and backward difference approximations of 𝑂𝑂(ℎ) and a
centered difference approximation of 𝑂𝑂(ℎ2 ) to estimate the first derivative of

𝑓𝑓(𝑥𝑥) = −0.1𝑥𝑥 4 − 0.15𝑥𝑥 3 − 0.5𝑥𝑥 2 − 0.25𝑥𝑥 + 1.2

at 𝑥𝑥 = 0.5 using a step size ℎ = 0.5. Repeat the computation using ℎ = 0.25.

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 14


 Finite Difference Approximations of Higher Derivatives

 Second Forward Finite-divided Difference Approximation

 Second Backward Finite-divided


Difference Approximation

 Second Centered Finite-divided Difference Approximation

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 15


TOTAL NUMERICAL ERROR
 The total numerical error is the summation of the truncation and
round-off errors
In general, the only way to minimize round-off errors is
to increase the number of significant figures of the
computer. Further, we have noted that round-off error
will increase due to subtractive cancellation or due to
an increase in the number of computations in an
analysis.

In contrast, the truncation error can be reduced by


decreasing the step size. Because a decrease in step size
can lead to subtractive cancellation or to an increase in
computations, the truncation errors are decreased as
the round-off errors are increased

ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 16

You might also like