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 bulls-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 (Et ) 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. In real world applications, we will not known the true value a priori. 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 approximat ion - previous approximat ion current approximat ion

The approximate percent relative error is defined as curremt approximat ion - previous approximat ion Approximat e percent relative error ( a ) 100 % current approximat ion

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 | s

## | a | and the computation is repeated until

If this relation is satisfied, our result is assumed to be within the pre specified acceptable level.

(0.5 10

)%

Example 1

## The Maclaurin series expansion for

x

ex

is

x 2 x3 xn e 1 x ... ... 2! 3! n!
Starting with e 1 add terms one at a time to 0.5 estimate e . After each new term is added, compute the true and approximate percent relative errors. The true value for e0.5 1.648721 . Add terms until the absolute value of the approximation error estimate a falls below a pre specified error criterion s to 3 significant figure.
x

Solution
e0.5 1.648721
True value

s (0.5 10 23 )% 0.05 %
x

The pre specified error criterion for 3 significant figure is The first estimate is e 1 . The true percent relative error:

t
Second estimate is

## e0.5 1 0.5 1.5

a
1 .5 1 100 % 33 .3% s 1 .5

## Approximate percent relative error

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 1 2 3 4 5 6 Result 1 1.5 1.625 1.645833333 1.648437500 1.648697917

t
39.3 9.02 1.44 0.175 0.0172 0.00142

a
33.3 7.69 1.27 0.158 0.0158<

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 discrepancy introduced by this omission of 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.