Lec 2 Sources of Error
Lec 2 Sources of Error
1
Two sources of numerical error
1) Round off error
2) Truncation error
2
Round off Error
• Caused by representing a number
approximately
1
0.333333
3
2 1.4142...
3
Problems created by round off error
4
Problem with Patriot missile
• Clock cycle of 1/10 seconds was
represented in 24-bit fixed point
register created an error of 9.5 x
10-8 seconds.
• The battery was on for 100
consecutive hours, thus causing
an inaccuracy of
8 s 3600s
9.5 10 100hr
0.1s 1hr
0.342s
5
Problem (cont.)
• The shift calculated in the ranging system
of the missile was 687 meters.
• The target was considered to be out of
range at a distance greater than 137
meters.
6
Effect of Carrying Significant
Digits in Calculations
7
Find the contraction in the
diameter
Tc
D D (T )dT
Ta
Ta=80oF; Tc=-108oF;
D=12.363”
α = a0+ a1T + a2T 2
8
Thermal Expansion
Coefficient vs Temperature
T(oF) α (μin/in/oF)
-340 2.45
-300 3.07
-220 4.08
-160 4.72
D D T
-80 5.43
0 6.00
40 6.24
80 6.47
9
Regressing Data in Excel
(general format)
Alpha ( in/in/ F)
8.00
o
4.00
0.00
-400 -200 0 200
o
T ( F)
Alpha ( in/in/ o F)
8.00
4.00
0.00
-400 -200 0 200
T ( o F)
15
Truncation error
• Error caused by truncating or
approximating a mathematical
procedure.
16
Example of Truncation Error
2!
17
Another Example of Truncation
Error
Using a x to f (x)
finite f ( x) f ( x xapproximate
) f ( x)
x
secant line
P
tangent line
90
2
y=x
60
30
0 x
0 1.5 3 4.5 6 7.5 9 10.5 12
19
Example 1 —Maclaurin series
1.2
Calculate the value e with an absolute
of
relative approximate error of less than
2 3
1%.e 1 1.2
1.2 1.2
1.2
...................
2! 3!
n 1.2 a %
e Ea
1 1 __ ___
2 2.2 1.2 54.545
3 2.92 0.72 24.658
4 3.208 0.288 8.9776
5 3.2944 0.0864 2.6226
6 3.3151 0.020736 0.62550
f ( x) x 2 f ( x x) f ( x)
Find f (3)
for using f ( x)
x
an x 0.2
d ' f (3 0.2) f (3)
f (3)
0.2
2 2
f (3.2) f (3) x 30..2 3 10.24 9 1.24
1 6.2
0 .2 0 .2 0.2 0.2
x
2
90
dx
3
2
y=x
60
30
0 x
0 3 6 9 12
22
Integration example (cont.)
Choosing a width of 3, we
havex 2 dx ( x 2 ) (6 3) ( x 2 ) (9 6)
9
3
x 3 x 6
(3 2 )3 (6 2 )3
27 108 135
Actual value is given by
9 9
x3 9 3
33
2
x dx 234
3 3 3 3
Truncation error is then
234 135 99
Can you find the truncation error with 4 23
Propagation of Errors
Propagation of Errors
http://numericalmethods.eng.usf.e
du
25
Example 1:
Find the bounds for the propagation in adding two numbers. For example
if one is calculating X +Y where
X = 1.5 ± 0.05
Y = 3.4 ± 0.04
Solution
Maximum possible value of X = 1.55 and Y = 3.44
Hence
4.81 ≤ X + Y ≤4.99.
http://numericalmethods.eng.usf.e
du
26
Propagation of Errors In Formulas
f f f f
f X 1 X 2 ....... X n 1 X n
X 1 X 2 X n 1 X n
http://numericalmethods.eng.usf.e
du
27
Example 2:
F h E
F h E
http://numericalmethods.eng.usf.e
du
29
Example 2:
1 2F F
2 3 2 2
F h E h hE E h E
Thus
1 2F F
E 2 F 3 h 2 2 E
h E hE h E
1 2 72
3 2 9
0.9 3 3 9
0.0001
(4 10 ) (70 10 ) (4 10 ) (70 10 )
72 9
1.5 10
(4 10 3 ) 2 (70 109 ) 2
5.3955
Hence
(64.286 5.3955 )
http://numericalmethods.eng.usf.e
du
30
Example 3:
Solution
Let z x y
z z
z
Then x y
x y
(1)x ( 1)y
x y
Sothe x change
z relative y is
z x y http://numericalmethods.eng.usf.e
du
31
Example 3:
For example if
x 2 0.001
y 2.003 0.001
z 0.001 0.001
z | 2 2.003 |
=
0.6667
=
66.67%
http://numericalmethods.eng.usf.e
du
32
THE END