Ch01 - NUMERICAL ERRORS

You might also like

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

Chapter 1

NUMERICAL ERRORS

Dr. Pham Minh Tuan


Definitions
 Numerical errors arise from the use of approximations to represent exact mathematical
operations and quantities.

 These include truncation errors, which result when approximations are used to represent
exact mathematical procedures, and round-off errors, which result when numbers having
limited significant figures are used to represent exact numbers.
True value = approximation + error

 Exact value of the error/true error (Et):

Et = true value − approximation

 True percent relative error (εt):

εt = (Et/true value)×100%
Example 1
Suppose that you have the task of measuring the lengths of a bridge and a rivet and come up
with 9999 and 9 cm, respectively. If the true values are 10,000 and 10 cm, respectively,
compute (a) the true error and (b) the true percent relative error for each case.

SOLUTION
(a) The error for measuring the bridge is: Et = 10,000 − 9999 = 1 cm
and for the rivet it is: Et = 10 − 9 = 1 cm

(b) The percent relative error for the bridge is: εt = (1/10,000)×100% = 0.01%
and for the rivet it is: εt = (1/10)×100% = 10%

Comments: both measurements have an error of 1 cm, the relative error for the rivet is much
greater.
Exercises
The measured speed of a robot is v = 2.8 m/s with a relative error
of δv = 0.5%. What is the true error of the robot’s speed?
∆ v =δv × v =0.5% × 2.8 =0.014 ( m s )

With a = 1.85 and its true error Δa = 0.0023, compute the relative
error δa.

∆a 0.0023
δa = × 100% = × 100% =0.12%
a 1.85
Definitions (cont.)
 In actual situations, the true value is rarely available. For numerical methods, the true
value will be known only when we deal with functions that can be solved analytically.
 However, in real-world applications, we will obviously not know the true answer a
priori. For these situations, an alternative is to normalize the error using the best
available estimate of the true value.
 Approximate percent relative error (εa):

 The iterative computation is repeated until the percent absolute value of εa is lower than a
prespecified percent tolerance (εs):

|εa| < εs = (0.5 × 102 − n)%


where n denotes the number of significant figures.
Example 2
In mathematics, the exponential function can be computed using Maclaurin series expansion,
given as:

As more terms are added in sequence, the approximation becomes a better and better estimate
of the true value of ex.
Starting with the simplest version, ex = 1, add terms one at a time to estimate e0.5. After each
new term is added, compute the true and approximate percent relative errors. Note that the true
value is e0.5 = 1.648721…
Add terms until the absolute value of the approximate error estimate εa falls below a
prespecified error criterion εs conforming to three significant figures.
Example 2 (cont.)
SOLUTION
 The error criterion that ensures a result is correct to at least three significant figures:
εs = (0.5 × 102 − 3)% = 0.05%
 The first estimate: ex = 1
 The second estimate: ex = 1 + x
For x = 0.5  ex = 1 + 0.5 = 1.5
True percent relative error:

Approximate percent relative error:

 The process is continued until εa < εs:


Decimal number representation
 Round-off errors originate from the fact that computers retain only a fixed number of
significant figures during a calculation.
 A decimal number, a, can be rounded to ã with a specific number of significant figures.
The true error (θã) of a and ã is called round-off error:
θã = |a – ã|
 A decimal number can be represented by the base-10 number system.
For example, r = 12.3456 can be expressed as:
r = 1 × 101 + 2 × 100 + 3 × 10−1 + 4 × 10−2 + 5 × 10−3 + 6 × 10−4
 The decimal number (a) with a specific number of significant figures can well represent
to the real number (A) when their true error (Δa) satisfies the following condition:

Δa = |a – A| ≤ 0.5 × 10k
where k represent the order of a digit from the decimal point (k ≥ 0 for digits in the
number part, k < 0 for digits in the decimal part).
Example 3
 A decimal number u = 12.3456 with Δu = 0.001, determine the number of significant figures.

SOLUTION
 Considering the condition for the true error:
0.0005 = 0.5 × 10−3 ≤ Δu = 0.001 ≤ 0.5 × 10−2 = 0.005
 There are 4 significant figures in u (k = 1, 0, −1, −2 corresponding to 1, 2, 3, 4).
Exercises
Round the following numbers to 4 digits after the decimal point:

a = 2.672415328  ã = 2.6724

a = 1.547684001  ã = 1.5477

a ≤ 1.871321657  ã ≤ 1.8714

a ≥ 1.235454123  ã ≥ 1.2354
Exercises
Determine the significant figures for the following numbers:

a = 1.3452; Δa = 0.0023
Δa = 0.0023 ≤ 0.5×10−2 = 0.005  k = −2
 There are 3 significant figures in a (1, 3, 4)

a = 3.4167; δa = 0.25%
Δa = δa × a = 0.25% × 3.4167 = 0.0085
Δa = 0.0085 ≤ 0.5×10−1 = 0.05  k = −1
 There are 2 significant figures in a (3, 4)
End of Chapter 1

You might also like