Numerical Methods Learning Module 3 Part 1
Numerical Methods Learning Module 3 Part 1
Methods
This is a property of
PRESIDENT RAMON MAGSAYSAY STATE UNIVERSITY
NOT FOR SALE
CpE 221 – Numerical Methods
Second Edition, 2023
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
Chapter 2: Roots of an Equation Dionisio M. Martin Jr.
Chapter 3: System of Linear Equation
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 3
Systems of linear equations that have to be solved simultaneously arise in problems that include
several (possibly many) variables that are dependent on each other. Such problems occur not
only in engineering and science, which are the focus of this book, but in virtually any discipline
(business, statistics, economics, etc.). A system of two (or three) equations with two (or three)
unknowns can be solved manually by substitution or other mathematical methods. Solving a
system in this way is practically impossible as the number of equations (and unknowns)
increases beyond three.
In this chapter, we will explore the concept of simultaneous linear equations and learn how to
solve them using different methods of solving. We shall discuss the simultaneous equations
rules and also solve a few examples based on the concept for a better understanding.
Three direct methods for solving systems of equations – Gauss elimination, Gauss-Jordan, and
LU decomposition and two indirect (iterative) methods – Jacobi and Gauss-Seidel are going to
discuss in this chapter.
Specific Objectives
Duration
_____________________________________________
Direct methods
In direct methods, the system of equations that is initially given in the general form is
manipulated to an equivalent system of equations that can be easily solved. Three systems of
equations that can be easily solved are the upper triangular, lower triangular, and diagonal
forms.
The upper triangular form is
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + . . . + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎22 𝑥2 + 𝑎23 𝑥3 + . . . + 𝑎2𝑛 𝑥𝑛 = 𝑏2
𝑎33 𝑥3 + . . . + 𝑎3𝑛 𝑥𝑛 = 𝑏3
⋮ ⋮
𝑎𝑛−1∙𝑛−1 𝑥𝑛−1 + 𝑎𝑛−1∙𝑛 𝑥𝑛 = 𝑏𝑛−1
𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
and is written in a matrix form for a system of four equations in
𝑎11 𝑎12 𝑎13 𝑎14 𝑥1 𝑏1
0 𝑎22 𝑎23 𝑎24 𝑥2 𝑏2
[ 0 0 𝑎33 𝑎34 ] [𝑥3 ] = [𝑏3 ]
0 0 0 𝑎44 𝑥4 𝑏4
The system in this form has all zero coefficients below the diagonal and is solved by a
procedure called back substitution. It starts with the last equation, which is solved for 𝑥𝑛 . The
value of 𝑥𝑛 is then substituted in the next-to-the-last equation, which is solved for 𝑥𝑛−1 . The
process continues in the same manner all the way up to the first equation. In the case of four
equations, the solution is given by
𝑏4
𝑥4 =
𝑎44
𝑏3−𝑎34𝑥4
𝑥3 =
𝑎33
𝑏2 −(𝑎23 𝑥3 +𝑎24 𝑥4 )
𝑥2 =
𝑎22
For a system of n equations in upper triangular form, a general formula for the solution using
back substitution is
𝑏𝑛
𝑥𝑛 =
𝑎𝑛𝑛
𝑗=𝑛
𝑏𝑖 −∑𝑗=𝑖+1 𝑎𝑖𝑗 𝑥𝑗
𝑥𝑖 = 𝑖 = 𝑛 − 1, 𝑛 − 2, … , 1
𝑎𝑖𝑖
For a system of n equations in lower triangular form, a general formula for the solution using
forward substitution is
𝑏1
𝑥1 =
𝑎11
𝑗=𝑖−1
𝑏𝑖 −∑𝑗=1 𝑎𝑖𝑗 𝑥𝑗
𝑥𝑖 = 𝑖 = 1, 2, … , 𝑛
𝑎𝑖𝑖
Example 1: Solve the following system of four equations using upper triangular form.
4𝑥1 − 2𝑥2 − 3𝑥3 + 6𝑥4 = 12
−6𝑥1 + 7𝑥2 + 6.5𝑥3 − 6𝑥4 = −6.5
𝑥1 + 7.5𝑥2 + 6.25𝑥3 + 5.5𝑥4 = 16
−12𝑥1 + 22𝑥2 + 15.5𝑥3 − 𝑥4 = 17
Solution:
Step 1: Pivot equation = 1st and pivot coefficient=4
−6
𝑚= = 1.5
4
1
𝑚 = 4 = 0.25
−12
𝑚= = −3
4
Then:
4𝑥1 − 2𝑥2 − 3𝑥3 + 6𝑥4 = 12
4𝑥2 + 2𝑥3 + 3𝑥4 = 11.5
8𝑥2 + 7𝑥3 + 4𝑥4 = 13
16𝑥2 + 6.5𝑥3 + 17𝑥4 = 53
Note: Transform the matrix into upper/lower triangular matrix then use backward/forward
substitution.
Example 2: Find the value of the given variables by using Gauss elimination method: 𝑥 +
3𝑦 + 6𝑧 = 12, 𝑥 + 4𝑦 + 5𝑧 = 14 and 𝑥 + 6𝑦 + 7𝑧 = 18 using upper triangular form.
Solution:
Given system of equations are:
𝑥 + 3𝑦 + 6𝑧 = 12
𝑥 + 4𝑦 + 5𝑧 = 14
𝑥 + 6𝑦 + 7𝑧 = 18
The augmented matrix:
1 3 6 12
[1 4 5|14]
1 6 7 18
Using upper ∆ matrix:
𝑅2 → 𝑅2 − 𝑅1 and 𝑅3 → 𝑅3 − 𝑅1
1 3 6 12
[0 1 −1| 2 ]
0 3 1 6
𝑅3 → 𝑅3 − 3𝑅2
1 3 6 12
[0 1 −1| 2 ]
0 0 4 0
Then:
for z: for y: for x:
𝑧=0 𝑦−𝑧 = 2 𝑥 + 3𝑦 + 6𝑧 = 12
𝑦−0 = 2 𝑥 + 6 + 0 = 12
𝑦=2 𝑥=6
Method 1:
Rearrange the three equations:
𝑥 − 3𝑦 + 2𝑧 = 11
3𝑥 − 2𝑦 + 𝑧 = 11
2𝑥 + 𝑦 − 4𝑧 = −9
Step 1: Pivot equation = 1st and pivot coefficient = 1
3
𝑚=1=3
(3)(𝑥 − 3𝑦 + 2𝑧 = 11)
3𝑥 − 9𝑦 + 6𝑧 = 33
Subtract to Eqt. 2:
(3𝑥 − 2𝑦 + 𝑧 = 11) − (3𝑥 − 9𝑦 + 6𝑧 = 33)
0𝑥 + 7𝑦 − 5𝑧 = −22
2
𝑚= =2
1
(2)(𝑥 − 3𝑦 + 2𝑧 = 11)
2𝑥 − 6𝑦 + 4𝑧 = 22
Subtract to Eqt. 3:
(2𝑥 + 𝑦 − 4𝑧 = −9) − (2𝑥 − 6𝑦 + 4𝑧 = 22)
0𝑥 + 7𝑦 − 8𝑧 = −31
Then:
𝑥 − 3𝑦 + 2𝑧 = 11
7𝑦 − 5𝑧 = −22
7𝑦 − 8𝑧 = −31
Step 2: Pivot equation = 2nd and pivot coefficient=7
7
𝑚= =1
7
(1)(7𝑦 − 5𝑧 = −22)
7𝑦 − 5𝑧 = −22
Subtract to Eqt. 3:
(7𝑦 − 8𝑧 = −31 ) − (7𝑦 − 5𝑧 = −22)
0𝑦 − 3𝑧 = −9
Then:
𝑥 − 3𝑦 + 2𝑧 = 11
7𝑦 − 5𝑧 = −22
−3𝑧 = −9
Then, by back substitution:
for 𝑧:
−3𝑧 = −9
−9
𝑧= =𝟑
−3
for 𝑦:
7𝑦 − 5𝑧 = −22
−22+5𝑧
𝑦=
7
−22+5(3)
𝑦= = −𝟏
7
for 𝑥:
𝑥 − 3𝑦 + 2𝑧 = 11
𝑥 = 11 + 3𝑦 − 2𝑧
𝑥 = 11 + 3(−1) − 2(3) = 𝟐
Method 2:
Given system of equations are:
3𝑥 − 2𝑦 + 𝑧 = 11
𝑥 − 3𝑦 + 2𝑧 = 11
2𝑥 + 𝑦 − 4𝑧 = −9
The augmented matrix:
3 −2 1 11
[1 −3 2 | 11 ]
2 1 −4 −9
Rearrange the three equations:
1 −3 2 11
[3 −2 1 | 11 ]
2 1 −4 −9
Using upper ∆ matrix:
𝑅2 → 𝑅2 − 3𝑅1 and 𝑅3 → 𝑅3 − 2𝑅1
1 −3 2 11
[0 7 −5|−22]
0 7 −8 −31
𝑅3 → 𝑅3 − 𝑅2
1 −3 2 11
[0 7 −5|−22]
0 0 −3 −9
Then:
for z: for y: for x:
−3𝑧 = −9 7𝑦 − 5𝑧 = −22 𝑥 − 3𝑦 + 2𝑧 = 11
𝑧=3 7𝑦 − 5(3) = −22 𝑥 + 3 + 6 = 11
7𝑦 = −7 𝑥=2
𝑦 = −1
_____________________________________________
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/
https://www.cuemath.com/algebra/simultaneous-equations/
Assignment
ASSIGNMENT 4
1.) Solve the following system of equations using upper triangular form and lower
triangular form.
𝑥 + 𝑦 + 𝑧 = 9
2𝑥 + 5𝑦 + 7𝑧 = 52
2𝑥 + 𝑦 – 𝑧 = 0
2.) Solve the following linear system using upper triangular form.
4𝑥 – 5𝑦 = −6
2𝑥 – 2𝑦 = 1
Learner’s Feedback Form
In what particular portion of this learning packet, you feel that you are struggling or lost?
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
To further improve this learning packet, what part do you think should be enhanced?
___________________________________________________________________________
___________________________________________________________________________
___________________________________________________________________________
NOTE: This is an essential part of course module. This must be submitted to the subject
teacher (within the 1st week of the class).