Ee4 Mod3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Republic of the Philippines

NUEVA VIZCAYA STATE UNIVERSITY


Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

College: Engineering
Campus: Bambang

DEGREE BS in Electrical COURSE NO. MATH11


PROGRAM Engineering
SPECIALIZATION N/A COURSE TITLE Numerical Methods with Computer
Application
YEAR LEVEL 4th Year TIME FRAME 15 WK NO. 6-8 IM NO. 03
hrs.

I. UNIT TITLE/CHAPTER TITLE: Linear System of Algebraic Equations


II. LESSON TITLE

1. Direct Methods
1.1 Gauss elimination method
1.2 Gauss-Jordan method
1.3 Inverse of a matrix by Gauss-Jordan
1.4 Least-Squares regression
1.4.1 Linear Regression
1.4.2 Polynomial Regression
2. Iterative Methods
2.1 Gauss-Jacobi Iteration Method
2.2 Gauss-Seidel Iteration Method
3. Eigen Value Problems
3.1 Eigen Value and Eigen Vectors
3.2 Power Method

III. LESSON OVERVIEW


This lesson provides the students an overview the solution of n linear simultaneous algebraic
equations in n unknowns. Linear systems of equations that are associated with many problems in
engineering and science, as well as with applications of mathematics to the social sciences and
quantitative study of business and economic problems.

IV. DESIRED LEARNING OUTCOMES


1. Locate intervals that contain the roots of an equation
2. Calculate the roots of equations using direct methods and rule of signs
3. Determine the convergence and divergence of an equation to its roots
4. Demonstrate engineering approach on Microsoft software like excel and matlab
5. Solve linear system of algebraic iteration method
6. Calculate the inverse of a matrix by Gauss-Jordan method
7. Calculate the Eigen value and Eigen vectors of a given linear equation
8. Calculate the largest Eigen value of linear equations using Power method

V. LESSON CONTENT

Introduction

In this chapter we present the solution of n linear simultaneous algebraic equations in n unknowns.
Linear systems of equations are associated with many problems in engineering and science, as well as
with applications of mathematics to the social sciences and quantitative study of business and economic
problems. A system of algebraic equations has the form

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 1 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

(2.1)

where the coefficients aij and the constants bj are known and xi represents the unknowns. (Dukkipati,
2010)

where:
aij, i = 1, 2, ..., n, j = 1, 2, …, n, are the known coefficients,
bj , j = 1, 2, …, n, are the known right hand side values and
xi, i = 1, 2, …, n are the unknowns to be determined.

In matrix notation, the equations are written as

(2.1a)

or simply Ax=b (2.1b)

where:

The matrix [A | b], obtained by appending the column b to the matrix A is called the augmented matrix.
(S.R.K. Iyengar, 2009)

Augmented Matrix

As an example let us consider a set of linear equations, (Dukkipati, 2010)


x+y+z=8
x+y–z=5
x–y+z=2

Then we have

and

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 2 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

We define the following.


(i) The system of equations (2.1b) is consistent (has at least one solution),
if rank (A) = rank [A | b] = r.
If r = n, then the system has unique solution.
If r < n, then the system has (n – r) parameter family of infinite number of solutions.

(ii) The system of equations (1.33) is inconsistent (has no solution)


If rank (A) ≠ rank [A | b].

We assume that the given system is consistent. (S.R.K. Iyengar, 2009)

A system of linear equations in n unknowns has a unique solution, provided that the determinant
of the coefficient matrix is non-singular i.e., if |A| ≠ 0. The rows and columns of a non-singular matrix are
linearly independent in the sense that no row (or column) is a linear combination of the other rows (or
columns): (Dukkipati, 2010)
If the coefficient matrix is singular, the equations may have infinite number of solutions, or no
solutions at all, depending on the constant vector.
Linear algebraic equations occur in almost all branches of engineering. Their most important
application in engineering is in the analysis of linear systems (any system whose response is proportional
to the input is deemed to be linear). Linear systems include structures, elastic solids, heat flow, seepage
of fluids, electromagnetic fields and electric circuits i.e., most topics taught in an engineering curriculum.
If the system is discrete, such as a truss or an electric circuit, then its analysis leads directly to linear
algebraic equations.

Summarizing, the modelling of linear systems invariably gives rise to equations of the form Ax =
b, where b is the input and x represents the response of the system. The coefficient matrix A, which
reflects the characteristics of the system, is independent of the input. In other words, if the input is
changed, the equations have to be solved again with a different b, but the same A. Hence, it is desirable
to have an equation solving algorithm that can handle any number of constant vectors with minimal
computational effort. (Dukkipati, 2010)
Methods of Solution (Dukkipati, 2010)
There are two classes of methods for solving system of linear, algebraic equations: direct and
iterative methods. The common characteristics of direct methods are that they transform the original
equation into equivalent equations (equations that have the same solution) that can be solved more
easily. The transformation is carried out by applying certain operations.
The solution does not contain any truncation errors but the round off errors is introduced due to
floating point operations.
Iterative or indirect methods, start with a guess of the solution x, and then repeatedly refine the
solution until a certain convergence criterion is reached. Iterative methods are generally less efficient
than direct methods due to the large number of operations or iterations required.
Iterative procedures are self-correcting, meaning that round off errors (or even arithmetic
mistakes) in one iteration cycle are corrected in subsequent cycles. The solution contains truncation error.
A serious drawback of iterative methods is that they do not always converge to the solution. The initial
guess affects only the number of iterations that are required for convergence. The indirect solution
technique (iterative) is more useful to solve a set of ill-conditioned equations.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 3 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

1. Direct Methods

Direct methods produce the exact solution after a finite number of steps (disregarding the round-
off errors). In these methods, we can determine the total number of operations (additions,
subtractions, divisions and multiplications). This number is called the operational count of the method.

If the system of equations has some special forms, then the solution is obtained directly. We
consider two such special forms.
(a) Let A be a diagonal matrix, A = D. That is, we consider the system of equations
Dx = b as

(1.34)

This system is called a diagonal system of equations. Solving directly, we obtain

(1.35)
(b) Let A be an upper triangular matrix, A = U. That is, we consider the system of equations
Ux = b as

(1.36)

This system is called an upper triangular system of equations. Solving for the unknowns
in the order xn, xn–1, ..., x1, we get

(1.37)

