A Module On Introduction and Measuring Errors in Numerical Methods PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Prepared by:

ENGR. SALUSTIANO D. MORALES


Associate Professor III
Objectives: After studying this topic, you should be
able to:

1. Understand the need for numerical methods.


2. Go through the stages of solving a particular
physical problem.
3. Find the true and relative true error.
4. Find the approximate and relative approximate
error.
5. Relate the absolute relative approximate error to
the number of significant digits at least correct in
your answers.
Introduction
Numerical methods are techniques by which
mathematical problems are formulated so that they
can be solved with arithmetic operations. Although
there are many kinds of numerical methods, they
have one common characteristic: they invariably
involve large numbers of tedious arithmetic
calculations. It is little wonder that with the
development of fast, efficient digital computers,
the role of numerical methods in engineering
problem solving has increased dramatically in
recent years.
The numerical technique yielded estimates
that were close to the exact analytical solution,
there was a discrepancy, or error, because the
numerical method involved an approximation. We
were fortunate in case that an analytical solution is
available for us to compute the error exactly. For
many applied engineering problems, we cannot
obtain analytical solutions. Therefore, we cannot
compute exactly the errors associated with our
numerical methods. In these cases, we must settle
for approximations or estimates of the errors.
In the pre-computer era there were generally
three different ways in which engineers
approached problem solving:

1. Solutions were derived for some problems


using analytical, or exact methods.
2. Graphical solutions were used to characterize
the behavior of systems.
3. Calculators and slide rules were used to
implement numerical methods manually.
1. Numerical methods are extremely powerful problem-
solving tools.
2. During your careers, you may often have occasion to
use commercially available prepackaged, or “canned”,
computer programs that involve numerical methods. The
intelligent use of these programs is often predicated on
knowledge of the basic theory underlying the methods.
3. Many problems cannot be approached using canned
programs. If you are conversant with numerical methods
and are adept at computer programming, you can design
your own programs to solve problems without having to
buy or commission expensive software.
4. Numerical methods are an efficient vehicle
for learning to use computers.
5. Numerical methods provide a vehicle for
you to reinforce your understanding of
mathematics. Because one function of
numerical methods is to reduce higher
mathematics to basic arithmetic operations.
1. There is some discrepancy.
2. To minimize error, use smaller time interval.
3. The smaller the time interval, the amount of
solution becomes larger.
Approximations and Round-Off
Errors
Significant Figures
The concepts of significant figures has two important
implications for our study of numerical methods:

1. Numerical methods yield approximate results. We, must therefore,


develop criteria to specify how confident we are in our
approximate result. One way to do this is in terms of significant
figures.

2. Although quantities such as 𝝿, or e represents specific quantities,


they cannot be expressed exactly by a limited numbers of digits.
Accuracy
Refers to how closely a computed or
measured value agrees with the true value

Precision
Refers to how closely individual computed
or measured values agrees with each other.
Errors are intrinsic to the
understanding and effective use
of numerical methods.
Numerical Errors - arise from the use of
approximation to represent exact mathematical
operations and quantities.

Example:
𝑥 𝑥2 𝑥3
1. Truncation Error: 𝑒 𝑥 = 1 + + + +⋯
1! 2! 3!
2. Round-off: when approximation numbers
are used to represent exact numbers.
(𝝿 3.1416)
Why measure errors?
1) To determine the accuracy of numerical
results.
2) To develop stopping criteria for iterative
algorithms.
Defined as the difference between the true
value in a calculation and the approximate
value found using a numerical method etc.

True Error = True Value – Approximate Value


1. In real world it is difficult to determine the
true value on the on set of the problem.
2. What can be done if true values are not
known or very difficult to obtain?
3. Approximate error is defined as the
difference between the present
approximation and the previous
approximation.
Defined as the ratio between the approximate
error and the present approximation.
If ∣ϵa∣ ≤ ∣ϵs∣, where ϵs is a pre-specified tolerance,
then no further iterations are necessary and the
process is stopped.

If at least n significant digits are required to be


correct in the final answer, then

∣ϵa∣ ≤ 0.5 x 102-n %


𝛜s=0.5x102-n % (Scarborough, 1966)
MACLAURIN’S SERIES:
2 3
𝑥 𝑥 𝑥
𝑒𝑥 = 1 + + + + ⋯
1! 2! 3!

Terms e.5 /𝛜a/ Remarks


1 1 n/a
2 1.5 33.33% n=0
3 1.625 7.69% n=0
4 1.646 1.28% n=1
5 1.648 0.12% n=2
The Maclaurin series expansion for cos x is

cos x = 1 – (x2 /2) + (x4 /4!) – (x6 /6!) +(x8 /8!) - …

Starting with the simplest version, cos x = 1, add terms one at a


𝜋
time to estimate cos( ). After each new term is added, compute
3
the true and percent approximate relative errors. Use your pocket
calculator to determine the true value. Add terms until the absolute
value of the approximate error estimate falls below an error
criterion conforming to two significant figures.

You might also like