Professional Documents
Culture Documents
Text: Ch 4
Objective:
Understand:
Measures of Error used in numerical
computation
Causes of Error in Numerical
Computation
Some measure to reduce errors in
computation
2
Introduction
Numerical Analysis:-
Inexact mathematics
Effective together with computer
Source of Error
Challenges of NA
Identification of Error
Quantification of Error
Control/limit within pre-specified error
3
Et p p ;
True Error
(1)
E p p ;
(2)
p p
p
t
(3)
Approximate Error
True value (p)- not available in real problems
(p)- available only when dealing analytically
solvable function
If (p) is not known, use the best approx.
available
p p
Error; for
100%
Approx.
Iterative Process
p
i 1
(4)
(5)
a s
Criteria
s 0.5 10 2 n %
Scarboroug h
s 10 / 2
Others
s Pr e specified / Tolerable value
n significant number desired
n
Example 1:
Find the Error & Relative Error
a) p 3.142857, p 3.14
b) p 10000 , p 9996,
c) p 0.00002, p 0.000015,
a)
Et 0.002857
b) Et 4
c)
Et 0.000005
t 9.09 10 %
2
t 4 10 %
t 25%
2
Example 2: Function
Approximation
Approximate ex for x=0.5 correct to 3
significant digits, p= e0.5 =1.648721
Function Approx.
x x
x
e 1 x
2! 3! n!
2
Error Criteria
s 0.5 10 23% 0.05%
1.648721 (e )
( )
100%;
1.648721
x
(e ) (e )
( )
100%
(e )
x
i 1
# of Terms
(ex )i
t %
a %
1
2
3
4
5
6
1
1.5
1.625
1.6458333
1.6484375
1.648697917
39.3
9.02
1.44
0.175
0.0172
0.00142
33.3
7.69
1.27
0.158
0.0152
Significant Digits
Def.: The number of leading digits of an
approximation that is correct to the
corresponding digits in the true value
counting right ward from the 1st non-zero
digit
Indicates the level of Confidence
a ) p 0.222
p 0.2222 3 significant digits
Example:
b) p 35.496
p 35.494 4
c) p 0.0356
p 0.0358 2
10
0.2222 0.222
0.2222
23.494 23.496
23.494
0.9 10 3
0.85 10 4
0.02144 0.02138
0.02144
0.28 10 2
12
P (1.25) 5.24
Form (b)
Q ( x) 3 x(2 x(4 x(7 5 x)))
4 multiplication & 4 additions
Q (1.25) 5.29
1.3.1
Example: f ( x) 0 e dx 0.54498710484 p
Taylor Series
x 4 x 6 x8
x 2n
e Pn ( x) 1 x
2! 3! 4!
n!
x2
4
6
x
x
P6 ( x) 1 x 2 ;
2! 3!
0 .5
x
x
x
P6 dx x
3 2!(5) 3!(7)
0 .5
0.544977678
0
t 0.110 4
17
2
3
h
h
e h 1 h O(h 4 )
2! 3!
h2 h4
cos(h) 1 O (h 6 )
2! 4!
Approx. of Sums;
e h cos(h)
h3 h 4
2 h O(h 4 ) O(h 6 )
3! 4!
h3
2 h O(h 4 )
3!
Approx. of Products;
3
h
e cos(h) 1 h O(h 4 )
3!
h
18
Example: Subtractive
cancellation
Reorder the expressions to obtain a
form that is not sensitive to subtractive cancellation
(a)
x y
(b) ln x ln y
1
(c )
1; x 0
1 x
20
1.4Error Propagation
Results of calculations made with numbers
containing ERROR
Errors due to Ordinary Arithmetic
Operations
x & y True values; x & y Approximat e values
Errors y y E y ; x x E x
Addition
x y ( x E x ) ( y E y ) ( x y ) ( E x E y )
Multiplication
x y ( x E x ) ( y E y ) ( x y ) y E x xE y E x E y
21
Exact
(x-y)
2.9769x10-5
(x-y)/w
2.6792x10-1
(x-y)*z
3.0141x10-10
y+z
9.8766669x104
Approx.
Abs. Error
Rel. Error
22
Propagation Error
Large Number computation
Series Computation
x 1 x x
n
1 / x 1 1 / 4 1 / 9 1.644...877
n
n 1
n 10 6
1 / x 1 / n 1 /( n 1) 1 /( n 2) 1.644...873
n
n 1
23
24
Examples
1) If the error introduced with g is g 0.002 m/s when
using g 9.81 m/s . Estimate the error on the mass (m)
2
on a body weighing 1 N.
2) Deflection of cantilever beam subjected to a point load
F at the tip. Estimate the error on the defelection given the
following?
F 500 N
F 1 N
L 1.5 m
L 0.01m
E 2.1 10 N / m E 0.05 10 N / m
11
I 6.6 10 m
8
11
I 0.01 10 m
8
26
1.6Condition
Def.
Sensitivity of the Dependent variable to
Changes in the Independent variable
f ' ( x)
Condition Number x
f ( x)
Cond. #=1, relative error is identical to the
relative
error in x
Cond. #>1, relative error is magnified
|Cond. #|<1, relative error is attenuated
27
1.7Error Control
Not possible to determine exact error
Control Strategies
Avoid subtractive cancellation
Rearrange/ Reformulate the problem
Use extended precision
Add smallest number first
Carry out numerical experiments
For critical numerical computation should be done
by 2 or more independent groups
28