0% found this document useful (0 votes)
21 views23 pages

Numerical Methods Introduction To Numerical Methods

This document introduces numerical methods. It aims to define accuracy and precision, compute relative errors, approximate functions using Taylor series, and define numerical errors like truncation and round-off errors. Numerical methods provide approximate solutions to mathematical problems using digital computers and are able to handle nonlinearities, complex geometries, and large systems of coupled equations. Numerical errors occur during computation and can be characterized by accuracy and precision measurements.
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)
21 views23 pages

Numerical Methods Introduction To Numerical Methods

This document introduces numerical methods. It aims to define accuracy and precision, compute relative errors, approximate functions using Taylor series, and define numerical errors like truncation and round-off errors. Numerical methods provide approximate solutions to mathematical problems using digital computers and are able to handle nonlinearities, complex geometries, and large systems of coupled equations. Numerical errors occur during computation and can be characterized by accuracy and precision measurements.
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/ 23

Numerical Methods

Introduction to Numerical Methods

By

Norhayati Rosli & Nadirah Mohd Nasir


Faculty of Industrial Sciences & Technology
[email protected], [email protected]

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Description

AIMS
This chapter is an introduction to the numerical methods. It is aimed to:
1. introduce the concept of precision and accuracy.
2. compute the approximate and true percent relative errors.
3. approximate the functions by using Taylor’s series.
4. define the concept of round-off error, truncation error and total numerical error.

EXPECTED OUTCOMES

1. Students should be able to define the concept of accuracy and precision.


2. Students should be able to compute the approximate percent relative error and the true percent relative
error.
3. Students should be able to approximate the values of the functions by using Taylor’s series expansion.
4. Students should be able to define two types errors involve in numerical methods.

REFERENCES

1. Norhayati Rosli, Nadirah Mohd Nasir, Mohd Zuki Salleh, Rozieana Khairuddin, Nurfatihah Mohamad Hanafi,
Noraziah Adzhar. Numerical Methods, Second Edition, UMP, 2017 (Internal use)
2. Chapra, C. S. & Canale, R. P. Numerical Methods for Engineers, Sixth Edition, McGraw–Hill, 2010.

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Content

1 What are Numerical Methods?


2
Errors
3
Taylor’s Series Expansion
4
Truncation Error
5 Round-Off Error
6 Total Numerical Error

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
WHAT ARE NUMERICAL METHODS?

The approximate
It can be methods for solving a
implemented
directly on digital
4 1 wide variety of
mathematical
computers problems.

It capable to handle Numerical


nonlinearities, complex
geometries and large
Methods
The solutions that
system of coupled
equations of many real
physical situations that
3 2 obtained are called
the approximate
are difficult to be solved solutions.
analytically

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS

1 Numerical error
occurs during the
computational
process.
Error
Definition
It can be characterized
by two types of
measurements-
3 2 Error measure how
close the approximate
solution to the true or
accuracy and precision exact solution

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (Cont.)
Definition Accuracy & Precision

Accuracy

Imprecision
4 1 How close the
computed or
measured value to
Magnitude of scatter
the true value
Accuracy
&
Precision
Precision
How close a computed
value to previously
3 2 Inaccuracy
A systematic deviation
computed value from the actual value

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (CONT.)

The relationship between the True or Exact Value and the


Approximate Value can be formulated as:

True Value = Approximate Value + Numerical Error (1)

By rearranging, equation (1), the numerical error, 𝐸 𝑡 can be written as:

E (t )  True Value - Approximate Value

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (Cont.)

True percent relative error, 𝜀𝑡

True value  Approximate Value


t   100%
True value

Approximate percent relative error, 𝜀𝑎

Present Solution  Previous Solution


a   100%
Present Solution

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (Cont.)
The iterative process is computed until

a  s (2)

where 𝜀𝑠 is a prespecified percent tolerance.

 If the relationships (2) is hold, then the acceptable result has been
reached and no more iteration is required.

 The numerical result is assumed to be within the prespecified


acceptable level.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (Cont.)
Example 1
A civil engineer has measured the height of a 15 floor building as 3940 m and the
working height of each beam as 35 m while the true values are 3945 m and 40 m,
respectively. Compare their true error and true percent relative error.

Solution

True error in measuring the height of the building, 𝐸𝑡,1

Et ,1  3945  3940  5m

