0% found this document useful (0 votes)
60 views24 pages

Numerical Lecture Note Chap1 31048

This document provides an overview of numerical methods. It discusses what numerical methods are, why they should be studied, and how mathematical models can be formulated. It also covers the major sources of errors and approximations involved in numerical methods, including accuracy, precision, and types of errors. Conservation laws that are important in engineering and science are also explained.

Uploaded by

Abi Dem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views24 pages

Numerical Lecture Note Chap1 31048

This document provides an overview of numerical methods. It discusses what numerical methods are, why they should be studied, and how mathematical models can be formulated. It also covers the major sources of errors and approximations involved in numerical methods, including accuracy, precision, and types of errors. Conservation laws that are important in engineering and science are also explained.

Uploaded by

Abi Dem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Numerical Methods

Mathematical Modeling,
Errors and Approximations in Computation

Mikiyas G/samuel

Department of Mathematics
College of Natural Sciences
Arba Minch University
[email protected]

February 18, 2021

Abstract
Module Summary: The purpose of this module is to show you how
mathematical models can be formulated and introduce you with the major
sources of errors & their approximations involved in numerical methods.
Table of Contents

1 Motivation
What are numerical methods?
Why should you study numerical methods?

2 Mathematical Modeling
A Simple Mathematical Model
Conservation Laws in Engineering and Science

3 Basic Concepts in Error Estimation


Sources of Errors and Approximations in Computation
Accuracy, Precision, Types of Errors
General Formula of errors
Inverse Problems of the theory of errors
References

Mikiyas G/samuel (MSc.) Numerical Methods 1 / 23


Motivation
1 What are numerical methods?
Numerical methods are techniques by which mathematical problems are
formulated so that they can be solved with arithmetic and logical
operations.
Because digital computers do well at performing such operations,
numerical methods are sometimes referred to as computer
mathematics.
2 Why should you study numerical methods?
Numerical methods greatly expand the types of problems you can
address, are capable of handling large systems of equations,
nonlinearities, and complicated geometries that are common in
engineering and science and that are often impossible to solve
analytically with standard calculus.
Numerical methods are an efficient vehicle for learning to use
computers. Because numerical methods are expressly designed for
computer implementation.
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.
Mikiyas G/samuel (MSc.) Numerical Methods 2 / 23
Mathematical Modeling
A mathematical model can be broadly defined as a formulation or
equation that expresses the essential features of a physical system or
process in mathematical terms.
In general, it can be represented as a functional relationship of the
form:
 
Dependent independent forcing
=f , parameters ,
variable variables functions

where,
the dependent variable is a characteristic that reflects the behavior or
state of the system:
the independent variables are usually dimensions, such as time and
space.
the parameters are reflective of the system’s properties or
composition; and
the forcing functions are external influences acting upon it.
Note: the above mathematical expression can range from a simple
algebraic relationship to large complicated sets of differential equations.
Mikiyas G/samuel (MSc.) Numerical Methods 3 / 23
Cont...
For example, on the basis of his observations, Newton formulated his
second law of motion, which states that the time rate of change of
momentum of a body is equal to the resultant force acting on it. The
mathematical expression, or model, of the second law is the
well-known equation

F = ma (1)

where F is the net force acting on the body (kg m/s2 ), m is the mass
of the object (kg), and a is its acceleration (m/s2 ).
By dividing both sides by m, the second law can be written as:
F
a= (2)
m
Here, a is the dependent variable reflecting the system’s behavior, F
is the forcing function, and m is a parameter. Note that for this
simple case there is no independent variable because we are not yet
predicting how acceleration varies in time or space.
Mikiyas G/samuel (MSc.) Numerical Methods 4 / 23
Cont...
Equation (2) has a number of characteristics that are typical of
mathematical models of the physical world.
It describes a natural process or system in mathematical terms.
It represents an idealization and simplification of reality. That is, the
model ignores negligible details of the natural process and focuses on
its essential manifestations. Thus, the second law does not include
the effects of relativity that are of minimal importance when applied
to objects and forces that interact on or about the earth’s surface at
velocities and on scales visible to humans.
Finally, it yields reproducible results and, consequently, can be used
for predictive purposes. For example, if the force on an object and
its mass are known, Eq. (2) can be used to compute acceleration.
Because of its simple algebraic form, the solution of Eq. (2) can be
obtained easily. However, other mathematical models of physical
phenomena may be much more complex, and either cannot be solved
exactly or require more sophisticated mathematical techniques than
simple algebra for their solution.
Mikiyas G/samuel (MSc.) Numerical Methods 5 / 23
Cont...
Fore example, If we consider the model for a falling object which encounters air
resistance that is proportional to its velocity ν. Then, the rate of change of the
velocity is given by:

