Professional Documents
Culture Documents
Methods
48.5 (3 Significant)
87324.45 (7 Significant)
Significant Figures
5.38 x 104 3
5.380 x 104 4
5.3800 x 104 5
Zeros are sometimes used to locate the decimal point not significant figures.
0.00001753 4
0.0001753 4
0.001753 4
Accuracy & Precision
• Accuracy. How close is a
computed or measured value to
the true value
• Precision (or reproducibility).
How close is a computed or
measured value to previously
computed or measured values.
• Inaccuracy (or bias). A
systematic deviation from the
actual value.
• Imprecision (or uncertainty).
Magnitude of scatter.
Errors
Why measure errors?
f ( x h) f ( x)
f ' ( x)
h
s (0.510 (2-n)
)%
you can be sure that the result is correct to at least n
significant figures.
How is Absolute Relative Error
used as a stopping criterion?
Estimate e0.5
Solution Determine the error criterion that ensures a result is correct to at least three
significant figures:
Sources of numerical error
Round-Off error
1)Round-off error 2)Truncation error
1
1. Numbers such as p, e, , 2 1.4142... or
7
3
0.333333
cannot be
expressed by a fixed number of significant figures.
2. So these numbers are expressed approximately and significant
numbers are omitted.
3. Fractional quantities are typically represented in computer using
“floating point” form, e.g.,
Integer part
Mantissa: A number
exponent
represented approximately
to a fixed number
m.be
of significant digits mantissa Base of the number system
used
Sources of numerical error
Round-Off error
Storage of a floating point number in a word
Example:
p=3.14159265358 to be stored on a base-10 system carrying
7 significant digits.
p=3.141592 chopping error t=0.00000065
If rounded p=3.141593 t=0.00000035
x2 x4 x6
cos( x) 1
2! 4! 6!
x3 x5 x7
sin( x) x
3! 5! 7!
2 3
x x
e 1 x Maclaurian series
x
2! 3!
2 3 4
x x x
log (1 x) x Logrithmic series
e
2 3 4
Truncation Errors & Taylor Series
Any smooth function can be approximated as a polynomial.
f(xi+1) ≈ f(xi) zero order approximation, only true if xi+1
and xi are very close to each other.
f(xi+1) ≈ f(xi) + f′(xi) (xi+1-xi) first order approximation, in
form of a straight line
Truncation Errors & Taylor Series
nth order approximation
f
f ( xi 1 ) f ( xi ) f ( xi )( xi 1 xi ) ( xi 1 xi ) 2
2!
f (n)
( xi 1 xi ) n Rn
n!
(xi+1-xi)= h step size (define first)
f ( n 1)
(c) ( n 1) R x
x h
n 1
f n1 c
Rn h n
(n 1)!
(n 1)! c lies between xi and xi+1
Remainder term, Rn, accounts for all terms from (n+1) to infinity
Example—Taylor Series
Find the value of f 6 given that f 4 125, f 4 74,
f 4 30, f 4 6 and all other higher order derivatives
of f x at x 4 are zero.
Solution:
h2 h3
f x h f x f x h f x f x
2! 3!
x4
h 64 2
22 23
f 4 2 f 4 f 42 f 4 f 4
2! 3!
2 2 23
f 6 125 742 30 6
2! 3!
125 148 60 8
341
Example—Taylor Series
Solution:
f (1) = 0.95
Example—Taylor Series
Solution:
By Additional terms
Sin
Truncation Errors & Taylor Series
2! 3! 4! 5!
As the number of terms used increases, the error bound decreases and hence a
better estimate of the function can be found.
How many terms would it require to get an approximation of e1 within a magnitude of true
error less than 10-6
Solution: Since
x c xh
Using (n+1) terms of Taylor series gives error
1 c 1 0
Rn x
x h
n 1
f n 1 c x 1, h 0, f ( x) e x 1 c 1
n 1! e e
Rn 1 (n 1)!
10 6
(n 1)!
1 0
n 1
1n 1
(n 1)! 10 6 e
R 1 f n 1
c e c
So 9 terms or more
n
n 1! n 1! are needed to get a (n 1)! 10 6 3
true error n9
Truncation Errors
Maclaurin series
Solution
Determine the error criterion that ensures a result is correct to at least three significant figures:
Excel Program
Truncation Errors
Differentiation
Error caused by truncating or approximating a mathematical procedure.
For example:
secant line
P
tangent
line
Q
y = x2
60
Solution:
30
0 x
0 1.5 3 4.5 6 7.5 9 10.5 12
Error Propagation & Total Numerical Error
Error propagation
Errors in numbers can propagate through mathematical functions. For example, if we
multiply two numbers that have errors, we would like to estimate the error in the product.
Quiz-1 (on…..