The unknowns are obtained by back substitution and this procedure is called the back
substitution method.

Therefore, when the given system of equations is one of the above two forms, the solution
is obtained directly.

Before we derive some direct methods, we define elementary row operations that can be
performed on the rows of a matrix.
Elementary row transformations (operations) The following operations on the rows of a matrix
A are called the elementary row transformations (operations).

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 4 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

(i) Interchange of any two rows. If we interchange the ith row with the jth row, then we
usually denote the operation as Ri ↔ Rj.
(ii) Division/multiplication of any row by a non-zero number p. If the ith row is multiplied by
p, then we usually denote this operation as pRi.
(iii) Adding/subtracting a scalar multiple of any row to any other row. If all the elements of
the jth row are multiplied by a scalar p and added to the corresponding elements of the ith row,
then, we usually denote this operation as Ri ← Ri + pRj. Note the order in which the operation Ri
+ pRj is written. The elements of the jth row remain unchanged and the elements of the ith row
get changed.
These row operations change the form of A, but do not change the row-rank of A. The
matrix B obtained after the elementary row operations is said to be row equivalent with A. In the
context of the solution of the system of algebraic equations, the solution of the new system is
identical with the solution of the original system.
The above elementary operations performed on the columns of A (column C in place of
row R) are called elementary column transformations (operations). However, we shall be using
only the elementary row operations.
In this section, we derive two direct methods for the solution of the given system of
equations, namely, Gauss elimination method and Gauss-Jordan method.
1.1. Gauss Elimination Method

The method is based on the idea of reducing the given system of equations Ax =
b, to an upper triangular system of equations Ux = z, using elementary row operations.
We know that these two systems are equivalent. That is, the solutions of both the systems
are identical. This reduced system Ux = z, is then solved by the back substitution method
to obtain the solution vector x. (S.R.K. Iyengar, 2009)

Consider the following system of linear simultaneous equations: (Dukkipati, 2010)


a11x1 + a12x2 + a13x3 = b1 (2.12)
a21x1 + a22x2 + a23x3 = b2 (2.13)
a31x1 + a32x2 + a33x3 = b3 (2.14)

Gauss elimination is a popular technique for solving simultaneous linear algebraic


equations. It reduces the coefficient matrix into an upper triangular matrix through a
sequence of operations carried out on the matrix. The vector b is also modified in the
process. The solution vector {x} is obtained from a backward substitution procedure.
(Dukkipati, 2010)

Two linear systems Ax = b and A'x = b' of equations are said to be equivalent if
any solution of one is a solution of the other. Also, let Ax = b is a linear non-homogeneous
system of n equations. Suppose we subject this system to the system of following
operations: (Dukkipati, 2010)
1. Multiplication of one equation by a non-zero constant.
2. Addition of a multiple of one equation to another equation.
3. Interchange of two equations.

If the sequence of operations produce the new system A′x = b′, then both the
systems Ax = b and A′x = b' are equivalent. In particular, then A is invertible if A′ is
invertible. In Gauss elimination method, we adopt this and the elimination process is based
on this theorem.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 5 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

In Gauss elimination method, the unknowns are eliminated such that the
elimination process leads to an upper triangular system and the unknowns are obtained
by back substitution. It is assumed a11 ≠ 0.

The method can be described by the following steps: (Dukkipati, 2010)

Step 1: Eliminate x1 from the second and third equations.


Using the first equation (2.12), the following operations are performed:

gives a11x1 + a12x2 + a13x3 = b1 (2.15)


a'22x2 + a'23x3 = b'2 (2.16)
a'32x2 + a'33x3 = b'3 (2.17)

Equation (2.15) is called the pivotal equation and the coefficient a11 is the pivot.

Step 2: Eliminate x2 from the Eq. (2.17) using Eq. (2.16) by assuming a'22 ≠ 0. We perform
the following operation:

to obtain a11x1 + a12x2 + a13x3 = b1 (2.18)


a'22x2 + a'23x3 = b'2 (2.19)
and a²33x3 = b''3 (2.20)
Here Eq. (2.19) is called the pivotal equation and the coefficient a'22 is the pivot.

Step 3: To find x1, x2 and x3, we apply back substitution starting from Eq. (2.20) giving x3,
then x2 from Eq. (2.19) and x1 from Eq. (2.18).

Pivoting:
Gauss elimination method fails if any one of the pivots in the above equations (2.12) to
(2.20) becomes zero. To overcome this difficulty, the equations are to be rewritten in a
slightly different order such that the pivots are not zero.

Partial pivoting method:


Step 1: The numerically largest coefficient of x1 is selected from all the equations are pivot
and the corresponding equation becomes the first equation (2.12).

Step 2: The numerically largest coefficient of x2 is selected from all the remaining
equations as pivot and the corresponding equation becomes the second equation (2.16).
This process is repeated till an equation into a simple variable is obtained.

Complete pivoting method:


In this method, we select at each stage the numerically largest coefficient of the complete
matrix of coefficients. This procedure leads to an interchange of the equations as well as
interchange of the position of variables.

Gauss Elimination Method according to Iyengar and Jain: (S.R.K. Iyengar, 2009)
First stage of elimination

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 6 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

We assume a11 ≠ 0. This element a11 in the 1 × 1 position is called the first pivot.
We use this pivot to reduce all the elements below this pivot in the first column as zeros.
Multiply the first row in (1.39) by a21/a11 and a31/a11 respectively and subtract from the
second and third rows. That is, we are performing the elementary row operations R2 –
(a21/a11)R1 and R3 –(a31/a11)R1 respectively. We obtain the new augmented matrix as

(1.40)

where

Second stage of elimination

( ) ( )
We assume a ≠ 0. This element a in the 2 x 2 position is called the second
pivot. We use this pivot to reduce the element below this pivot in the second column as
( ) ( )
zero. Multiply the second row in (1.40) by a / a and subtract from the third row. That
( ) ( )
is, we are performing the elementary row operation R3 – (a / a ) R2. We obtain the new
augmented matrix as

(1.41)

where

( )
The element a ≠ 0 is called the third pivot. This system is in the required upper
triangular for [U | z]. The solution vector x is now obtained by back substitution.

From the third row, we get

From the second row, we get


From the first row, we get

In general, using a pivot, all the elements below that pivot in that column are made zeros.