= kν − 9.8
dt
, where the acceleration due to gravity is −9.8 m/sec2 and k is constant. if the
object is initially at rest (v = 0 at t = 0), a simple calculus can be used to solve
the above equation as a function of time t for:

v(t) = 9.8(1 − ekt )

.
This is called an analytical or exact solution because it exactly satisfies the
original differential equation. Unfortunately, there are many mathematical models
that cannot be solved exactly. In many of these cases, the only alternative is to
develop a numerical method that approximates the exact solution.
Numerical methods are those in which the mathematical problem is reformulated
so it can be solved by arithmetic operations.
We’ll discuss it in more detail when we turn to differential equations later in this
course.
Mikiyas G/samuel (MSc.) Numerical Methods 6 / 23
Conservation Laws
Conservation laws are major organizing principles in science and engineering.
They all reduce to:

Change = increases − decreases. (3)

Eq. (3) is one of the most fundamental ways in which conservation laws are used in
engineering and science-that is important to predict changes with respect to time.
If change is zero, Eq. (3) becomes

Change = 0 = increases − decreases


or (4)
increases = decreases

Thus, if no change occurs, the increases and decreases must be in balance. This
case, which is also given a special name-the steady-state calculation-has many
applications in engineering and science.

Mikiyas G/samuel (MSc.) Numerical Methods 7 / 23


Cont...
For example, for steady-state incompressible fluid flow in pipes, the flow into a
junction must be balanced by flow going out,

Flow in = flow out. (5)

For the junction in Fig. 1, the balance equation can be used to compute that the
flow out of the fourth pipe must be 60.

Mikiyas G/samuel (MSc.) Numerical Methods 8 / 23


Cont...
some models and associated conservation laws that figure prominently in
engineering.
1 Many chemical engineering problems involve mass balances for reactors. The mass
balance is derived from the conservation of mass.

change of
the amount of mass the amount of mass
mass of a chemical = −
flowing in flowing out
in the reactor

2 Civil and mechanical engineers often focus on models developed from the
conservation of momentum. For civil engineering, force balances are utilized to
analyze structures such as the simple truss presented below. The same principles are
employed for the mechanical engineering case studies to analyze the transient
up-and-down motion or vibrations of an automobile.

Mikiyas G/samuel (MSc.) Numerical Methods 9 / 23


Cont...
Devices and types of balances that are commonly used in the major areas of engineering:

Mikiyas G/samuel (MSc.) Numerical Methods 10 / 23


Sources of Errors and Approximations in Computation
Engineers and scientists constantly find themselves having to accomplish objectives
based on uncertain information. Although perfection is their goal, it is rarely if ever
attained.
For example, consider the model developed from Newton’s second law,

F = mg (6)

1 Eq, 6 is an excellent approximation.


2 it could never in practice exactly predict the jumper’s fall.
3 A variety of factors such as winds and slight variations in air resistance would
result in deviations (error) from the prediction.
If these deviations are systematically high or low, then we might need to develop a
new model. However, if they are randomly distributed and tightly grouped around
the prediction, then the deviations (error) might be considered negligible and the
model becomes adequate.

Mikiyas G/samuel (MSc.) Numerical Methods 11 / 23


Accuracy, Precision, Types of Errors
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 agree with
each other.
Numerical errors arise from the use of approximations to represent exact
mathematical operations and quantities. For such errors, the relationship between
the exact and the approximation can be formulated as:

Error = True value − approximation. (7)

Types of Errors
1 Inherent Error:

is the error due to the simplified assumptions of the formulated mathematical problem
or due to the errors in the physical measurements of the parameters of the problem.
2 Round-off error:
arise because digital computers cannot represent some quantities exactly.
There are two major facets of round-off errors involved in numerical calculation
1 Digital computers have size and precision limits on their ability to represent numbers.
2 Certain numerical manipulations are highly sensitive to round-off errors.
3 Truncation errors: are those that result from using an approximation in place of an
exact mathematical procedure.
Mikiyas G/samuel (MSc.) Numerical Methods 12 / 23
Cont...
Example 1: Consider the mathematical description of
the simple pendulum oscillation:

1 The model is not exact, because


