Numerical 1
Numerical 1
E-mail: [email protected]
Web: http://akademik.duzce.edu.tr/tubakaragul
Course Content
Errors, root finding methods, interpolation, numerical derivative, integration and solutions of
differential equations
Learning Outcomes
To help the gain of how to do all computations which is done by hand in theoretical lessons by using
computers and how to be solved these problems by using computers.
Understands that numerical solving approaches rely on an algorithm structure.
Knows how the computer and software languages function in engineering life.
3
1.Week Introduction to Numerıcal Analysıs, Numerical Methods, Errors..
2. Week Building an algorithm and introducing the algorithm sub-units..
3. Week The matrices and matrix operations
4. & 5. Week Solution methods of linear equations systems
6. & 7. Week Solution methods of non-linear equations systems
8. Week Curve fitting
9. Week Interpolation and extrapolation methods
10. Week Numerical differentiation methods
11. Week Numerical integration methods
12. & 13. Week Solution Methods of differential equations
14. Week Complex numbers
4
Numerical Methods for Engineers, S.C.C, R.P.C (Çeviri-H. Heperkan, U. Keskin), Literatur
Practical numerical analysis, Gwyne A. Evans, John Wiley&Sons publishing, 1995. ISBN-
13: 978-0471955351
5
Event (%)
NOTE: The passing grade will be calculated using the absolute assessment method.
. Mathematical
Model
Curve Fitting
Numerical Integral
Numerical Derivative
the root
𝑑𝑦 1
= 𝑥 a y(x) function whose derivative is equal to x 𝑦 𝑥 = 𝑥2 + 𝐶
𝑑𝑥 2
𝑑𝑦
= 𝑦 a y(x) function whose derivative is equal to itself 𝑦 𝑥 = 𝐶𝑒 𝑥
𝑑𝑥
𝑦𝑦 ′ + 𝑥 = 0 … 𝑦(𝑥)2 + 𝑥 2 = 𝐶
𝑓′ 𝑎 𝑓′′ 𝑎 𝑓𝑛 𝑎
𝑓 𝑥 = 𝑓 𝑎 + (𝑥 − 𝑎) + 𝑥−𝑎 2 + ⋯+ (𝑥 − 𝑎)n
1! 2! 𝑛!
𝑥 𝑥2 𝑥𝑛
𝑓 𝑥 = 1 + + + ⋯+
1! 2! 𝑛!
𝑓′ 𝑒 𝑥 𝑓′′ 𝑒 𝑥 𝑓𝑛 𝑒 𝑥 𝑥 𝑥2 𝑥𝑛
𝑦 = 𝑒𝑥 + (𝑥) + 𝑥 2 +⋯+ (𝑥)n = 1 + + + ⋯+
1! 2! 𝑛! 1! 2! 𝑛!
ε= α- ά
Relative Error
Truncation Error
Approximation Error
Round-off Error
Tuba Karagül Yıldız 28
Operations with numbers are carried out according to the
11.10.2021 29
There are also 8 octal and 16 hexadecimal number systems. In
computers, on the other hand, the binary number system is used
because the computer architecture is built on 2-bit (binary)
systems. For example, the number 298 is stored in the computer
memory as follows:
298 =1x28 + 0x27 + 0x26 + 1x25 + 0x24 + 1x23 + 0x22 + 1x21 + 0x20
= (100101010)2
For example, the computer writes the fraction 1/3 using a certain number of
digits, such as 0.33333....
It is about how many digits are used to define numbers, how the numbers
are defined, and the architecture of the computer.
11.10.2021 32
As an example, the first four terms used to find the approximate value of
the function sin(x) do not give the correct answer. The reason for this error
is the use of a certain number of elements of the sinuse series. In iterative
methods, the amount of this error can be reduced according to the number
of iterations, but since it is not possible to reach the real result by using an
infinite number of terms, a value very close to the real result can be found
by using a certain number of terms. Such errors that occur due to the use of
a certain number of terms are called interrupt errors.
11.10.2021 33
Number
of terms Function Value .
11.10.2021 34
As can be seen, as the number of terms used increases, the
function will approach its analytical value. If the number of
terms is reduced, the amount of errors will increase. Since
an infinite number of steps cannot be used in computer
operations, the process must be stopped after a certain
number of terms have been used or when it reaches a
certain error interval.
These error quantities are typically defined using absolute
error, relative error, approximate relative error, and
sentiment errors.
11.10.2021 35
The error can be positive or negative. Therefore,
usually the absolute value of the error is used.
|ε|= |α- ά|
|ε| α−ά
𝑟= =
|α| |α|
|ε| α −ά
ѓ= =
|ά | |ά|
a=sin(0,5)=0,008726
=0,5-(0,125/6)+(0,03125/120)-
(0,0078125/5040)+(0,001953125/362880)
=0,5-0,020833+0,000260-0,000001+0,00000000538=0,479426
Tuba Karagül Yıldız 40
Absolute Error:
|e|=|a-a’|=| 0,008726 -0,479426|=0,470699
Relative Error:
|𝑒| 0,470699
r = = =53,942126
|𝑎| 0,008726
Solution:
𝑒 1,5 =4,4816890703380650..
𝑥2 𝑥3 𝑥4
𝑒 𝑥
=1+x+ + + +…
2! 3! 4!
Tuba Karagül Yıldız 43
(1,5)2 (1,5)3 2,25 3,375
a) 𝑒 1,5
=1+1,5+ + = 1+1,5+ + =1+1,5+1,125+0,5625
2! 3! 2 6
xa=4,1875
=1+1,5+1,125+0,5625+0,2109375+0,06328125
xa= 4,46171875
obtained step by step – iteratively are found. The value obtained in the
previous iteration is used in the new iteration to estimate the amount of
error proportionally.
|Ynew−Yold|
ε𝑦 =
|Ynew|
Ynew: Solution value obtained in the current iteration
…
A=2,3456738475 → 2,34567385
B=2,15550 → B=2,156
C=85,12449999 → C=85,124
D=0,71849999 → D=0,719
E=3,666666666 → E=3,667
50
Algorithms