Alternately, at each stage of elimination, we may also make the pivot as 1, by


dividing that particular row by the pivot.

When does the Gauss elimination method as described above fail? (S.R.K. Iyengar, 2009)

It fails when any one of the pivots is zero or it is a very small number, as the
elimination progresses. If a pivot is zero, then division by it gives over flow error, since
division by zero is not defined. If a pivot is a very small number, then division by it
introduces large round-off errors and the solution may contain large errors.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 7 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

For example, we may have the system:


2x2 + 5x3 = 7
7x1 + x2 – 2x3 = 6
2x1 + 3x2 + 8x3 = 13

in which the first pivot is zero.

How do we avoid computational errors in Gauss elimination? (S.R.K. Iyengar, 2009)

To avoid computational errors, we follow the procedure of partial pivoting. In the


first stage of elimination, the first column of the augmented matrix is searched for the
largest element in magnitude and brought as the first pivot by interchanging the first row
of the augmented matrix (first equation) with the row (equation) having the largest element
in magnitude. In the second stage of elimination, the second column is searched for the
largest element in magnitude among the n – 1 elements leaving the first element, and this
element is brought as the second pivot by interchanging the second row of the augmented
matrix with the later row having the largest element in magnitude. This procedure is
continued until the upper triangular system is obtained. Therefore, partial pivoting is done
after every stage of elimination. There is another procedure called complete pivoting. In
this procedure, we search the entire matrix A in the augmented matrix for the largest
element in magnitude and bring it as the first pivot. This requires not only an interchange
of the rows, but also an interchange of the positions of
the variables. It is possible that the position of a variable is changed a number of times
during this pivoting. We need to keep track of the positions of all the variables. Hence, the
procedure is computationally expensive and is not used in any software.

Remark/s:

Gauss elimination method is a direct method. Therefore, it is possible to count the


total number of operations, that is, additions, subtractions, divisions and multiplications.
Without going into details, we mention that the total number of divisions and multiplications
(division and multiplication take the same amount of computer time) is n (n2 + 3n – 1)/3.
The total number of additions and subtractions (addition and subtraction take the same
amount of computer time) is n (n – 1)(2n + 5)/6.

Example:
1. Solve the system of equations
x1 + 10x2 – x3 = 3
2x1 + 3x2 + 20x3 = 7
10x1 – x2 + 2x3 = 4
Using the Gauss elimination with partial pivoting. (S.R.K. Iyengar, 2009)
Solution:

We have the augmented matrix as

We perform the following elementary row transformations and do the eliminations.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 8 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Back substitution gives the solution.

Third equation gives

Second equation gives

First equation gives

2. Solve the system of equations


2x1 + x2 + x3 – 2x4 = – 10
4x1 + 2x3 + x4 = 8
3x1 + 2x2 + 2x3 = 7
x1 + 3x2 + 2x3 – x4 = – 5
using the Gauss Elimination with partial pivoting. (S.R.K. Iyengar, 2009)

Solution:

The augmented matrix is given by

We perform the following elementary row transformations and do the eliminations

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 9 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Using back substitution, we obtain

3. Solve the system of equations


3x1 + 3x2 + 4x3 = 20
2x1 + x2 + 3x3 = 13
x1 + x2 + 3x3 = 6
using the Gauss elimination method. (S.R.K. Iyengar, 2009)

Solution:
Let us solve this problem by making the pivots as 1. The augmented matrix is given by:

We perform the following elementary row transformations and do the eliminations.

Back substitution gives the solution as

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 10 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

4. Test the consistency of the following system of equations


x1 + 10x2 – x3 = 3
2x1 + 3x2 + 20x3 = 7
9x1 + 22x2 + 79x3 = 45
Using Gauss elimination method

Solution:
We have augmented matrix as

We perform the following elementary row transformations and do the eliminations.

Now, rank [A] = 2, and rank [A|b] = 3. Therefore, the system is inconsistent and has no
solution.

5. Solve the following equations by Gauss elimination method: (not using Augmented
Matrix) (Dukkipati, 2010)
2x + 4y – 6z = –4
x + 5y + 3z = 10
x + 3y + 2z = 5

Solution:

2x + 4y – 6z = – 4 (E.1)
x + 5y + 3z = 10 (E.2)
x + 3y + 2z = 5 (E.3)

To eliminate x from (E.2) and (E.3) using (E.1):


2x + 4y – 6z = –4
x + 5y + 3z = 10 1 × (– 2)
x + 3y + 2z = 5 1 × (– 2)

2x + 4y – 6z = –4
–2x – 10y – 6z = –20
–2x – 6y – 4z = –10

2x + 4y – 6z = –4
Row 1 + Row 2: – 6y – 12z = –24 (E.6)
Row 1 + Row 3: 2y – 10z = –14 1 × (–3) (E.5)

To eliminate y from (E.5) using (E.4):


2x + 4y – 6z = –4
–6y – 12z = –24
6y + 30z = 42

2x + 4y – 6z = –4
–6y – 12z = –24
Row 2 + Row 3: 18z = 18 ⇒z=1
NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 11 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Evaluation of the unknowns by back substitution:


– 6y – 12z = –24
6y = 24 – 12z ⇒y= ⇒y=2

2x + 4y – 6z = –4
2x = –4 – 4y + 6z ⇒x= ⇒ x = -3

1.2. Gauss-Jordan Method

Gauss-Jordan method is an extension of the Gauss elimination method. The set of


equations Ax = b is reduced to a diagonal set Ix = b', where I is a unit matrix. This is equivalent
to x = b'. The solution vector is therefore obtained directly from b'. The Gauss-Jordan method
implements the same series of operations as implemented by Gauss elimination process.
The main difference is that it applies these operations below as well as above the diagonal
such that all off-diagonal elements of the matrix are reduced to zero. Gauss-Jordan method
also provides the inverse of the coefficient matrix A along with the solution vector {x}. The
Gauss-Jordan method is highly used due to its stability and direct procedure. The Gauss-
Jordan method requires more computational effort than Gauss elimination process.
(Dukkipati, 2010)

Gauss-Jordan method is an extension of the Gauss elimination method. The set of


