Numerical Method For Enignerrs
Numerical Method For Enignerrs
1
Objectives
1. The objective of this course is to introduce the students to
numerical methods which can be used to solve mathematical
problems arising in engineering and science that cannot be solved
by exact methods.
By: Awash T.
2
Why Numerical Methods so widely used in Engineering?
3
A few applications of Numerical Methods in
Engineering:
• Communication/power
✓ Networksimulation
✓ Train and trafficnetworks
arithmetic approximation 5
Error analysis
Basic Concepts in Error Estimation
Sources of Error
Numerical results are affected by many types of errors. Some sources of
error are difficult to influence; others can be reduced or even eliminated
by, for example, rewriting formulas or making other changes in the
computationalsequence.
6
Sources of Numerical Error
1 .
0.333333
3
2 1.4142...
7
Problems created by round offerror
• 28 Americans were killed on February 25, 1991 by an Iraqi Scud missile in
Dhahran, Saudi Arabia.
• The patriot defense system failed to track and intercept the Scud. Why?
Problem with Patriot missile
• Clock cycle of 1/10 seconds was represented
in 24-bit fixed point register created an error
of 9.5 x 10-8 seconds.
• The battery was on for 100 consecutive
hours, thus causing an inaccuracy of
= 0.342s
s 3600s
= 9.5 10−8 100hr
0.1s 1hr
• The shift calculated in the ranging system of the missile was 687 meters.
• The target was considered to be out of range at a distance greater
than 137meters.
2)Truncation error
• Error caused by truncating or approximating a mathematical
procedure.
Example1 : Taking only a few terms of a Maclaurin series to ex
2 3
e x = 1+ x + x + x + ....................
2! 3!
𝑥2
If only 3 terms are used, Truncation 𝐸𝑟𝑟𝑜𝑟 = 𝑒 𝑥 − (1 + 𝑥 + 2!
)
Example2: Using a finite x to approximate f (x)
9
Using finite rectangles to approximate an integral.
90
y = x2
60
30
0 x
0 1.5 3 4.5 6 7.5 9 10.5 12
3)Measuring Errors
Why measure errors?
1) To determine the accuracy of numerical results.
2) To develop stopping criteria for iterative algorithms.
3.1 True Error
Defined as the difference between the true value in a calculation and the
approximate value found using a numerical method.
True Error = True Value – Approximate Value
Example:
The derivative, f (x)of a function f (x)
approximated by the equation,
f ' (x) f (x + h) − f(x)
h
If f (x) = 7e0.5x and h = 0.3
12
So the true value of f ' (2) is
True Error
Relative True Error ( t ) =
True Value
13
Example: Relative True Error
as a percentage,
t = −0.075888 100% = −7.5888%
14
3.2. Approximate Error
• What can be done if true values are not known or are very difficult to obtain?
15
Solution:
a) For x = 2 and h = 0.3
17
Relative Approximate Error
Defined as the ratio between the approximate error and the present
approximation.
Approximate Error
Relative Approximate Error ( a)=
Present Approximation
percentage of relative true error (% a ) =a *100
Example
For f (x) = 7e0.5x at x = 2 , find the relative approximate
error using values from h = 0.3 and h = 0.15
Solution:
From Example 3, the approximate value of f (2)= 10.263
using h = 0.3 and f (2)= 9.8800 using h = 0.15
Ea = Present Approximation – PreviousApproximation
= 9.8800 −10.263
= −0.38300
18
Solution:
Approximate Error
a =
Present Approximation
− 0.38300 = −0.038765
=
9.8800
as a percentage,
a = − 0 . 0 3 8 7 6 5 1 0 0 % = − 3 . 8 7 6 5 %
Absolute relative approximate errors may also need to be
calculated,
19
How is Absolute Relative Error used as a stopping criterion?
answer, then
20
Table of Values
21