0% found this document useful (0 votes)
50 views13 pages

Lecture 3

This document discusses truncation errors that occur when using numerical approximations instead of exact mathematical methods. It introduces Taylor series as a way to model how functions behave and predict values. Examples are provided to demonstrate using Taylor series expansions to approximate functions and estimate truncation errors by adding more terms to the approximation. The examples compute true and approximate percent relative errors to analyze the accuracy of the Taylor series approximations.
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)
50 views13 pages

Lecture 3

This document discusses truncation errors that occur when using numerical approximations instead of exact mathematical methods. It introduces Taylor series as a way to model how functions behave and predict values. Examples are provided to demonstrate using Taylor series expansions to approximate functions and estimate truncation errors by adding more terms to the approximation. The examples compute true and approximate percent relative errors to analyze the accuracy of the Taylor series approximations.
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
You are on page 1/ 13

Numerical Methods

ETB/ETE/ETG/ETM/ETT 2092
Dr. N.A. Weerasekara
Dept. of Civil and Environmental Technology

1
Truncation Errors

➢ Errors that happen when you use an 70

approximation instead of an exact 60

50

Velocity (m/s)
mathematical method 40

30
Analytical
20 Time diff:7
Time diff: 1
10

0
0 5 10 15 20 25 30
Time (s)

2
Truncation
Errors
• There are mathematical formulas
which helps to figure out what
these kinds of errors look like.

• Taylor series, which is often used


in numerical methods to
approximate how functions look.

3
The Taylor Series
• 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

• In particular, the theorem states that any smooth


function can be approximated as a polynomial

4
The Taylor Series – Contd.

5
The Remainder Term

➢ Differentiable and continuous functions, such as exponentials and sinusoids,


a finite number of terms will not yield an exact estimate
➢ Each additional term will contribute some improvement, however slight, to
the approximation
➢ The assessment of how many terms are required to get “close enough” is
based on the remainder term of the expansion
6
The Remainder of the Taylor Series Expansion

If a function f(x) and its first derivative are continuous over an interval from xi
to xi+1, then there exists at least one point on the function that has a slope,
designated by f(ξ), that is parallel to the line joining f(xi) and f(xi+1). 7
Estimating Truncation Errors

8
Example 1: Use zero- through fourth-order Taylor series expansions to
approximate the function from 𝑥𝑖 = 0 with ℎ = 1. That is,
predict the function’s value at 𝑥𝑖+1 = 1.

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

9
Example 2: The following infinite series can be used to approximate ex:

(a) Prove that this Maclaurin series expansion is a special


case of the Taylor series expansion with xi = 0 and h = x

(b) Use the Taylor series to estimate f(x) = e-x at xi+1 = 1 for xi =
0.2. Employ the zero-, first-, second-, and third- order
versions and compute the true and approximate percent
10

relative errors
Example 3: Use Taylor series expansions with 𝑛 = 0 𝑡𝑜 6 to
approximate 𝑓(𝑥) = cos 𝑥 𝑎𝑡 𝑥𝑖+1 = 𝜋/3 on the basis
of the value of f(x) and its derivatives at 𝑥𝑖 = 𝜋/4. After
each new term is added, compute the true and
approximate percent relative errors.

11
Example 4: Perform the same computation as in Example 3, but for
the sinx.

12
Example 5: Use zero- through fourth-order Taylor series expansions to
predict f(2.5) for f(x) = ln x using a base point at x = 1.
Compute the true and approximate percent relative error
for each approximation. Discuss the meaning of the
results

13

You might also like