mlθ̈ = −mg sin(θ) (8)
air resistance and friction at the
where, pivot are neglected and as a
l - length of the pendulum road, consequence the coefficient of
m - mass of the bob, friction is considered as linearly
θ - initial angle of the displacement from the vertical, dependent on the velocity. And
g - acceleration due to gravity, and these errors are inherent.
t - the time required for the pendulum bob to swing
2 The differential equation can
through one complete cycle and returns to its original not be solved explicitly and will
position. require some numerical
methods. And this generates the
errors due to truncation.
3 Determination of l, g and m are
not exactly correct and
computation of these is not
exact and hence computation
error will be produced.

Mikiyas G/samuel (MSc.) Numerical Methods 13 / 23


Cont...
Example 2:
1 A simple rational number with a finite number of digits like 2−6 = 0.015625 would
have to be stored as 1.5 × 10−2 or 0.015 which is in chopping form or 1.6 × 10−2 or
0.016 which is called rounding form.
2 The approximation for ex by Maclaurin series expansion, i.e:

x2 x3
ex = 1 + x + + + ... (9)
2 3!
results in a truncation error.

Formulas for Errors


If x
e is an approximate value of a quantity whose exact value is x, then:
1 Absolute error, εa
εa = |x − x
e| (10)
2 Relative error, εr
|x − x
e| εa
εr = = (11)
x x
3 Percentage error, εp

|x − x
e|
εp = × 100% = εr × 100% (12)
x
Mikiyas G/samuel (MSc.) Numerical Methods 14 / 23
Cont...
Example 1:
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
absolute error, εa , (b) the relative error εr and (c) the percentage error, εp for each case.
Solution:
(a) The absolute error for measuring the bridge is |10 − 9| 1
εr = = = 0.1 cm
ε = |x − x e| 10 10
a
= |10, 000 − 9999| = 1 cm (c) The percentage error for the bridge is

and for the rivet it is: εp = εr × 100% = 0.0001 × 100% = 0.01%

εa = |10 − 9| = 1 cm and for the rivet it is:

(b) The relative error for the bridge is εp = 0.1 × 100% = 10%

|x − xe| Thus, although both measurements have an error of


εr =
x 1 cm, the relative error for the rivet is much greater.
|10, 000 − 9999| 1 We would conclude that we have done an adequate
= = = 0.0001 cm
10, 000 10, 000 job of measuring the bridge, whereas our estimate for
the rivet leaves something to be desired.
and for the rivet it is:

Mikiyas G/samuel (MSc.) Numerical Methods 15 / 23


Cont...
Example 3. let x = 0.3000 × 104 and x
e = 0.3100 × 104 , then:
Example 2. let x = 0.3000 × 10−3 and x
e = 0.3100 × 10−3 ,
then: εa = |x − x
e|
= 0.3000 × 104 − 0.3100 × 104

εa = |x − x
e|
= 0.1000 × 103
= 0.3000 × 10−3 − 0.3100 × 10−3

= 0.0100 × 10−3 = 0.1000 × 10−4


|x − x
e|
εr =
x
|x − x
e|

0.3000 × 104 − 0.3100 × 104
εr = =
x 0.3000 × 104
0.3000 × 10−3 − 0.3100 × 10−3

= = 0.3333 × 10−1
0.3000 × 10−3
= 0.3333 × 10−1
|x − x
e|
εp = × 100%
x
|x − x
e|

0.3000 × 104 − 0.3100 × 104
εp = × 100% = × 100%
x 0.3000 × 104
0.3000 × 10−3 − 0.3100 × 10−3

−1
= × 100% = 0.3333 × 10 × 100%
0.3000 × 10−3
= 33.33 × 10−1 %
= 0.3333 × 10−1 × 100%
−1
= 33.33 × 10 % Exercise: discus why the same εr and εp occurs for widely
varying εa in both examples.

Mikiyas G/samuel (MSc.) Numerical Methods 16 / 23


Cont...
Example 4. If π = 22 7 is approximated as 3.14, find the
absolute error, relative error and relative percentage error.
Sol. Example 5. The number x = 37.46235 is rounded off to four
significant figures. Compute the absolute error, relative error
εa = |x − x e| and the percentage error.

22

Sol: We have x = 37.46235; x e = 37.46000
= − 3.14
7 εa = |x − x
e|