equations Ax = b is reduced to a diagonal set Ix = b', where I is a unit matrix. This is equivalent
to x = b'. The solution vector is therefore obtained directly from b'. The Gauss-Jordan method
implements the same series of operations as implemented by Gauss elimination process.
The main difference is that it applies these operations below as well as above the diagonal
such that all off-diagonal elements of the matrix are reduced to zero. Gauss-Jordan method
also provides the inverse of the coefficient matrix A along with the solution vector {x}. The
Gauss-Jordan method is highly used due to its stability and direct procedure. The Gauss-
Jordan method requires more computational effort than Gauss elimination process.
(Dukkipati, 2010)

According to Iyengar and Jain, the method is based on the idea of reducing the given
system of equations Ax = b, to a diagonal system of equations Ix = d, where I is the identity
matrix, using elementary row operations. We know that the solutions of both the systems are
identical. This reduced system gives the solution vector x. This reduction is equivalent to
finding the solution as x = A–1b.

In this case, after the eliminations are completed, we obtain the augmented matrix for
a 3 × 3 system as (S.R.K. Iyengar, 2009)

(1.42)

and the solution is; xi = di, i = 1, 2, 3.

Elimination procedure. The first step is same as in Gauss elimination method, that is, we
make the elements below the first pivot as zeros, using the elementary row transformations.
From the second step onwards, we make the elements below and above the pivots as zeros
using the elementary row transformations. Lastly, we divide each row by its pivot so that the

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 12 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

final augmented matrix is of the form (1.42). Partial pivoting can also be used in the solution.
We may also make the pivots as 1 before performing the elimination. (S.R.K. Iyengar, 2009)

Example:
1) Solve the following system of equations

x1 + x2 + x3 = 1
4x1 + 3x2 – x3 = 6
3x1 + 5x2 + 3x3 = 4

using the Gauss-Jordan method (i) without partial pivoting, (ii) with partial pivoting.
(S.R.K. Iyengar, 2009)

Solution:
We have the augmented matrix as

(i) We perform the following elementary row transformations and do the eliminations

Now, making the pivots as 1, ((– R2), (R3/(– 10))) we get

Therefore, the solution of the system is x1 = 1, x2 = 1/2, x3 = – 1/2.

(ii) We perform the following elementary row transformations and do the elimination.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 13 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Therefore, the solution of the system is x1 = 1, x2 = 1/2, x3 = – 1/2.

Remark/s: The Gauss-Jordan method looks very elegant as the solution is obtained
directly. However, it is computationally more expensive than Gauss elimination. For large
n, the total number of divisions and multiplications for Gauss-Jordan method is almost 1.5
times the total number of divisions and multiplications required for Gauss elimination.
Hence, we do not normally use this method for the solution of the system of equations.
The most important application of this method is to find the inverse of a non-singular
matrix. We present this method in the following section. (S.R.K. Iyengar, 2009)
2) Solve the following system of equations using the Gauss-Jordan method. (Dukkipati,
2010)
x – 2y = –4
5y + z = –9
4x – 3z = –10
Solution:
The augmented matrix is

Multiplying 1st row by –4 and adding the result to the 3rd row, we obtain

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 14 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Now, multiply the 2nd row by –1/5

Multiply the 2nd row and add the result to the 1st row. Then multiply the 2nd row by
–8 and add the result to the 3rd row.

Multiply 3rd row by –5/7

Multiply 3rd row by 2/5 and add the result to 1st row. Then multiply 3rd row by 1/5 and
add the result to 2nd row.

Hence, the last matrix above represents the system with x = 2, y = 3 and z = 6.
3) Solve the following set of equations by Gauss-Jordan method. (Dukkipati, 2010)
2x1 + x2 – 3x3 = 11
4x1 – 2x2 + 3x3 = 8
–2x1 + 2x2 – x3 = –6
Solution:
The augmented matrix for the given set of equations is

Step 1: Divide Row 1 by 2

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 15 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Step 2: Row 2 – 4 x Row 1


Row 3 – 2 x Row 1

Step 3: Divide Row 2 by –4

Step 4: Row 1 – 1/ 2 x Row 2


Row 3 – 3 x Row 2

Step 5: Divide Row 3 by 11/4

Step 6: Row 1 + 3/8 x Row 3


Row 2 + 9/4 x Row 3

Hence the solution is x1 = 3, x2 = –1, x3 = –2.

1.3. Inverse of a matrix by Gauss-Jordan (S.R.K. Iyengar, 2009)

The important application of the Gauss-Jordan method is to find the inverse of a non-
singular matrix A. We start with the augmented matrix of A with the identity matrix I of the
same order. When the Gauss-Jordan procedure is completed, we obtain

since, AA–1 = I.

Remark/s:

Partial pivoting can also be done using the augmented matrix [A|I]. However, we
cannot first interchange the rows of A and then find the inverse. Then, we would be finding
the inverse of a different matrix.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 16 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Example:
1) Find the inverse of the matrix

using the Gauss-Jordan method (i) without partial pivoting, and (ii) with partial
pivoting. (S.R.K. Iyengar, 2009)

Solution:
Consider the augmented matrix

(i) We perform the following elementary row transformations and do the


eliminations.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 17 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Therefore, the inverse of the given matrix is given by

(ii) We perform the following elementary row transformations and do the


eliminations.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 18 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Therefore, the inverse of the matrix is given by

2) Using the Gauss-Jordan method, find the inverse of (S.R.K. Iyengar, 2009)

Solution:

We have the following augmented matrix

We perform the following elementary row transformations and do the eliminations

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 19 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Therefore, the inverse of the given matrix is given by

1.4. Least-Square Regression

Introduction (Chapra & Canale, 2010)

Where substantial error is associated with data, polynomial interpolation is inappropriate and may
yield unsatisfactory results when used to predict intermediate values. Experimental data is often of this
type. For example, Fig. 17.1a shows seven experimentally derived data points exhibiting significant
variability. Visual inspection of the data suggests a positive relationship between y and x. That is, the
overall trend indicates that higher values of y are associated with higher values of x. Now, if a sixth-order
interpolating polynomial is fitted to this data (Fig. 17.1b), it will pass exactly through all of the points.
However, because of the variability in the data, the curve oscillates widely in the interval between the
points. In particular, the interpolated values at x = 1.5 and x = 6.5 appear to be well beyond the range
suggested by the data.
A more appropriate strategy for such cases is to derive an approximating function that fits the
shape or general trend of the data without necessarily matching the individual points. Figure 17.1c
illustrates how a straight line can be used to generally characterize the trend of the data without passing
through any particular point.
One way to determine the line in Fig. 17.1c is to visually inspect the plotted data and then sketch
a “best” line through the points. Although such “eyeball” approaches have commonsense appeal and are
valid for “back-of-the-envelope” calculations, they are deficient because they are arbitrary. That is, unless
the points define a perfect straight line (in which case, interpolation would be appropriate), different
analysts would draw different lines.
To remove this subjectivity, some criterion must be devised to establish a basis for the fit. One
way to do this is to derive a curve that minimizes the discrepancy between the data points and the curve.
A technique for accomplishing this objective, called least-squares regression, will be discussed in this
module.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 20 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

