Chapter 1 - Errors and Approximations
Chapter 1 - Errors and Approximations
Errors
1. Round-off Error
2. Truncation Error
Approximation
1. Approximate Percent Relative Error
Significant Figures
Example
Decimal Places
Example
Exercise
Example
Method - Newton Raphson method
f xi
xi 1 xi
f ' xi
f x x x
Numerical Error
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.
First-order approximation
f xi 1 f xi f ' xi h
Second-order approximation
f '' x i 2
f xi 1 f xi f ' xi h h
2!
Third-order approximation
f '' xi 2 f ''' xi 3 f ''' xi n
f xi 1 f xi f ' xi h h h ... h Rn
2! 3! n!
In general,
Example
t of B =
However, true value and true error are not available in most real-world applications. Hence,
Suppose you want your result to be correct to at least n significant figure then set
s 0.5 102n %
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
x 2 x3 x 4 xn
e 1 x
x
...
2 3! 4! n!
By adding terms one at a time, estimate e 0.5 correct to at least 3 significant figures.
Solution
1 term,
ex 1 e 0.5 1
2 terms,
e x 1 x e 0.5 1 0.5 1.5
3 terms,
x2 0.5 2
ex 1 x e 0.5 1 0.5 1.626
2 2
4 terms,
x2 x3 0.5 2 0.53
ex 1 x e 0.5 1 0.5 1.645833333
2 3! 2 3!
5 terms,
x 2 x3 x 4 0.5 2 0.53 0.5 4
ex 1 x e x 1 0.5 1.648437500
2 3! 4! 2 3! 4!
6 terms,
x 2 x3 x4 x5 0.5 2 0.53 0.5 4 0.55
ex 1 x e x 1 0.5 1.648697917
2 3! 4! 5! 2 3! 4! 5!
a 0.0158 s 0.05
Exercise
Given that
x 2 x3 x 4 xn
e 1 x
x
...
2 3! 4! n!
By adding terms one at a time, estimate e1.2 correct to at least 2 significant figures.
Solution
Exercise
Given that
x 2 x 4 x 6 x8
cos x 1 ...
2 4! 6! 8!
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, 6th Edition. McGraw-Hill.