22 − 21.98
= = |37.46235 − 37.46000|
7
= 0.00235
0.02
= = 0.002857.
7
|x − x
e|
εr =
x
|x − xe| 0.00235
εr = =
x 37.46235
0.002857
= = 6.27 × 10−5 .
22/7
= 0.0009.
|x − x
e|
εp = × 100%
x
|x − x
e| = 6.27 × 10−5 × 100%
εp = × 100%
x
= 6.27 × 10−3 %.
= 0.0009 × 100%
= 0.09%.

Mikiyas G/samuel (MSc.) Numerical Methods 17 / 23


General Formula of errors
Here, we will see the general formula for the error raised in using a certain formula for a functional relation.
Let
u = f (x1 , x2 , ..., xn ) (13)
and let the error in each xi be ∆xi , then the error ∆u in u is given by:

u + ∆u = f (x1 + ∆x1 , x2 + ∆x2 , ..., xn + ∆xn ). (14)

Expand R.H.S of the above equation using Taylor series, we have


 
∂u ∂u
u + ∆u = f (x1 , x2 , ..., xn ) + ∆x1 + ... + ∆xn
∂x1 ∂x n
∂2u ∂2u ∂2u
 
1
+ (∆x1 )2 2 + ... + (∆xn )2 2 + 2∆x1 ∆x2 + ... + ... (15)
2 ∂x1 ∂xn ∂x1 ∂x2

Assume all ∆xi ’s are small fractions and  1, the the terms containing (∆xi )2 and higher powers of ∆xi will be neglected and Eq.
∆xi
xi
15 can be rewritten as:  
∂u ∂u
u + ∆u = f (x1 , x2 , ..., xn ) + ∆x1 + ... + ∆xn . (16)
∂x1 ∂xn
This implies,  
∂u ∂u
∆u = ∆x1 + ... + ∆xn (17)
∂x1 ∂xn
is the general formula for errors.
By taking modulus and dividing both sides of Eq. 17 by u we get, maximum absolute error:

∂u ∂u
(εa )max = |∆u| ≤ ∆x1 + ... + ∆xn . (18)
∂x1 ∂xn

and maximum relative error


∆u ∆x1 ∂u
+ ... + ∆xn ∂u .

(εr )max = ≤ (19)
u u ∂x1 u ∂xn
respectively.
Mikiyas G/samuel (MSc.) Numerical Methods 18 / 23
Error in Addition & Subtraction of Numbers
2. Error in Subtraction of Numbers
If
1. Error in Addition of Numbers
u = x1 − x2
If
u = x1 + x2 + ... + xn then:

then: u + ∆u = (x1 + ∆x1 ) − (x2 + ∆x2 )


= (x1 − x2 ) + (∆x1 − ∆x2 )
u + ∆u = (x1 + ∆x1 ) + (x2 + ∆x2 ) + ... + (xn + ∆xn )
= (x1 + ... + xn ) + (∆x1 + ... + ∆xn ) and
εa = ∆u = ∆x1 − ∆x2 .
and
εa = ∆u = ∆x1 + ... + ∆xn . Dividing both sides by u we get,

Dividing both sides by u we get, ∆u ∆x1 ∆x2


εr = = − .
u u u
∆u ∆x1 ∆xn
εr = = + ... + and Taking modulus on both sides of εa and εr , we have
u u u
∆u ∆x1 ∆xn
(εr )max = ≤ + ... + (εa )max = |∆u| ≤ |∆x1 | + |∆x2 | and
u u u
∆u ∆x1 ∆x2
(εr )max = ≤ +
u u u

Mikiyas G/samuel (MSc.) Numerical Methods 19 / 23


Error in Product & in Division of Numbers
and

∆u ∆x1
+ ... + ∆xn and

(εr )max = ≤
1. Error in Product of Numbers u x1 xn

∆u ∆u
Let u = x1 x2 ...xn , then using general formula for error εr = u = × (x1 x2 ...xn )
u u
∂u ∂u
∆u = ∆x1 + ... + ∆xn and
∂x1 ∂xn
2. Error in Division of Numbers
∆u ∆x1 ∂u ∆xn ∂u
= + ... + . Let u = xx21 , then again using general formula for error
u u ∂x1 u ∂xn
Now, ∂u ∂u
∆u = ∆x1 + ∆x2 and
∂x1 ∂x2
1 ∂u x2 x3 ...xn 1 ∆u ∆x1 ∂u ∆x2 ∂u
= = = + .
u ∂x1 x1 x2 x3 ...xn x1 u u ∂x1 u ∂x2
1 ∂u x1 x3 ...xn 1 ∆x1 1 ∆x2