1.4.1 Linear Regression

The simplest example of a least-squares approximation is fitting a straight line to


a set of paired observations: (x1, y1), (x2, y2), . . ., (xn, yn). (Chapra & Canale, 2010)

Line of Best Fit (MathisFun, 2017)


Imagine you have some points, and want to have a line that best fits them like this:

We can place the line "by eye": try to have the line as close as possible to all points,
and a similar number of points above and below the line.
But for better accuracy let's see how to calculate the line using Least Squares
Regression.
The Line
Our aim is to calculate the values m (slope) and b (y-intercept) in the equation of
a line :
y = mx + b
Where:
 y = how far up
 x = how far along
 m = Slope or Gradient (how steep the line is)
 b = the Y-Intercept (where the line crosses the Y axis)

Steps:

` To find the line of best fit for N points:

Step 1: For each (x,y) point calculate x2 and xy

Step 2: Sum all x, y, x2 and xy, which gives us Σx, Σy, Σx2 and Σxy (Σ means "sum up")

Step 3: Calculate Slope m:

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 21 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

(N is the number of points.)

Step 4: Calculate Intercept b:

Step 5: Assemble the equation of a line

Example:
1) Write a linear equation that “best fits” the data shown below.

x 1 2 3 4 5 6 7 8

y 5.1 7.2 9.01 11.1 13.22 15.12 17 19.11


Solution:
x y x2 xy
1 5.1 1 5.1
2 7.2 4 14.4
3 9.01 9 27.03
4 11.1 16 44.4
5 13.22 25 66.1
6 15.12 36 90.72
7 17 49 119
8 19.11 64 152.88

Given:
Σx = 36
Σy = 96.86
Σ(x2)= 204
Σ(xy)= 519.63

Calculate the slope m:

∑( ) ∑ ∑
m= ∑( ) (∑ )

( )( . ) ( )( . )
m= ( )( ) ( )

m= 1.994285714

Calculate the intercept b:

∑ ∑
b=

. ( . )( )
b=

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 22 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

b= 3.133214287

Therefore, the linear equation is

y = 1.994x + 3.1332

2.) Given the data shown below, Find y at x=10

x 1 2 3 4 5

y 7.11 10.01 13.2 16.1 19.12


Solution:

x y x2 xy
1 7.11 1 7.11
2 10.01 4 20.02
3 13.2 9 39.6
4 16.1 16 64.4
5 19.12 25 95.6
Σ= 15 65.54 55 226.73

Find the linear equation


Calculate the slope m:

∑( ) ∑ ∑
m= ∑( ) (∑ )

( )( . ) ( )( . )
m= ( )( ) ( )

m= 3.011

Calculate the intercept b:

∑ ∑
b=

. ( . )( )
b=

b= 4.075

The linear equation is; y =3.011x + 4.075


Therefore, y at x=10 is
y= 3.011(10) + 4.075
y= 34.185

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 23 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

1.4.1 Polynomial Regression

Some engineering data, although exhibiting a marked pattern such as seen in Fig.
17.8, is poorly represented by a straight line. For these cases, a curve would be better
suited to fit the data. As discussed in the previous section, one method to accomplish this
objective is to use transformations. Another alternative is to fit polynomials to the data
using polynomial regression. (Dukkipati, 2010)

The least-squares procedure can be readily extended to fit the data to a higher-
order polynomial. For example, suppose that we fit a second-order polynomial or
quadratic:

y = a0 + a1x + a2x2 (1.4.1a)

To find the polynomial equation, we must find the value of a0, a1, and a2. The
equations below will help you.

Writing in matrix form,

𝒏 𝜮𝒙𝒊 𝜮𝒙𝒊 𝟐 𝒂𝟎 𝜮𝒚𝒊


𝜮𝒙𝒊 𝜮𝒙𝒊 𝟐 𝜮𝒙𝒊 𝟑 𝒂𝟏 = 𝜮𝒙𝒊 𝒚𝒊
𝜮𝒙𝒊 𝟐 𝜮𝒙𝒊 𝟑 𝜮𝒙𝒊 𝟒 𝒂𝟐 𝜮𝒙𝒊 𝟐 𝒚𝒊

Example:
1) Write the polynomial equation that “best fits” the data shown below.

x 1 2 3 4 5 6 7

y 6.1 16.13 32.2 54.01 82.11 116.22 156.21

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 24 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Solution:

xi yi xi2 xi3 xi4 xi2y xi yi


1 6.1 1 1 1 6.1 6.1
2 16.13 4 8 16 64.52 32.26
3 32.2 9 27 81 289.8 96.6
4 54.01 16 64 256 864.16 216.04
5 82.11 25 125 625 2052.75 410.55
6 116.22 36 216 1296 4183.92 697.32
7 156.21 49 343 2401 7654.29 1093.47
Σ=28 462.98 140 784 4676 15115.54 2552.34

Using the matrix form shown below, calculate the value of a0, a1, and a2.

𝒏 𝜮𝒙𝒊 𝜮𝒙𝒊 𝟐 𝒂𝟎 𝜮𝒚𝒊


𝜮𝒙𝒊 𝜮𝒙𝒊 𝟐 𝜮𝒙𝒊 𝟑 𝒂𝟏 = 𝜮𝒙𝒊 𝒚𝒊
𝜮𝒙𝒊 𝟐 𝜮𝒙𝒊 𝟑 𝜮𝒙𝒊 𝟒 𝒂𝟐 𝜮𝒙𝒊 𝟐 𝒚𝒊

7 28 140 𝑎 462.98
𝑎 =
28 140 784 2552.34
140 784 4676 𝑎 15115.54
7a0 + 28a1 + 140a2 = 462.98
28a0 + 140a1 + 784a2 = 2552.34
140a0 + 784a1 + 4676a2 = 15115.54

Solving simultaneously, we get a result of


a0= 2.1629
a1= 0.9598
a2= 3.0069

Substituting to eq. (1.4.1a), the polynomial equation is,


y= 2.1629 + 0.9598x + 3.0069x2

2. Iterative Methods (S.R.K. Iyengar, 2009)

Iterative methods are based on the idea of successive approximations. We start with an initial
approximation to the solution vector x = x0, to solve the system of equations Ax = b, and obtain a
sequence of approximate vectors x0, x1, ..., xk, ..., which in the limit as k → ∞, converges to the exact
solution vector x = A–1b. A general linear iterative method for the solution of the system of equations
Ax = b, can be written in matrix form as

(1.43)

where x(k+1) and x(k) are the approximations for x at the (k + 1)th and kth iterations respectively. H
is called the iteration matrix, which depends on A and c is a column vector, which depends on A and
b.

When to stop the iteration? We stop the iteration procedure when the magnitudes of the differences
between the two successive iterates of all the variables are smaller than a given accuracy or error
tolerance or an error bound ε, that is,
NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 25 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

(1.44)

For example, if we require two decimal places of accuracy, then we iterate until |𝒙𝒊 (𝒌 𝟏)
− 𝒙𝒊 (𝒌)|<
0.005 for all i. If we require three decimal places of accuracy, then we iterate until |𝒙𝒊 (𝒌 𝟏)
− 𝒙𝒊 (𝒌) |<
0.0005, for all i.

Convergence property of an iterative method depends on the iteration matrix H.

Now, we derive two iterative methods for the solution of the system of algebraic equations

(1.45)

2.1. Gauss-Jacobi Iteration Method (S.R.K. Iyengar, 2009)

Sometimes, the method is called Jacobi method. We assume that the pivots aii ≠ 0, for all
i. Write the equations as

The Jacobi iteration method is defined as

(1.46)

Since, we replace the complete vector x(k) in the right hand side of (1.46) at the end of
each iteration, this method is also called the method of simultaneous displacement.

Remark 20 A sufficient condition for convergence of the Jacobi method is that the system of
equations is diagonally dominant, that is, the coefficient matrix A is diagonally dominant. We can
verify that |𝒂𝒊𝒊 | ≥ ∑𝒏𝒋 𝟏,𝒊 𝒋 |𝒂𝒊𝒋 |. This implies that convergence may be obtained even if the system
is not diagonally dominant. If the system is not diagonally dominant, we may exchange the
equations, if possible, such that the new system is diagonally dominant and convergence is
guaranteed. However, such manual verification or exchange of equations may not be possible for
large systems that we obtain in application problems. The necessary and sufficient condition for
convergence is that the spectral radius of the iteration matrix H is less than one unit, that is, ρ(H)
< 1, where ρ(H) is the largest eigen value in magnitude of H. Testing of this condition is beyond
the scope of the syllabus.

Remark 21 How do we find the initial approximations to start the iteration? If the system is
diagonally dominant, then the iteration converges for any initial solution vector. If no suitable
approximation is available, we can choose x = 0, that is xi = 0 for all i. Then, the initial
approximation becomes xi = bi /aii, for all i.
NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 26 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Diagonally Dominant Matrix (Tomar, 2018)

In mathematics, a square matrix is said to be diagonally dominant if for every row of the matrix,
the magnitude of the diagonal entry in a row is larger than or equal to the sum of the magnitudes
of all the other (non-diagonal) entries in that row. More precisely, the matrix A is diagonally
dominant if

For example, the matrix

is diagonally dominant because


|a11| ≥ |a12| + |a13| since |+3| ≥ |-2| + |+1|
|a22| ≥ |a21| + |a23| since |-3| ≥ |+1| + |+2|
|a33| ≥ |a31| + |a32| since |+4| ≥ |-1| + |+2|
Given a matrix A of n rows and n columns. The task is to check whether matrix A is
diagonally dominant or not.

Example:
1) Solve the system of equations
4x1 + x2 + x3 = 2
x1 + 5x2 + 2x3 = – 6
x1 + 2x2 + 3x3 = – 4
using the Jacobi iteration method. Use the initial approximations as
(i) xi = 0, i = 1, 2, 3, (ii) x1 = 0.5, x2 = – 0.5, x3 = – 0.5.
Perform five iterations in each case.

Solution:
Note that the given system is diagonally dominant. Jacobi method gives the
iterations as (review general iteration method)
x1(k+1) = 0.25 [2 – (x2(k) + x3(k))]
x2(k+1) = 0.2 [– 6 – (x1(k) + 2x3(k))]
x3(k+1) = 0.33333 [– 4 – (x1(k) + 2x2(k))], k = 0, 1, ...

We have the following results.


(i) x1(0) = 0, x2(0) = 0, x3(0) = 0.

First iteration:

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 27 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Second iteration:

Third iteration:

Fourth iteration:

Fifth iteration:

It is interesting to note that the iterations oscillate and converge to the exact
solution
x1 = 1.0, x2 = – 1, x3 = – 1.0.

(ii) x1(0) = 0.5, x2(0) = – 0.5, x3(0) = – 0.5.

First iteration:

Second iteration:

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 28 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Third iteration:

Fourth iteration:

Fifth iteration:

The iterations oscillate and converge to the exact solution


x1 = 1.0, x2 = – 1, x3 = – 1.0.

2) Solve the system of equations


26x1 + 2x2 + 2x3 = 12.6
3x1 + 27x2 + x3 = – 14.3
2x1 + 3x2 + 17x3 = 6.0
using the Jacobi iteration method. Obtain the result correct to three decimal places.

Solution:
The given system of equations is strongly diagonally dominant. Hence, we can
expect faster convergence. Jacobi method gives the iterations as

Choose the initial approximation as x1(0) = 0, x2(0) = 0, x3(0) = 0. We obtain the


following results.

First iteration:

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 29 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Second iteration:

Third iteration:

Fourth iteration:

We find

Fifth iteration:

We find

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 30 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Since, all the errors in magnitude are less than 0.0005, the required solution is
x1 = 0.5, x2 = – 0.6, x3 = 0.4.

Remark 22 What is the disadvantage of the Gauss-Jacobi method? At any iteration step,
the value of the first variable x1 is obtained using the values of the previous iteration. The
value of the second variable x2 is also obtained using the values of the previous iteration,
even though the updated value of x1 is available. In general, at every stage in the iteration,
values of the previous iteration are used even though the updated values of the previous
variables are available. If we use the updated values of x1, x2,..., xi–1 in computing the value
of the variable xi, then we obtain a new method called Gauss-Seidel iteration method.

2.2. Gauss-Seidel Iteration Method

As pointed out in Remark 22, we use the updated values of x1, x2,..., xi–1 in computing the
value of the variable xi. We assume that the pivots aii ≠ 0, for all i. We write the equations as

a11x1 = b1 – (a12x2 + a13x3)


a22x2 = b2 – (a21x1 + a23x3)
a33x3 = b3 – (a31x1 + a32x2)

The Gauss-Seidel iteration method is defined as

(1.47)

This method is also called the method of successive displacement.


We observe that (1.47) is same as writing the given system as

(1.48)

Remark 23 A sufficient condition for convergence of the Gauss-Seidel method is that the system
of equations is diagonally dominant, that is, the coefficient matrix A is diagonally dominant. This
implies that convergence may be obtained even if the system is not diagonally dominant. If the
system is not diagonally dominant, we may exchange the equations, if possible, such that the
new system is diagonally dominant and convergence is guaranteed. The necessary and sufficient
condition for convergence is that the spectral radius of the iteration matrix H is less than one unit,
that is, ρ(H) < 1, where ρ(H) is the largest eigen value in magnitude of H. Testing of this condition
is beyond the scope of the syllabus.

If both the Gauss-Jacobi and Gauss-Seidel methods converge, then Gauss-Seidel method
converges at least two times faster than the Gauss-Jacobi method.

Example:
1) Find the solution of the system of equations
45x1 + 2x2 + 3x3 = 58
– 3x1 + 22x2 + 2x3 = 47
5x1 + x2 + 20x3 = 67
correct to three decimal places, using the Gauss-Seidel iteration method.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 31 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Solution:
The given system of equations is strongly diagonally dominant. Hence, we can expect
fast convergence. Gauss-Seidel method gives the iteration

Starting with x1(0) = 0, x2(0) = 0, x3(0) = 0, we get the following results.

First iteration:

Second iteration:

Third iteration:

Fourth iteration:

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 32 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

We find

Since, all the errors in magnitude are less than 0.0005, the required solution is
x1 = 1.0, x2 = 1.99999, x3 = 3.0.
Rounding to three decimal places, we get x1 = 1.0, x2 = 2.0, x3 = 3.0.

2) Computationally show that Gauss-Seidel method applied to the system of equations

3x1 – 6x2 + 2x3 = 23


– 4x1 + x2 – x3 = – 8
x1 – 3x2 + 7x3 = 17
diverges. Take the initial approximations as x1 = 0.9, x2 = – 3.1, x3 = 0.9. Interchange the first
and second equations and solve the resulting system by the Gauss-Seidel method. Again
take the initial approximations as x1 = 0.9, x2 = – 3.1, x3 = 0.9, and obtain the result correct to
two decimal places. The exact solution is x1 = 1.0, x2 = – 3.0, x3 = 1.0.
x1(k+1) = [23 + 6x2(k) – 2x3(k))]/3
x2(k+1) = [– 8 + 4x1(k+1) + x3(k)]
x3(k+1) = [17 – x1(k+1) + 3x2(k+1)]/7.
Starting with the initial approximations x1 = 0.9, x2 = – 3.1, x3 = 0.9, we obtain the following
results.
First iteration:

Second iteration:

Third iteration:

It can be observed that the iterations are diverging very fast.


Now, we exchange the first and second equations to obtain the system

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 33 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

– 4x1 + x2 – x3 = – 8
3x1 – 6x2 + 2x3 = 23
x1 – 3x2 + 7x3 = 17.

The system of equations is now diagonally dominant. Gauss-Seidel method gives iteration
x1(k+1) = [8 + x2(k) – x3(k)]/4
x2(k+1) = – [23 – 3x1(k+1) – 2x3(k)]/6
x3(k+1) = [17 – x1(k+1) + 3x2(k+1)]/7.

Starting with the initial approximations x1 = 0.9, x2 = – 3.1, x3 = 0.9, we obtain the
following results.

First iteration:

Second iteration:

Third iteration:

Fourth iteration:

We find

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 34 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Since, all the errors in magnitude are less than 0.005, the required solution is
x1 = 0.9998, x2 = – 3.0002, x3 = 0.9999.
Rounding to two decimal places, we get x1 = 1.0, x2 = – 3.0, x3 = 1.0.

3. Eigen Value Problems


3.1. Eigen Value and Eigen Vectors

The concept of eigen values and finding eigen values and eigen vectors of a given matrix
are very important for engineers and scientists.
Consider the eigen value problem

(1.49)

The eigen values of a matrix A are given by the roots of the characteristic equation.

(1.50)

If the matrix A is of order n, then expanding the determinant, we obtain the characteristic
equation as

(1.51)

For any given matrix we write the characteristic equation (1.50), expand it and find the
roots λ1, λ2,..., λn, which are the eigen values. The roots may be real, repeated or complex. Let xi
be the solution of the system of the homogeneous equations (1.49), corresponding to the eigen
value λi. These vectors xi, i = 1, 2, …, n are called the eigen vectors of the system. There are
several methods for finding the eigen values of a general matrix or a symmetric matrix. In the
syllabus, only the power method for finding the largest eigen value in magnitude of a matrix and
the corresponding eigen vector, is included.

3.2. Power Method

The method for finding the largest eigen value in magnitude and the corresponding eigen
vector of the eigen value problem Ax = λ x, is called the power method.

What is the importance of this method? Let us re-look at the Remarks 20 and 23. The
necessary and sufficient condition for convergence of the Gauss-Jacobi and Gauss-Seidel
iteration methods is that the spectral radius of the iteration matrix H is less than one unit, that is,
ρ(H) < 1, where ρ(H) is the largest eigen value in magnitude of H. If we write the matrix
formulations of the methods, then we know H. We can now find the largest eigen value in
magnitude of H, which determines whether the methods converge or not.
We assume that λ1, λ2,..., λn are distinct eigen values such that

| λ1 | > | λ2 | > ... > | λn |. (1.52)

Let v1, v2,..., vn be the eigen vectors corresponding to the eigen values λ1, λ2,..., λn,
respectively. The method is applicable if a complete system of n linearly independent eigen
vectors exist, even though some of the eigen values λ2, λ3,..., λn, may not be distinct. The n
linearly independent eigen vectors form an n-dimensional vector space. Any vector v in this space
of eigen vectors v1, v2,..., vn can be written as a linear combination of these vectors. That is,

v = c1v1 + c2v2 + ... + cn vn. (1.53)

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 35 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Premultiplying by A and substituting Av1 = λ1v1, Av2 = λ2v2,..., Avn = λnvn, we get

Premultiplying repeatedly by A and simplifying, we get

(1.54)

(1.55)

As k → ∞, the right hand sides of (1.54) and (1.55) tend to λ1k c1v1 and λ1k+1 c1v1, since
| λi /λ1 | < 1, i = 2, 3, …, n. Both the right hand side vectors in (1.54), (1.55)

[c1v1 + c2(λ2/λ1)k v2 + ... + cn (λn/λ1)k vn],


and [c1v1 + c2(λ2/λ1)k+1 v2 + ... + cn (λn/λ1)k+1 vn]

tend to c1v1, which is the eigen vector corresponding to λ1. The eigen value λ1 is obtained as the
ratio of the corresponding components of Ak+1v and Akv. That is,

(1.56)

where the suffix r denotes the rth component of the vector. Therefore, we obtain n ratios, all of
them tending to the same value, which is the largest eigen value in magnitude, | λ1 |.

When do we stop the iteration The iterations are stopped when all the magnitudes of the
differences of the ratios are less than the given error tolerance.

Remark 24 The choice of the initial approximation vector v0 is important. If no suitable


approximation is available, we can choose v0 with all its components as one unit, that is, v0 = [1,
1, 1,...,1]T. However, this initial approximation to the vector should be non-orthogonal to v1.

Remark 25 Faster convergence is obtained when | λ2 | << | λ1 |.

As k → ∞ , premultiplication each time by A, may introduce round-off errors. In order to


keep the round-off errors under control, we normalize the vector before premultiplying by A. The
normalization that we use is to make the largest element in magnitude as unity. If we use this
normalization, a simple algorithm for the power method can be written as follows.

(1.57)
(1.58)

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 36 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

where mk+1 is the largest element in magnitude of yk+1. Now, the largest element in magnitude of
vk+1 is one unit. Then (1.56) can be written as

(1.59)

and vk+1 is the required eigen vector.

Remark 26 It may be noted that as k → ∞ , mk+1 also gives | λ1 |.


Remark 27 Power method gives the largest eigen value in magnitude. If the sign of the eigen
value is required, then we substitute this value in the determinant | A – λ1I | and find its value. If
this value is approximately zero, then the eigen value is of positive sign. Otherwise, it is of negative
sign.

Example:
1 2
1) Determine the dominant eigen value of A = by power method.
3 4

Solution:
Let the initial approximation to the eigen vector be v0. Then, the power method is given by

where mk+1 is the largest element in magnitude of yk+1. The dominant eigen value in
magnitude is given by

and vk+1 is the required eigen vector.


Let v0 = [1 1]T. We have the following results.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 37 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

Now, we find the ratios

We obtain the ratios as

The magnitude of the error between the ratios is | 5.37225 – 5.37229 | = 0.00004< 0.00005.
Hence, the dominant eigen value, correct to four decimal places is 5.3722.

VI. LEARNING ACTIVITIES

DIRECT METHODS
A. Solve the following system of equations by Gauss elimination method.

B. Solve the following system of equations by Gauss-Jordan method.

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 38 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

C. Find the inverses of the following matrices by Gauss-Jordan method.

INDIRECT METHODS
A. Solve the following system of equations using the Gauss-Jacobi iteration method.

B. Solve the following system of equations using the Gauss-Seidel iteration method.

VII. ASSIGNMENT

1. When the system of algebraic equations is large, how do we conclude that it is consistent or not,
using the Gauss elimination method?

2. What is an augmented matrix of the system of algebraic equations Ax = b ?

3. Describe the principle involved in the Gauss elimination method.

4. Define an iterative procedure for solving a system of algebraic equations Ax = b. What do we mean
by convergence of an iterative procedure?

5. How do we terminate an iterative procedure for the solution of a system of algebraic equations Ax =
b?

6. Which method, Gauss-Jacobi method or Gauss-Seidel method converges faster, for the solution of a
system of algebraic equations Ax = b ?

7. Explain in 2-3 sentences. When do we use the power method?

8. Site another example for power method, use 3 x 3 matrix

9. Show that the following systems of equations are inconsistent using the Gauss elimination
method.
a.) b.)

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 39 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”
Republic of the Philippines
NUEVA VIZCAYA STATE UNIVERSITY
Bayombong, Nueva Vizcaya
INSTRUCTIONAL MODULE
IM No.03:IM-MATH11-1STSEM-2020-2021

VIII. REFERENCES

Chapra, S. C., & Canale, R. P. (2010). Numerical Methods for Engineers (Sixth Edition). New York City: McGraw-Hill.
Dukkipati, R. V. (2010). Numerical Methods. New Delhi: New Age International Publisher.
MathisFun. (2017). Math is Fun Advanced. Retrieved from MathisFun.com: https://www.mathsisfun.com/data/least-
squares-regression.html
S.R.K. Iyengar, R. J. (2009). Numerical Methods. New Delhi: New Age International Publishers.
Tomar, S. (2018, January 08). Geeks for geeks. Retrieved from https://www.geeksforgeeks.org/:
https://www.geeksforgeeks.org/diagonally-dominant-matrix/
University of Pittsburgh. (n.d.). Math Pitt. Retrieved from math.pitt.edu:
http://www.math.pitt.edu/~trenchea/math1070/MATH1070_5_Rootfinding.pdf

NVSU-FR-ICD-05-00 (081220) “In accordance with Section 185, Fair use of a Copyrighted Work of Republic Page 40 of 40
Act 8293, the copyrighted works included in this material may be reproduced
for educational purposes only and not for commercial distribution.”

You might also like