Numerical-Methods-Learning-Module-1-24-2
Numerical-Methods-Learning-Module-1-24-2
Methods
This is a property of
PRESIDENT RAMON MAGSAYSAY STATE UNIVERSITY
NOT FOR SALE
CpE 221 – Numerical Methods
First Edition, 2021
Copyright. Republic Act 8293 Section 176 provides that “No copyright shall subsist in any work of
the Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such agency or
office may, among other things, impose as a condition the payment of royalties.
Borrowed materials included in this module are owned by their respective copyright holders. Every
effort has been exerted to reach and seek permission to use these materials from their respective
copyright owners. The University and authors do not claim ownership over them.
Assigned
Title Author
Chapter
Chapter 1: Introduction to Numerical Methods
Dionisio M. Martin Jr.
Chapter 2: Root Finding
Chapter 3: Systems of Equations
Evaluators:
At the end of the semester, 85% of the students have attained 90% level of understanding for
being aware in the engineering economics, locally and globally.
Course Details:
The University LMS will be used for asynchronous learning and assessment. The link and class
code for LMS will be provided at the start of class through the class’ official Facebook Group.
• Edmodo
• Google Classroom
• University LMS
Students will be assessed in a regular basis thru quizzes, assignments, individual/group outputs
using synchronous and/or asynchronous modalities or submission of SLM exercises. Rubrics
are also provided for evaluation of individual/group outputs.
Major examinations will be given as scheduled. The scope and coverage of the examination
will be based on the lessons/topics as plotted in the course syllabus.
0323
Module Overview
Introduction
This module aims to introduce the concepts of numerical analysis in dealing with engineering
problems and techniques in finding the root of an equations, solving linear and non-linear
equations, polynomial approximation and interpolation, and the ordinary differential equations.
Numerical methods are techniques by which mathematical problems are formulated so that
engineers can solved with different arithmetic operations. Although there are many kinds of
numerical methods, they have one common characteristic: they invariably involve large
numbers of tedious arithmetic calculations.
The students will learn how to solve mathematical problems using different arithmetic
operations at the end of each lesson/chapter.
Table of Contents
Chapter 1
Introduction to
Numerical Methods
Chapter 1
Numerical methods are techniques by which the mathematical problems involved with the
engineering analysis cannot readily or possibly be solved by analytical methods.
The use of some of these numerical methods that will not only enable engineers to solve many
mathematical problems, but will also allow engineers to minimize the needs for the many
hypotheses and idealization of the conditions.
Specific Objectives
Duration
_____________________________________________
INTRODUCTION
Numerical methods – are techniques by which mathematical problems are formulated so that
they can be solved with arithmetic operations.
– are techniques to approximate mathematical procedures (example of a mathematical
procedure is an integral). Approximations are needed because we either cannot solve the
procedure analytically.
– are complete and unambiguous set of procedures for the solution of a problem,
together with computable error estimates.
– are essentially “trail-and-error” processes because typically, students need to estimate
an initial solution with selected increment of the variable to which the intended solution will
cover.
In any numerical analysis, errors will arise during the calculations. To be able to deal with
the issue of errors, it is need to
1. identify where the error is coming from, followed by
2. quantifying the error, and lastly
3. minimize the error as per needed.
Error Definition
Numerical errors arise from the use of approximations to represent exact mathematical
operations and quantities. There are two types of errors that are inherent with numerical
solutions:
(a) truncation errors – result when approximations are used to represent exact
mathematical procedures
– the error incurred when limiting the accuracy and/or running-time of
a procedure that requires an impractical amount of time (possibly infinite) in
order to obtain the exact true answer
(b) round-off errors – result when numbers having limited significant figures are used
to represent exact numbers
– the error incurred when representing a number with fewer digits than
are required to completely capture its exact numerical value
True error – is denoted by 𝐸𝑡 is the difference between the true value (also called the exact
value) and the approximate value.
𝑇𝑟𝑢𝑒 𝐸𝑟𝑟𝑜𝑟 = 𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 – 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑣𝑎𝑙𝑢𝑒
𝐸𝑡 = 𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 – 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑣𝑎𝑙𝑢𝑒
Relative true error – is denoted by 𝑡 and is defined as the ratio between the true error and
the true value.
𝑡𝑟𝑢𝑒 𝑒𝑟𝑟𝑜𝑟
𝑅𝑒𝑙𝑎𝑡𝑖𝑣𝑒 𝑡𝑟𝑢𝑒 𝑒𝑟𝑟𝑜𝑟 =
𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
𝑡𝑟𝑢𝑒 𝑒𝑟𝑟𝑜𝑟
𝑡 = 100%
𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
Example 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 true error and (b) the true percent relative error for each case.
Solution:
(a) The error for measuring the bridge is
𝐸𝑡 = 10,000 − 9999 = 𝟏 𝒄𝒎
and for the rivet it is
𝐸𝑡 = 10 − 9 = 𝟏 𝒄𝒎
(b) The percent relative error for the bridge is
1
𝑡 = 100% = 𝟎. 𝟎𝟏%
10,000
and for the rivet it is
1
𝑡 = 100% = 𝟏𝟎%
10
Example 2. The derivative of a function 𝑓(𝑥) at a particular value of 𝑥 can be approximately
calculated by
𝑓(𝑥+ℎ)−𝑓(𝑥)
𝑓′(𝑥) ≈ ℎ
= 𝟏𝟎. 𝟐𝟔𝟓
b) The exact value of 𝑓’(2) can be calculated by using our knowledge of differential
calculus.
𝑓(𝑥) = 7𝑒 0.5𝑥
𝑓(𝑥) = (7)(0.5)(𝑒 0.5𝑥 )
= 3.5𝑒 0.5𝑥
So the true value of 𝑓’(2) is
𝑓(𝑥) = 3.5𝑒 0.5(2)
= 𝟗. 𝟓𝟏𝟒𝟎
c) True error is calculated as
𝐸𝑡 = 𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 – 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑣𝑎𝑙𝑢𝑒
= 9.5140 − 10.265
= − 𝟎. 𝟕𝟓𝟎𝟔𝟏
For 𝑓(𝑥) = 7𝑒 0.5𝑥 and ℎ = 0.3, find the relative true error at 𝑥 = 2.
Solution:
𝐸𝑡 = 𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 – 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑣𝑎𝑙𝑢𝑒
= 9.5140 − 10.265
= − 0.75061
Relative true error is
𝑡𝑟𝑢𝑒 𝑒𝑟𝑟𝑜𝑟
𝑡 = 𝑡𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒
−0.75061
= 9.5140
Approximation Error – is denoted by 𝐸𝑎 and is defined as the difference between the present
approximation and previous approximation.
𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝐸𝑟𝑟𝑜𝑟 = 𝑃𝑟𝑒𝑠𝑒𝑛𝑡 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 – 𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝐸𝑎 = 𝑃𝑟𝑒𝑠𝑒𝑛𝑡 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 – 𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
Relative approximate error – is denoted by 𝑎 and is defined as the ratio between the
approximate error and the present approximation.
𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒 𝑒𝑟𝑟𝑜𝑟
𝑎 = 100%
𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝑃𝑟𝑒𝑠𝑒𝑛𝑡 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 − 𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝑎 = 100%
𝑃𝑟𝑒𝑠𝑒𝑛𝑡 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
𝜀𝑠 = (0.5 × 102−𝑛 )%
= 𝟏𝟎. 𝟐𝟔𝟓
b) Repeat the procedure of part (a) with ℎ = 0.15,
𝑓(2+0.15)−𝑓(2)
𝑓′(2) ≈ 0.15
𝑓(2.15)−𝑓(2)
= 0.15
7𝑒 0.5(2.15) −7𝑒 0.5(2)
= 0.15
20.50−19.028
= 0.15
= 𝟗. 𝟖𝟕𝟗𝟗
c) The approximate error 𝐸𝑎 is
𝐸𝑎 = 𝑃𝑟𝑒𝑠𝑒𝑛𝑡 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛 – 𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑖𝑜𝑛
= 9.8799 − 10.265
= − 𝟎. 𝟑𝟖𝟒𝟕𝟒
Significant digits – are important in showing the truth one has in a reported number.
– indicate the precision of a measurement. A number with more significant digits is
more precise.
Example: 1,079,587 = 1.079587x106
1,000,000 = 1x106
8.00 = 8.0
to signify the correct number of significant digits.
– follows a following rule:
a.) All non-zero digits are significant digits.
o 4 has one significant digit
o 1.3 has two significant digits
o 4,325.334 has seven significant digits
b.) Zeros that occur between significant digits are significant digits.
o 109 has three significant digits
o 3.005 has four significant digits
o 40.001 has five significant digits
c.) Zeros to the right of the decimal point and to the right of a non-zero digit
are significant.
o 0.10 has two significant digits (the leading zero is not significant,
but the trailing zero is significant)
o 0.0010 has two significant digits (the last two)
o 3.20 has three significant digits
o 320 has two significant digits (this zero is to the left of the decimal
point - not significant.)
o 14.3000 has six significant digits
o 400.00 has five significant digits (the two zeros to the right of the
decimal point are significant because they are to the right of the
"4". The two zeros to the left of the decimal point are significant
because they lie between significant digits - the "4" and the zeros to
the right of the decimal point.)
Characteristics of Measurements
1. Accuracy refers to how closely a computed or measured value agrees with the true
value.
2. Precision refers to how closely individual computed or measured values agree with
each other.
_____________________________________________
References/Additional Resources/Readings
S. Chapra & R. Canale (2010). Numerical Methods for Engineers, 7th ed., McGraw-Hill
Education, Inc.
J. Epperson (2013). An Introduction to Numerical Methods and Analysis, 2nd ed., John Wiley
& Sons, Inc.
J. Chasnov (nd). Numerical Methods, The Hong Kong University of Science and Technology.
https://nm.mathforcollege.com/chapter-01.02-measuring-errors/
Assignment
ASSIGNMENT 1
3. The relative approximate error at the end of an iteration to find the root of an equation is
0.004%. The least number of significant digits we can trust in the solution is
(a) 2 (b) 3 (c) 4 (d) 5
4. The number 0.01850 × 103 has ________ significant digits
(a) 3 (b) 4 (c) 5 (d) 6
5. The number of significant digits in the number 219900 is
(a) 4 (b) 5 (c) 6 (d) 7
II. Answer the following: (Note: Round all answers to 6 significant digits. For numbers such as
6.01000, you may simply write 6.01.)
𝑓(𝑥+ℎ)−𝑓(𝑥)
1. Use the formula ℎ
to approximate the derivative of 𝑓(𝑥) = 3𝑥 2 at 𝑥 = 1 using ℎ = 0.1.
Compute both the absolute true error |𝐸𝑡 |, and absolute relative true error |𝑡 |.
2. How many significant digits does each of the following numbers have?
a. 2340000 e. 9.569 × 102
b. 0.02965 f. 2, 314 × 105
c. 1.011 g. 200.000
d. 2.23 × 103 h. 30.001
3. The following gas stations were cited for irregular dispensation by the Dep’t of Agriculture.
Station Actual gasoline dispensed Gasoline reading at pump
Ser 9.90 10.00
Cit 19.90 20.00
Hus 29.80 30.00
Jun 29.95 30.00
Which one cheated you the most?
4. In each given below, 𝐴 is the exact value, and 𝐴ℎ is an approximation. Find the absolute error
and the relative error.
22 1
a. 𝐴 = 𝜋, 𝐴ℎ = 7
c. 𝐴 = 6 , 𝐴ℎ = 0.1667
1
b. 𝐴 = 𝑒, 𝐴ℎ = 2.71828 d. 𝐴 = 6 , 𝐴ℎ = 0.1666