True percent relative error in measuring the height of the building, 𝜀𝑡,1

5
 t ,1   100%  0.13%
3945
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (Cont.)
Solution (Cont.)

True error in measuring the height of the beam

Et ,2  40  35  5m

True percent relative error in measuring the height of the beam

5
 t ,2   100%  13%
40
True percent relative error gives better measurement of the error compare
than true error

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ERRORS (Cont.)
Example 2: Error Estimate for Iterative Methods
Taylor’s series expansion of sin 𝑥 is given by
𝑥3 𝑥5 𝑥7 𝑥9 𝑥 11
sin 𝑥 = 𝑥 − + - + - +⋯
3! 5! 7! 9! 11!
𝜋
Estimate sin⁡ by adding terms one at a time to the above series. Iterate until
3
𝜋
𝜀𝑎 < 0.05%.⁡If given the true value of sin = 0.8660, compute the true percent
3
relative error, 𝜀𝑡 after each iteration.
Solution

𝒊 Approximate value 𝜀𝑎 𝜀𝑡

1 𝜋 𝜋 - 20.92%
sin = = 1.0472
3 3
2 𝜋 𝜋 𝜋3 22.37% 0.045% 𝜀𝑎 < 0.05%,
sin = − = 0.8558
3 3 3! hence stop
3 𝜋 𝜋 𝜋3
𝜋 5 1.21% 0.04% the
sin = − + 3 = 0.8663 computation
3 3 3! 5!
4 0.8660 0.04% 0%
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TAYLOR’S SERIES EXPANSION

Taylor series expansion


of functions is used
extensively in deriving
4 1 Taylor series is used
to approximate the
value of the known
numerical methods function

Taylor’s
Series
If only a few terms are
used, the value of the
function that is obtained
from the Taylor series is an
3 2 Function is
represented by a
sum of terms of a
approximation value convergent series

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TAYLOR’S SERIES EXPANSION
(Cont.)
A one dimensional Taylor series is a Taylor’s expansion for a function
𝑓 𝑥 that is differentiable 𝑛 + 1 times in an interval containing a point
𝑥 = 0.⁡

Taylor’s theorem state that for each 𝑥 in the interval, there exist a value
𝑥 = 𝛿 in between 𝑥 = 𝑥0 ⁡ and 𝑥.

Taylor’s series expansion of order 𝑛 is given by the formula


1 1
f ( x)  f ( x0 )  f '( x0 )( x  x0 )  f ''( x0 )( x  x0 ) 2  f (3) ( x0 )( x  x0 )3
2 3!
1 (n)
  f ( x0 )( x  x0 ) n  Rn ( x)
n!
where Rn ( x) is the remainder term.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TAYLOR’S SERIES EXPANSION
(Cont.)
The accuracy increase as 𝑥 is closer to 𝑥0 and as more terms are added
in the series.
The expansion of the Taylor’s series around 𝑥0 = 0 is called Maclaurin
series.

Examples of the Taylor’s series expansion for the selected functions are given
in Table 1.
Table 1: Taylor’s Series Expansions for the Selected Functions
𝒇(𝒙) Taylor Series Expansion of 𝒇(𝒙)
1 2 1 3
exp(𝑥) exp 𝑥0 [1 + 𝑥 − 𝑥0 + 2! 𝑥 − 𝑥0 + 3! 𝑥 − 𝑥0 + ⋯]
cos(𝑥) cos 𝑥0 − sin 𝑥0 𝑥 − 𝑥0 − 12 cos 𝑥0 𝑥 − 𝑥0 2 +1 sin
6 𝑥0 𝑥 − 𝑥0 3

+⋯
sin(𝑥) 𝑠𝑖𝑛 𝑥0 + 𝑐𝑜𝑠 𝑥0 𝑥 − 𝑥0 − 12 𝑠𝑖𝑛 𝑥0 𝑥 − 𝑥0 2 −1 cos
6 𝑥0 𝑥 − 𝑥0 3

+⋯
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TAYLOR’S SERIES EXPANSION
(Cont.)
Example 3
Approximate the function 𝑓(𝑥) = cos 𝑥 by using Taylor series expansion about 𝑥 = 0
using two, four and six terms. In each case calculate the approximate value of the
𝜋 𝜋
function at 𝑥 = and 𝑥 = .
12 3

