By: Habtamu Garoma 3/27/2017
NUMERICAL ANALYSIS I
(MATH 2061)
For: Second Year Mathematics Student
By:Habtamu Garoma
Email address: habte200@[Link]
1
By: Habtamu Garoma 3/27/2017
Numerical analysis
o is the branch of mathematics that is used to
find approximations to difficult problems
such as:
finding the roots of non−linear equations
integration involving complex expressions
solving differential equations for which
analytical solutions do not exist
2
3/27/2017
o It is applied to a wide variety of disciplines
such as :
-business
-all fields of engineering
-computer science
-education
-geology
-meteorology and others.
o It is the area of mathematics and computer
science that creates, analyzes, and
implements algorithms for solving numerically
the problems of continuous mathematics.
3
By: Habtamu Garoma
By: Habtamu Garoma 3/27/2017
Chapter 1
Basic concepts in error
estimation
4
By: Habtamu Garoma 3/27/2017
Source of Error
Modeling Error
-Blunders
-Formulation Error
-Data uncertainty
Numerical Error
-Rounding Error
-Truncation Error
5
By: Habtamu Garoma 3/27/2017
Round off Error
which result when numbers having
limited significant figures are used to
represent exact numbers.
Caused by representing a number
approximately.
Example:
6
By: Habtamu Garoma 3/27/2017
TRUNCATION ERROR
Error caused by truncating or
approximating a mathematical
procedure.
Example of Truncation Error
1. Taking only a few terms of a
Maclaurin series to
7
3/27/2017
If only 3 terms are used,
2. Using a finite to approximate
8
By: Habtamu Garoma
By: Habtamu Garoma 3/27/2017
Using finite rectangles to approximate
an integral.
9
By: Habtamu Garoma 3/27/2017
Example 1: Maclaurin series
Calculate the value of with an absolute
relative approximate error of less than 1%.
6 terms are required. How many are required
to get at least 1 significant digit correct in
your answer?
10
By: Habtamu Garoma 3/27/2017
Example 2: Diffrentiation
Find for using
and
The actual value is
Truncation error is then,
Can you find the truncation error with
?
11
By: Habtamu Garoma 3/27/2017
Example 3: Integrations
Use two rectangles of equal width to
approximate the area under the curve
for f ( x) x 2 over the interval
12
By: Habtamu Garoma 3/27/2017
INTEGRATION EXAMPLE (CONT’D…)
Choosing a width of 3, we have
Actual value is given by
Truncation error is then
Can you find the truncation error with 4
rectangles?
13
By: Habtamu Garoma 3/27/2017
APPROXIMATIONS AND ROUND-OFF ERRORS
For many engineering problems, we cannot
obtain analytical solutions.
Numerical methods yield approximate results,
results that are close to the exact analytical
solution. We cannot exactly compute the errors
associated with numerical methods.
Only rarely given data are exact, since they
originate from measurements. Therefore
there is probably error in the input
information.
14
By: Habtamu Garoma 3/27/2017
CONT’D
o Algorithm itself usually introduces errors as
well, e.g., unavoidable round-offs, etc
o The output information will then contain
error from both of these sources.
How confident we are in our approximate
result?
The question is “how much error is
present in our calculation and is it
tolerable?”
15
By: Habtamu Garoma 3/27/2017
Accuracy: How close is a computed or
measured value to the true value
Precision (or reproducibility): How close is a
computed or measured value to previously
computed or measured values.
Inaccuracy (or bias): A systematic deviation
from the actual value.
Imprecision (or uncertainty): Magnitude of
scatter.
16
By: Habtamu Garoma 3/27/2017
17
By: Habtamu Garoma 3/27/2017
SIGNIFICANT FIGURES
Number of significant figures indicates
precision. Significant digits of a number are
those that can be used with confidence.
e.g., the number of certain digits plus one
estimated digit.
53,800 How many significant figures?
5.38 x 104 3
5.380 x 104 4
5.3800 x 104 5
18
By: Habtamu Garoma 3/27/2017
Zeros are sometimes used to locate the
decimal point not significant figures.
0.00001753 4
0.0001753 4
0.001753 4
Error Definitions
True Value = Approximation + Error
Et = True value – Approximation (+/-)
True error
19
By: Habtamu Garoma 3/27/2017
• For numerical methods, the true value
will be known only when we deal with
functions that can be solved analytically
(simple systems).
• In real world applications, we usually
not know the answer a priori. Then
20
By: Habtamu Garoma 3/27/2017
CON’D
Iterative Approach, example Newton's
method
Use absolute value.
Computations are repeated until
stopping criterion is satisfied
21
By: Habtamu Garoma 3/27/2017
CONT’D…
If the following criterion is met
you can be sure that the result is
correct to at least n significant
figures.
a) Inaccurate and imprecise; (b) accurate and
imprecise; (c) inaccurate and precise; (d) accurate
and precise
22
3/27/2017
Absolute and Relative Errors
Absolute Error ( Ea )
Absolute error= Exact value Approximate value
Relative Errors ( Er )
Exact value Approximate value
Er x 100%
Exact value
current approximation previous approximation
a X 100%
current approximation
23
By: Habtamu Garoma 3/27/2017
Round of Errors
Round-off errors: originate from the fact that
computers retain only a fixed number of
significant figures during a calculation.
Numbers such as π, e, or 7 cannot be
expressed by a fixed number of significant
figures.
Therefore, they cannot be represented
exactly by the computer.
24
FIGURE
How the (a) decimal (base 10) and the (b) binary (base 2) systems work. In (b), the
binary number 10101101 is equivalent to the decimal number 173.
FIGURE
The representation of the decimal integer −173 on a 16-bit computer using
the signed magnitude method.
FIGURE
The manner in which a floating-point number is stored in a word
CHOPPING
Example:
p=3.14159265358 to be stored on a base-10
system carrying 7 significant digits.
p=3.141592 chopping error t=0.00000065
If rounded
p=3.141593 t=0.00000035
Some machines use chopping, because rounding
adds to the computational overhead. Since
number of significant figures is large enough,
resulting chopping error is negligible.
3/27/2017
Propagation of Error
The purpose of this section is to study how
errors in numbers can propagate through
mathematical functions.
If we multiply two numbers that have errors,
we would like to estimate the error in the
product.
* Functions of a Single Variable
* Functions of More than One Variable
28
By: Habtamu Garoma 3/27/2017
Suppose that we have a function f (x) that is
dependent on a single independent variable x.
Assume that x is an approximation of x.
to assess the effect of the discrepancy between
x and on the value of the function.
We would like to estimate by
f ( x) f ( x) f ( x)
By expansion of Taylor’s series, we obtain:
f ( x) f ' ( x) x, where x x x
29
By: Habtamu Garoma 3/27/2017
FIGURE 4.7
Graphical depiction of first order error propagation
30
By: Habtamu Garoma 3/27/2017
Example: Given a value of x = 2.5 with an
error of x= 0.01, estimate the resulting error
in the function f ( x) x3 .
n
Ans: f(2.5) = 15.625 ± 0.1875
Functions of More than One Variable
For n independent variables x1 , x2 ,...., xn
having errors x , x ,..., x the following
1 2 n
general relationship holds:
f f f
f ( x1 , x2 ,..., xn ) x1 x2 ... xn
x1 x2 xn
31
Habtamu Garoma 3/27/2017
EXAMPLE 1
Find the bounds for the propagation in adding two
numbers. For example if one is calculating X +Y where
X = 1.5 ± 0.05
Y = 3.4 ± 0.04
Solution
Maximum possible value of X = 1.55 and Y = 3.44
Maximum possible value of X + Y = 1.55 + 3.44 = 4.99
Minimum possible value of X = 1.45 and Y = 3.36.
Minimum possible value of X + Y = 1.45 + 3.36 = 4.81
Hence
4.81 ≤ X + Y ≤ 4.99.
32
3/27/2017
EXAMPLE
The strain in an axial member of a
square cross-section is given by
Given
Find the maximum possible error in the
measured strain.
33
3/27/2017
Solution:
34
3/27/2017
CONT’D…
Thus
Hence
35
3/27/2017
EXAMPLE 3
Subtraction of numbers that are nearly equal
can create unwanted inaccuracies. Using the
formula for error propagation, show that this
is true.
Solution: Let
Then
So the relative change is
36
3/27/2017
CONT’D
For example if
= 0.6667
= 66.67%
37
3/27/2017
Numerical stability
refers to the accuracy of an algorithm
in the presence of rounding errors
• an algorithm is unstable if rounding
errors cause large errors in the result
rigorous definition depends on what
‘accurate’ and ‘large error’ mean
38
3/27/2017
39