−x1

= = = x1 × + x1 ×
u ∂x2 x1 x2 x3 ...xn x2 x2 2
x2
x2 x2
.. ..
. . ∆x1 ∆x2
1 ∂u x1 x2 x3 ...xn−1 1 = − .
= = x1 x2
u ∂xn x1 x2 x3 ...xn xn
Therefore,
Therefore,
∆u ∆x1 ∆xn ∆u ∆x1 ∆x2
= + ... + . (εr )max = ≤ + and
u x1 xn u x x2
1
∆u
εr = |∆u| ≤ u
u

Mikiyas G/samuel (MSc.) Numerical Methods 20 / 23


Cont...
Hence
S = 6.614
5xy 2
Example 1. let u = z3
, find (εa )max and (εr )max .
Sol: and
εa = 0.0005 + 0.0005 + 0.0005 = 0.0015
∂u 5y 2
= 3 (Because 12 × 10−3 = 0.0005). Also the total absolute error shows
∂x z
∂u 10xy that the sum is correct up to 3 significant figures.
= 3 Therefore
∂y z
S = 6.61
∂u −15xy 2
= and
∂z z4 0.0015
εr = = 0.0002
and 6.61
.
5y 2 10xy −15xy 2
∆u = ∆x + ∆y 3 + ∆z . Example 3. If ∆x = 0.005, ∆y = 0.001, be the absolute errors in
z3 z z4 x = 2.11 and y = 4.15, find the relative error in the computation of
Therefore, x + y.
Sol: We have x = 2.11; y = 4.15
5y 2 10xy −15xy 2


(εa )max = |∆u| = ∆x 3 + ∆y 3 + ∆z therefore,
z z z 4 .
x + y = 2.11 + 4.15 = 6.26,
Now let ∆x = ∆y = ∆z = 0.001 and x = y = z = 1 then the
∆x = 0.005, ∆y = 0.001
relative maximum error is given by
∆x + ∆y = 0.005 + 0.001 = 0.006.
(εa )max 0.03
(εa )max = = = 0.006. Therefore, the relative error in (x + y) is:
u 5
√ √ √
Example 2. Calculate the sum S of 3, 5 and 7 to four ∆x + ∆y
εr =
significant digits and find its absolute and relative errors. (x + y)
Sol. Here, √ √ √ 0.006
= = 0.000958.
3 = 1.732, 5 = 2.236, 7 = 2.646 6.25
The relative error in (x + y) = 0.001 (approximately).

Mikiyas G/samuel (MSc.) Numerical Methods 21 / 23


Inverse Problems of the theory of errors
To find the error in u = f (x1 , ..., xn ), evaluate the errors Sol: The percentage error in R is
∆x1 , ..., ∆xn in x1 ..., xn we have
∆R
∂u ∂u R= × 100% = 0.2%
∆u = ∆x1 + ... + ∆xn R
∂x1 ∂xn
Therefore,
Using the principles of equal effects, which states
4.52
 
0.2 0.2 5.5 0.002 × 50.50
∂u ∂u ∂u ∆R = ×R= × + =
∆x1 = ∆x2 = ... = ∆xn 100 100 2 × 5.5 2 11
∂x1 ∂x2 ∂xn
this implies that ∆r
Percentage in r = × 100%
∂u ∆u r !
∆u = n∆x1 or ∆x1 = ∂u 100 ∆R
∂x1 n ∂x1 = ×
r ∂R
2 ∂r
∆u
∆x2 = ∂u 100 ∆R
n ∂x2 = ×
2 hr

r
...
100 (∆R) h
∆u =
∆xn = ∂u
2r2
n ∂xn 100 0.002×50.50

5.5
11
= 2 = 0.12%
Example. The percentage error in R which is given by 2 (4.5)
r2
R = 2h + h2 , is not allowed to exceed 0.2%, find allowable
Percentage error in h (exercise!).
error in r and h where r = 4.5cm and h = 5.5cm.

Mikiyas G/samuel (MSc.) Numerical Methods 22 / 23


References
Jaan Kiusalaas, Numerical Methods in Engineering with MATLAB, first
edition, 2005.
Ralston, Antony, A first course in Numerical Analysis (2nd ed), Feb,6,2001
Recktenwald, Gerald. Numerical Methods with MATLAB, prentice Hall, 2000.

Mikiyas G/samuel (MSc.) Numerical Methods 23 / 23

You might also like