Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Error Analysis
1.
2.
3.
4.
5.
Error Definitions
Round-off Errors
Truncation Errors
Total Numerical Error
Error Propagation
1. Error Definitons
Significant Digit (SD):
The significant figures/digits carry meaning to the precision of a measurement.
Consider measurements of the length of a table by three different rulers with
different resolutions:
L=3.2 m (2 S.D.)
L: 3.27 m (3 S.D.)
L: 3.270 m (4 S.D.)
First digit is the most significant digit, and the last digit is the least significant
digit in the measurement.
Error in the measurement is associated with the least significant digit:
L=3.2 0.2 m
L: 3.27 m 0.01 m
L: 3.270 0.003 m
- accurate
- not precise
- accurate
- precise
- not accurate
- not precise
- not accurate
- precise
Numerical Error:
In numerical methods deviations from both accuracy and
precision is collectively termed as error in the predictions.
Numerical errors arise from the use of approximation to
represent exact mathematic quantities or operations.
Error is the difference between exact and numerical solution.
true value = approximation + error
True error (Et):
The difference betwen exact and approximate values :
Et= true value approximated value
Absolute error (|Et|):
Approximate error:
In most cases we dont have the knowledge of the true value,
and cannot calculate the true error.
Define approximate error:
a
(approximate error)
100%
(approximate value)
Stopping criterion:
n= # of S.D.
2. Round-off Errors
In the numerical analysis, round-off errors arise due to the
omission of the significant figures in representing the numbers.
Base-10 (decimal) versus Base-2 (binary) system:
Base-10
Base-2
23 22 21 20
a b c d
a b a b
Positional
Notation
Integer Representation:
The first bit is used to store the sign (e.g., 0 for plus and 1 for
minus); the remaining bits are used to store the number.
mb
exponent
e
base
word"
e.g.
0.015678 1.5678102
(in base-10)
Range:
In FPR there is still a limit for the representation numbers but the
range is much bigger.
In 64-bit representiaton in IEEE format:
52 digits
11 digits
Chopping
error
error
4.2428576428......
4.2428576428......
4.242857
4.242858
Machine epsilon:
x
Machine epsilon (or machine precision) is the upper bound on
the relative error due to chopping/rounding in floating point
arithmetic.
b1t
b=number base
t= number of digits in mantissa
Arithmetic operations:
Besides the limitations of the computer for storage of numbers,
arithmetic operations of these numbers also contribute to the
round-off error.
Consider a hypotetical base-10 computer with 4-digit mantissa & 1-digit exponent:
1.345 + 0.03406 = 0.1345 x 101 + 0.003406 x 101 = 0.137906 x 101
during arithmetic operations, numbers are converted to be same exponents
chopped-off
y x3 5x 2 6 x 0.55
for x=1.73. Use 3-digit arithmetic with chopping. Evaluate the error.
b) If the function is expressed as
y x( x( x 5) 6) 0.55
what is the percent relative error? Compare with part a.
Subtractive cancellation:
4 S.D.
1 S.D.
Also called
loss of significance
x1 b b 2 4ac
x2
2a
b 4ac
2
Subtractive
cancellation
x1
2c
x2 b b 2 4ac
3. Truncation Errors
Truncation errors result from using approximations in place of
exact mathematical representations, e. g., for derivative, use
dv v v(ti 1 ) v(ti )
dt t
ti 1 ti
finite difference
approximation
Taylors Approximation:
Taylors theorem: If a function f and its (n+1) order derivatives are
continuous on an interval containing a and x, then the values of
the function at x can be represented as
( 2)
(n)
f
(
a
)
f
(a)
f ( x) f (a) f ' (a)( x a)
( x a) 2 ...
( x a) n Rn
2!
n!
th
0 order
term
reminder
function
base point(a)=1
f ( xi ) 2
f ( xi ) n
f ( xi 1 ) f ( xi ) f ( xi )h
h ...
h Rn
2!
n!
'
where
f n1 ( ) n 1
Rn
h
(n 1)!
h:step size
h ( xi 1 xi )
xi , xi 1
Here, Rn gives the exact determinaton of the error from the n-th
order approximation of the function.
We can estimate the order of the magnitude of the error in
terms of step size (h):
Rn O(h n1 )
and
v ' (ti )
R1 O(h2 )
Taylors
approximation to n=1
v(ti 1 ) v(ti ) R1
h
h
Finite difference
Truncation error
h (ti 1 ti )
R1 O(h 2 )
O ( h)
h
h
Truncation Error
= Round-off
Error
+ Truncation
Error
5. Error Propagation
Error propagation concerns how an error on x is propagated to
the function f(x).
x=true value
xo= approx. value
x x x
f ( x ) f ( x) f ( x )
error in
error out
expansion to
1st order term
f ( x ) f ' ( x o ) x
y y y
...
errors in
f ( x , y o , z o ,..)
Propagation of
error
error out
f
f
f
x
y
z ...
x
y
z
EX: It is desired to find the volume (V) of a rectangular tank. The length (L), width (W)
and height (H) of the tank are measured. The length, width and height of the tank were
measured as 150.5 m, 30.2 m and 300.8 m respectively.
a) What is the volume (V) of the tank?
b) Estimate the error done in calculating the volume of the tank.