You are on page 1of 19

Numerical Methods For Engineers

Chapter 1 : Error Analysis


Introduction
• Numerical methods are techniques for solving problems
numerically using computer or calculator (in old days by
hand)
• This method is capable in solving mathematical
problems which are often impossible to solve analytically.
Introduction
• The numerical result we obtained is approximate being
true to 2 to 3 significant figures.

• Sometimes the methods we used for the computation


are also approximate and therefore the error in a
computed result may be due to the errors in the data or
the errors in the method or both.
Accuracy and Precision
• The errors associated with both the calculations and
measurement can be characterized with regard to their
accuracy and precision.

• Accuracy: Accuracy refers to how closely a computed or


measured value agrees with the true value.

• Precision: Precision refers to how closely individual


computed or measured values agree with each other.
Accuracy and Precision
• Inaccuracy: Inaccuracy (also called bias) is defined as
systematic deviation of the result from the true value.

• Imprecision: Imprecision (also called uncertainty) is


defined as the variation of the result in a set of repeated
measurements.
Accuracy and Precision
• The bullet holes on each
target can be thought of as
the predictions of a
numerical technique,
whereas bull’s-eye represents
the true value.
• (a) Inaccurate and imprecise
(b) Accurate and imprecise
(c) Inaccurate and precise
(d) Accurate and precise
Accuracy and Precision
• Numerical methods should be sufficiently accurate to
meet the requirements of a particular engineering
problem.

• They also should be precise enough for adequate


engineering design.

• In this course we will use the term “error” to represent


both the inaccuracy and imprecision of our predictions.
Error Definitions
• Numerical errors arise from the use of approximations to
represent exact mathematical operations and quantities.

• The relation between the true value and the


approximation can be formulated as
True value = Approximation + Error (Et)
or
Error (Et) = True value – Approximation
where Et is the exact value of the error.
Error Definitions

• The true relative error is defined as

True value - Approximation


True relative error 
True value
True error (E t )

True value
• The true percent relative error is defined as
True error (E t )
True percent relative error ( t )   100%
True value

Note: the subscript “t” is to signify that the error is based on


the true value.
Error Definitions

• The true value will be known only when the functions that
can be solved analytically.

• Certain numerical methods use an iterative approach to


compute answers. The present approximation is made on
the basis of the previous approximation. This process is
performed repeatedly to compute successively better and
better approximations.
Error Definitions
• The error is estimated as the difference between previous
and current approximations. Thus, the approximated error
can be defined as
Approximate error (Ea)
= current approximation – previous approximation
• The relative approximate error is defined as
current approximation - previous approximation
Relative approximate error 
current approximation
• The approximate percent relative error is defined as
curremt approximation - previous approximation
Approximate percent relative error ( a )   100%
current approximation
Error Definitions
• When performing computations, we may not be concerned
with the sign of the error but are interested in whether the
percent absolute value is lower than a pre specified
percent tolerance.
• It is useful to evaluate |  a | and the computation is
repeated until |  a |  s

• If this relation is satisfied, our result is assumed to be


within the pre specified acceptable level.
• Therefore, we can assure that the result is correct to n
significant figures:
 s  (0.5 10 2 n )%
Example 1
• The Maclaurin series expansion for ex is
x2 x3 xn
ex 1 x    ...   ...
2! 3! n!
x
Starting with e 1 add terms one at a time to
estimate e 0.5 . After each new term is added, compute
the true and approximate percent relative errors. The
true value for e 0.5  1.648721 . Add terms until the
absolute value of the approximation error  a estimate
falls below a pre specified error criterion  s to 3
significant figure.
Solution
True value e 0.5  1.648721
The pre specified error criterion for 3 significant figure is
 s  (0.5 10 23 )%  0.05%
x
The first estimate is e 1 .
1.648721  1
The true percent relative error:  t  1.648721 100%  39.3%

0 .5
Second estimate is e  1  0 .5  1 .5
Approximate percent relative error
1 .5  1
a   100%  33.3%   s
1 .5
Solution
Since  a  33.3%   s  0.05% we continue the
computation by adding another term and repeat the
error calculations. The process is continued
until  a   s . The entire computation is summarized
as follows:
Terms Result t a
1 1 39.3
2 1.5 9.02 33.3
3 1.625 1.44 7.69
4 1.645833333 0.175 1.27
5 1.648437500 0.0172 0.158
6 1.648697917 0.00142 0.0158<  s
Solution
• Thus, after six terms are included, the approximate error
falls below  s  0.05% , and the computation is stopped
here. The result is true for 3 significant figure.
Round-off Errors
• Round-off error arise from the fact that the digital
computers retain only a fixed number of significant
figures and the rest will be omitted during a calculation.
The dis cr e p a n cy i n t r o d u ce d b y t h i s o m i s si o n o f
significant figures is called round-off errors.

• This is important as it could lead to erroneous results in


solving engineering and scientific problems.
Large Computation
• Certain methods require extremely large number of
arithmetic manipulations to arrive at their final results.
That is, the later calculations are dependent on the
results of earlier ones. Consequently, the cumulative
effect over the course of a large computation can be
significant.
Truncation Errors
• Truncation errors are those that result from using an
approximation in place of an exact mathematical
procedure.

• To gain insight into the properties of such errors, we


illustrate this using Taylor series which is used widely in
numerical methods to express functions in an
approximation fashion.

You might also like