Docsity

Error and Approximation, Lecture notes of Numerical Methods in Engineering

Toggle sidebar
bg1
Chapter 1
Errors and Approximations
Errors
1. Round-off Error
2. Truncation Error
Approximation
1. Approximate Percent Relative Error
Significant Figures
Example
Round 742,396 to four, three, and two significant digits:
742,400 (four significant digits)
742,000 (three significant digits)
740,000 (two significant digits)
Round 0.07284 to four, three, and two significant digits:
0.07284 (four significant digits)
0.0728 (three significant digits)
0.073 (two significant digits)
Round 231.45 to four, three, and two significant digits:
231.5 (four significant digits)
231 (three significant digits)
230 (two significant digits)
Decimal Places
Example
Round 0.07284 to four, three, and two decimal places:
0.0728 (four decimal places)
0.073 (three decimal places)
0.07 (two decimal places)
Exercise
Round 19286.37465, 19208.37465, 19204.37465, 19886.37465 and 352.96479 to
a. Four, three, and two significant digits
b. Four, three, and two decimal places
pf3
pf4
pf5
Discount

On special offer

Partial preview of the text

Download Error and Approximation and more Lecture notes Numerical Methods in Engineering in PDF only on Docsity!

Chapter 1

Errors and Approximations

Errors

**1. Round-off Error

  1. Truncation Error**

Approximation

1. Approximate Percent Relative Error

Significant Figures

Example

Round 742,396 to four, three, and two significant digits:

742,400 (four significant digits)

742,000 (three significant digits)

740,000 (two significant digits)

Round 0.07284 to four, three, and two significant digits:

0.07284 (four significant digits)

0.0728 (three significant digits)

0.073 (two significant digits)

Round 231.45 to four, three, and two significant digits:

231.5 (four significant digits)

231 (three significant digits)

230 (two significant digits)

Decimal Places

Example

Round 0.07284 to four, three, and two decimal places:

0.0728 (four decimal places)

0.073 (three decimal places)

0.07 (two decimal places)

Exercise

Round 19286.37465, 19208.37465, 19204.37465, 19886.37465 and 352.96479 to

a. Four, three, and two significant digits

b. Four, three, and two decimal places

Numerical method – Techniques by which mathematical problems are formulated so that

they can be solved with arithmetic operations

Example

Method - Newton Raphson method

 i 

i i i f x

f x x x (^1) '   

Problem – Integrate the following

x f xx

Round of error

Due to the fact that computers can represent only quantities with a finite number of digits

Example

 3. 14

Truncation error

Is the discrepancy introduced by the fact that numerical methods may employ approximations

to represent exact mathematical operations and quantities.

Example

Consider the Taylor Series Expansion, a series that provides a means to predict a function

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

n

i i i n i i i h R n

f x h

f x h

f x f x   f xf x h      !

'' ' 3

''' 2

'' ' 1

First-order approximation

f  xi  f  xi  f  xi  h

'  1  

Numerical Error

Round-off error

Truncation error

t of A =

t of B =

However, true value and true error are not available in most real-world applications. Hence,

Approximate value = Approximation + Approximate Error

Let Ea = Approximate error, then rearranging the equation gives

Ea = Approximate value – Approximation

Approximate percent relative error

Currentapproximation

Current approximationPreviousapproximation

 a 

Stopping criterion – Terminate computation when  a   s where  s is a pre-specified

percent tolerance. If this relationship holds, the percent relative error of our results is assumed

to be within the pre-specified acceptable level  s.

Suppose you want your result to be correct to at least n significant figure then set

2 n s

Often, when performing computations, we may not be concerned with the sign of the error,

but we are interested in whether the percent absolute value is lower than a pre-specified

percent tolerance  s. Hence, this gives the following equations

Truevalue

True valueapproximation

 t 

Currentapproximation

Current approximationPreviousapproximation

 a 

Example

Consider the Mclaurin series expansion

2 3 4

n

x x x x e x

n x       

By adding terms one at a time, estimate

  1. 5 ^ e correct to at least 3 significant figures.

Solution

2 3   

 s

1 term,

 1

x e 1

  1. 5 e

2 terms,

e x

x  1  1 0. 5 1. 5

  1. 5 e   

3 terms,

2 x e x

x    1. 626 2

2

  1. 5 e    

4 terms,

2 3 x x e x

x     1. 645833333 3!

2 3

  1. 5 e     

5 terms,

2 3 4 x x x e x

x      1. 648437500 4!

2 3 4

     

x e

6 terms,

2 3 4 5 x x x x e x

x       1. 648697917 5!

2 3 4 5

      

x e

Terms Result  % 

 t  a  % 

a  0. 0158   s  0. 05

Exercise

Given that

cos 1

2 4 6 8

     

x x x x x

By adding terms one at a time, estimate cos^0. 6 correct to at least 4 significant figures.

Solution

Reference

Chapra, S.C. and Canale, R.P., 2010. Numerical Methods for Engineers, 6

th Edition. McGraw-Hill.