Solution
Find the first five derivatives of the function and the value at 𝑥 = 0⁡of the respective
derivatives are substituted.
𝑛 Derivative of the Value of the
Function Derivative
0 𝑦 𝑥 = cos(𝑥) 𝑦 0 =1

1 𝑦 ′ 𝑥 = −sin(𝑥) 𝑦′ 0 = 0
Step 1 2 𝑦 ′′ 𝑥 = −cos(𝑥) 𝑦 ′′ 0 = −1

3 3 3
𝑦 𝑥 = sin(𝑥) 𝑦 0 =0
4 4 4
𝑦 𝑥 = cos(𝑥) 𝑦 0 =1
5 5 5
𝑦 𝑥 = −sin(𝑥) 𝑦 0 =0 Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TAYLOR’S SERIES EXPANSION
(Cont.)
Solution (Cont.)

Expanding the function in a Taylor series form and substituting


Step 2 the information in Step 1 in Taylor series

x2 x3 x4 x5
cos( x)  1  x(0)  ( 1)  (0)  (1)  (0)
2! 3! 4! 5!
x2 x4
 1 0   0   0
2! 4!

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TAYLOR’S SERIES EXPANSION
(Cont.)
Solution (Cont.)

The approximate values using two, four and six terms of Taylor
Step 3 series expansion are summarised in the following table.

𝝅
Number of The Approximate Values for 𝒙 = The Approximate Values for
𝟏𝟐 𝝅
Terms 𝒙=
𝟑
Two terms 𝜋 𝜋
𝑐𝑜𝑠 =1+0=1 𝑐𝑜𝑠 = 1+0=1
12 3

Four Terms 𝜋 2 𝜋 2
𝜋 𝜋
𝑐𝑜𝑠 = 1 − 12 = 0.9657305 𝑐𝑜𝑠 =1− 3
12 2 3 2
= 0.4516886
Six Terms 0.9659263 0.5017962
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TRUNCATION ERROR
Truncation error resulting from the truncation of the numerical process in
order to estimate finite number of terms from the sum of an infinite series.
It arises due to the approximation method is used instead of the exact
procedure.
As in Example 2, the numerical evaluation of sine function by using Taylor’s
series is terminated after a certain term. This contribute to the truncation
error.

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
ROUND-OFF ERROR
Computer approximation retain only a fixed number of significant figures
during a calculation.
1
Numbers such as 3 = 0.333333 … , 𝑒 = 2.71828182... and 𝜋= 3.1415926 …
cannot be expressed by a fixed number of significant figures.
Therefore they cannot be represented exactly by the computer and must
be round–off.
There are two situations in numerical computations where a number can
be shortened and lead to round off–errors which is either by chopping off or
by rounding.
Round off–errors can be reduced by increasing the numbers of significant
figures

Example 4
2
1
3
= 0.6666 if the actual number has been chopped off

2
2 = 0.6667 if the actual number has been rounded
3
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
TOTAL NUMERICAL ERROR

Includes round–off

2 Total
and truncation
errors

Sum of the
round–off and Numerical 1
truncation errors Error
yield the total of
numerical error

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Conclusion

Numerical method is an approximated method.


The solution obtained is a numerical or approximated solutions.
The solutions can be measured in two ways; accuracy and precision.
Accuracy concept contribute to the concept of true percent relative error.
Precision contribute to the concept of approximate percent relative error.
Two major errors involve in numerical methods are round-off and truncation
errors.
Taylor’s series is used to approximate the value of the function and being
used in deriving the numerical methods.
Sum of the round-off and truncation errors provide the total numerical error.

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Author Information
Norhayati Binti Rosli,
Nadirah Binti Mohd Nasir Senior Lecturer,
Lecturer Applied & Industrial Mathematics
Research Group,
Fakulti Sains & Teknologi Industri,
Faculty of Industrial Sciences &
Universiti Malaysia Pahang, Technology (FIST),
26300, Gambang, Pahang. Universiti Malaysia Pahang,
Google Scholar 26300 Gambang, Pahang.
: https://scholar.google.com/citatio SCOPUS ID: 36603244300
ns?user=-_qoGAsAAAAJ&hl=en UMPIR ID: 3449
email : [email protected] Google
Scholars: https://scholar.google.com/cit
ations?user=SLoPW9oAAAAJ&hl=en
e-mail: [email protected]

Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449

You might also like