Vous êtes sur la page 1sur 9

CHAPTER 8: Linear Algebraic Equations and Matrices

INTRODUCTION 2. Diagonal Matrix


- A square matrix having non-zero
We were taught in algebra of solving values for the major diagonal
simultaneous algebraic equations. Several elements while the rest of the
methods were introduced to evaluate the elements are all zeros.
unknowns. These methods yield satisfactory
results and quite few were really applied in 𝑎𝑎11 0 0 0
practice. Along the course, we’ve been taught 0 𝑎𝑎22 0 0
� �
to use these methods and we find ourselves to 0 0 𝑎𝑎33 0
use few of the methods in practice that made 0 0 0 𝑎𝑎44
us feel comfortable of using.

Along this chapter, we will deal with linear 3. Identity Matrix


equation using matrix solution. First, we will - A diagonal matrix with major
refresh our knowledge about matrix diagonal elements of scalar
operation and later discuss the application of number unity (value of 1).
matrix to solve simultaneous algebraic
equations. 1 0 0 0
0 1 0 0
� �
0 0 1 0
TYPES OF MATRICES 0 0 0 1

4. Triangular Matrix
A matrix is a rectangular array of elements - A square matrix having zero or
arranged into rows and columns, generally non-zero elements values on
enclosed in brackets. The following above or below the major
examples describes the types of matrices: diagonal elements while the rest
(Hoffman, 2001) of the elements are zero.

𝑎𝑎11 𝑎𝑎12 𝑎𝑎13 𝑎𝑎14


0 𝑎𝑎22 𝑎𝑎23 𝑎𝑎24
1. Square Matrix � 0 0 𝑎𝑎33 𝑎𝑎34 �
- A matrix with element values of
0 0 0 𝑎𝑎44
zero or non-zero having equal
(Upper triangular matrix)
number of rows and columns.

𝑎𝑎11𝑎𝑎12 𝑎𝑎13 𝑎𝑎14 𝑎𝑎11 0 0 0


𝑎𝑎21𝑎𝑎22 𝑎𝑎23 𝑎𝑎24 𝑎𝑎21 𝑎𝑎22 0 0
�𝑎𝑎 � �
31𝑎𝑎32 𝑎𝑎33 𝑎𝑎34 � 𝑎𝑎31 𝑎𝑎32 𝑎𝑎33 0
𝑎𝑎41𝑎𝑎42 𝑎𝑎43 𝑎𝑎44 𝑎𝑎41 𝑎𝑎42 𝑎𝑎43 𝑎𝑎44
4 x 4 matrix (Lower triangular matrix)
(4 rows by 4 columns matrix)
5. Tridiagonal Matrix So…
- A square matrix having non-zero
elements on the three major 1+5 2−4 3+3
diagonal elements while the rest Cij = �−2 + 4 3 − 3 4+2 �
of the elements are zero. 3+3 4−2 −5 + 1

𝑎𝑎11 𝑎𝑎12 0 0 Then…


𝑎𝑎 𝑎𝑎22 𝑎𝑎23 0 6 −2 6
� 21 � Cij = �2 0 6�
0 𝑎𝑎32 𝑎𝑎33 𝑎𝑎34 Ans.
0 0 𝑎𝑎43 𝑎𝑎44 6 2 −4

6. Banded Matrix Subtraction goes the same way.


- A square matrix having all
elements equal to zero except for B. Matrix Multiplication
the particular diagonals.
Matrix multiplication is only allowed when the
𝑎𝑎11 𝑎𝑎12 0 𝑎𝑎14 0 number of columns of the first matrix A is equal
𝑎𝑎21 𝑎𝑎22 𝑎𝑎23 0 𝑎𝑎25 to the number of rows of matrix B.
� 0 𝑎𝑎32 𝑎𝑎33 𝑎𝑎34 0 �
� �
𝑎𝑎41 0 𝑎𝑎43 𝑎𝑎44 𝑎𝑎45 Aij . Bmn = (AB)in
0 𝑎𝑎52 0 𝑎𝑎54 𝑎𝑎55
Where: i, m = number of rows
j, n = number of columns
MATRIX OPERATIONS
j must be equal to m (j = m) to satisfy the
condition.
A. Matrix Addition and Subtraction
The resulting product (AB) is the sum of the
products of the row elements of matrix A
Adding and subtracting can only be done multiplied by the column elements of matrix B.
when matrices are of the same size.
Example 8.2:
Since addition of real number is 5 −4 3 1 2
commutative, then addition of matrices is �
Aij = 4 −3 2� �
Bmn = −2 3�
commutative as well. 3 −2 1 3 4
Thus, the addition of matrices Aij + Bij is A is a 3 x 3 matrix and B is a 3 x 2 matrix. Thus…
simply the corresponding sum of their i = 3, j = 3, m = 3, and n = 2
respective matrix elements. the resulting matrix is a (i x n) 3 x 2 matrix.

Aij + Bij = Cij Then (AB)in becomes…

Example 8.1: 5(1) + (−4)(−2) + 3(3) 5(2) + (−4)(3) + 3(4)


�4(1) + (−3)(−2) + 2(3) 4(2) + (−3)(3) + 2(4)�
1 2 3 5 −4 3 3(1) + (−2)(−2) + 1(3) 3(2) + (−2)(3) + 1(4)
Aij = �−2 3 4� �
Bij = 4 −3 2�
3 4 −5 3 −2 1 22 10
(AB)in = �16 7� Ans.
10 4
C. Transposed Matrix 1 2
� � we get a2 = 2(-2)=-4
−2 3
Transposed operation is converting the rows into
with the sign convention it will become -4(-1)=4
columns and columns into rows.
Now, take the sum of a1 and a2 to obtain the
Example 8.3: determinant of the above matrix.
Transpose the following matrix.
5 −4 3 det(M)=7
A = �4 −3 2�
3 −2 1 generally, det(M) = 1(3) – [2(-2)] = 7.
then
5 4 3 Example 8.4:
AT = �−4 −3 −2� Ans. Determine the determinant of the
3 2 1 following 3 x 3 matrix.
5 6 3
D. Determinant of Matrix M = �4 −3 2�
3 −2 1
The determinant of a matrix is a scalar
representation or property of only the square Select any row or column to be our reference, the
matrix. answer is the same in any case.
The determinant of a 1 x 1 matrix is the element
itself. This is a very basic rule in determining the Let’s select row 1…
determinants of a larger square matrices. 5 6 3 5 6 3 5 6 3
�4 −3 2� �4 −3 2� �4 −3 2�
The sign convention when adding the products of 3 −2 1 3 −2 1 3 −2 1
a11 a12 a13
the minors and the chosen element.
+ − +
�− + −� for element a11 we have the minor submatrix
+ − + −3 2
� �
−2 1
Let us take an example of a 2 x2 matrix. then…
1 2 −3 2
det�� �� = (-3)(1) – (-2)(2) = 1
M=� � −2 1
−2 3
and a11 = 5(1) = 5
Determine det(M).
for element a12:
let’s choose the first element of the first row and
4 2
first column and the intersection. Cross out the det�� �� = 4(1) – 3(2) = -2
3 1
row and column that intersect into it. and a12 = (6)(-2) = -12
1 2
� �
−2 3
for element a13:
the remaining element (3) is a 1 x 1 matrix with
4 −3
the value of 3 called the minor of the first element det�� �� = 4(-2) – (-3)(3) = 1
3 −2
we’d chosen. Then multiply the element by the and a13 = 3(1) = 3
minor.
a1 = 1(3)=3 To determine the determinant of matrix M, take
the sum of the elements a11, a12, and a13
next we choose the first element of the second considering the sign convention.
column. The same way, we cross out the row and
column that intersect.
det(M) = a11 - a12 + a13 = 5 –(-12) + 3 a12 =12
det(M) = 20 Ans. a13 = 21
a21 = -2
a22 = -4
E. Inverse Matrix a23 = -2
a31 = 1
Inverse of a square matrix is just the reciprocal of a32 = -28
a matrix and noted as M-1. Since there were no a33 = -39
matrix division operation, use inverse matrix
instead. 4. Create adjoint matrix.
1 12 21 + − +
Steps: adj(M) = �−2 −4 −2 � . �− + −�
1 −28 −39 + − +
1. Find the determinant of the matrix.
1 −12 21
2. Find the transposed matrix. adj(M) = �2 −4 2 �
3. Find the determinant of each 2 x 2 1 28 −39
minor matrices of each elements of
the transposed matrix (cofactors). 5. Divide by the determinant.
4. Create a new matrix from the above
cofactors considering the sign 1
M-1 = � � adj(M)
convention (adjoint matrix). det(𝑀𝑀)
5. Divide each element of the adjoint
1 −12 21
matrix with the determinant we
20 20 20
obtain from step 1. �2 −4 2 �
M-1 = �20 20 20 �
1 28 −39
20 20 20
Example 8.5:
Find the inverse of the following matrix. 0.05 −0.6 0.05
M-1 = � 0.1 −0.2 0.1 � Ans.
5 6 3 0.05 1.4 −1.95
M = �4 −3 2�
3 −2 1

1. Find the determinant of the matrix.

As discussed above,
det(M) = 20

2. Find the transposed matrix.

5 4 3
MT = �6 −3 −2�
3 2 1

3. Find the determinant of minor matrices of MT.

a11 = 1
SOLVING ALGEBRAIC EQUATIONS 3. Find the inverse matrix A.
1 −12 21
USING MATRICES 1
A-1 = �2 −4 2 �
20
1 28 −39
Simultaneous algebraic equation can also be
solved using matrices. 4. Find the product of A-1 and D.
𝑥𝑥 1 1 −12 21 −4
Steps: �𝑦𝑦� = �2 −4 2 � . � 15 �
𝑧𝑧 20
1 28 −39 19
1. Write the equations in a form of
a𝑥𝑥 + b𝑦𝑦 + c𝑧𝑧 = d 𝑥𝑥 1 −4 − 180 + 399
𝑦𝑦
� �= � −8 − 60 + 38 �
𝑧𝑧 20
2. Create the appropriate matrices of the −4 + 420 − 741
equations using the general form Ax = D. 𝑥𝑥
Where: 1 215
�𝑦𝑦� = � −30 �
A = Coefficient matrix 𝑧𝑧 20
−325
D = Constant matrix
x = are the unknown matrix then we obtain the following values…
𝑥𝑥 = 10.75 Ans.
3. Find the inverse matrix of the coefficient 𝑦𝑦 = −1.5 Ans.
matrix (A-1). 𝑧𝑧 = −16.25 Ans.

4. Find the product of A-1 and D as the


matrix values of the unknown x.

Example 8.6:

Find the unknowns of the following


algebraic equations.

5x + 6y + 3z + 4 = 0
4x − 3y + 2z − 15 = 0
3x − 2y + z − 19 = 0

1. Rewrite the equations.


5x + 6y + 3z = −4
4x − 3y + 2z = 15
3x − 2y + z = 19

2. Create the appropriate matrices.

5 6 3 𝑥𝑥 −4
A = �4 −3 2�, x = �𝑦𝑦� and D = � 15 �
3 −2 1 𝑧𝑧 19
CHAPTER 9: Gaussian Elimination

INTRODUCTION solution which in the real-world application


would be theoretical.
The set of simultaneous algebraic equations
will be solved by eliminating the unknowns CRAMER’S RULE
successively. This method is commonly used
in solving simultaneous algebraic equations. The linear algebraic equation can be
expressed in a fraction of two determinants.
(Chapra, 2012)
SIMPLE ELIMINATION
The numerator is the determinant of matrix
Let’s take an example of 3 x 3 equations (3 from the equation replacing the column of
unknowns with 3 equations). unknowns in question by the constants.
(Hamming, 1962) While the denominator is the matrix of the
coefficients of the unknowns.
(Eq. 1) 2𝑦𝑦 + 𝑧𝑧 = −8
(Eq. 2) 𝑥𝑥 − 2𝑦𝑦 − 3𝑧𝑧 = 0 The general equation is Ax = D.
(Eq. 3) −𝑥𝑥 + 𝑦𝑦 + 2𝑧𝑧 = 3 Where:
A = Coefficient matrix
Part 1. Elimination: D = Constant matrix
x = are the unknown matrix
Add equations 2 & 3 → Eq. 4
𝑥𝑥 − 2𝑦𝑦 − 3𝑧𝑧 = 0
Steps:
−𝑥𝑥 + 𝑦𝑦 + 2𝑥𝑥 = 3
−𝑦𝑦 − 𝑧𝑧 = 3 1. Write the equations in a form of
Multiply Eq. 4 by 2 then add Eq. 1. a𝑥𝑥 + b𝑦𝑦 + c𝑧𝑧 = d
(Eq. 4) −2𝑦𝑦 − 2𝑧𝑧 = 6
(Eq. 1) 2𝑦𝑦 + 𝑧𝑧 = −8 2. Create the appropriate matrices of the
we get 𝒛𝒛 = 𝟐𝟐 Ans. equations.

Part 2. Back substitution: 3. Replace the unknown column in


Solving for 𝑦𝑦 when 𝑧𝑧 = 2 using Eq. 1 question by the constants (D) to form
we get 𝒚𝒚 = −𝟓𝟓 Ans. a new matrix for their respective
unknowns.
Finally, solving for 𝑥𝑥 using Eq. 2
𝑥𝑥 − 2(−5) − 3(2) = 0 4. Get the determinant of the coefficient
we get 𝒙𝒙 = −𝟒𝟒 Ans. matrix A.

Imagine the above example having several 5. Get the determinants of each
unknowns, it would have much longer unknown matrix.
6. Solve each unknown, dividing each 5. Get the determinants of each
unknown determinant by the unknown matrix.
coefficient determinant.
det(X) = 215
Example 9.1: det(Y) = -30
det(Z) = -325
Find the unknowns of the following
algebraic equations using Cramer’s rule. 6. Solve each unknown.

5x + 6y + 3z + 4 = 0 det(X) 215
4x − 3y + 2z − 15 = 0 𝑥𝑥 = ; 𝑥𝑥 =
det(A) 20
3x − 2y + z − 19 = 0

𝒙𝒙 = 𝟏𝟏𝟏𝟏. 𝟕𝟕𝟕𝟕 Ans.


1. Rewrite the equations.
det(Y) −30
5x + 6y + 3z = −4 𝑦𝑦 = ; 𝑦𝑦 =
4x − 3y + 2z = 15 det(A) 20
3x − 2y + z = 19
𝒚𝒚 = −𝟏𝟏. 𝟓𝟓 Ans.
2. Create the appropriate matrices.
5 6 3 𝑥𝑥 −4 det(X) −325
A = �4 −3 2�, x = �𝑦𝑦� and D = � 15 � 𝑧𝑧 = ; 𝑧𝑧 =
det(A) 20
3 −2 1 𝑧𝑧 19

3. Replace the unknown column with D. 𝒛𝒛 = −𝟏𝟏𝟏𝟏. 𝟐𝟐𝟐𝟐 Ans.

−4 6 3
X = � 15 −3 2�
19 −2 1

5 −4 3
Y = �4 15 2� PIVOTING
3 19 1
This is an alternative method to simple Gauss
5 6 −4 Elimination when during the elimination and
Z = �4 −3 15 �
3 −2 19 back substitution parts possibly a division by
zero may occur.
4. Get the determinant of the coefficient
matrix A. The main objective of this method is to
transform the augmented matrix into upper
det(A) = 20 triangular matrix by selecting the largest
pivotal element and move it to the top row
called the Partial Pivoting.
Example 9.2: d. On Row 3, we convert it to an
algebraic equation form:
Find the unknown using Gauss 5 1625
Elimination and pivoting. 0x − 0y + 7 z = − 140
then…
3x − 2y + z = 19 (7)(1625)
5x + 6y + 3z = −4 𝑧𝑧 = −
(140)(5)
4x − 3y + 2z = 15
𝟔𝟔𝟔𝟔
1. Let’s create the augmented matrix. 𝒛𝒛 = − = −𝟏𝟏𝟏𝟏. 𝟐𝟐𝟐𝟐 Ans.
𝟒𝟒
3 −2 1 19
�5 6 3 −4� 3. Back substitution using the value of z.
4 −3 2 15
a. From row 2
the select the largest pivotal element
28 4 65 107
from column 1 and rearrange the 0x − 5
y − 5 �− 4 � = 5
rows.
𝟒𝟒𝟒𝟒 𝟑𝟑
𝒚𝒚 = − = − = −𝟏𝟏. 𝟓𝟓 Ans.
5 6 3 −4 𝑅𝑅1 (𝑟𝑟𝑟𝑟𝑟𝑟 1) 𝟐𝟐𝟐𝟐 𝟐𝟐
�3 −2 1 19 � 𝑅𝑅2 (𝑟𝑟𝑟𝑟𝑟𝑟 2)
4 −3 2 15 𝑅𝑅3 (𝑟𝑟𝑟𝑟𝑟𝑟 3) b. From row 1
3 65
5𝑥𝑥 + 6 � � + 3 � � = −4
2. Eliminate the rest of the elements 2 4
below the pivotal elements.
solving for x…
3
a. R2’ = R2 –� �R1 becomes… 𝟐𝟐𝟐𝟐𝟐𝟐
5 𝒙𝒙 = = 𝟏𝟏𝟏𝟏. 𝟕𝟕𝟕𝟕 Ans.
5 6 3 −4 𝟐𝟐𝟐𝟐
28 4 107
�0 − − �
5 5 5
4 −3 2 −15 The same result is achieved with Example
4
b. R3’ = R3 –� �R1 becomes… 9.1.
5
5 6 3 −4
28 4 107
�0 − 5 − 5 5 ��

39 2 91
0 − −
5 5 5
c. Eliminate the first element of R3.
39
R3’ = R3 –� �R2
28
5 6 3 −4
28 4 107
�0 − − �
� 5 5 5 �
5 1625
0 0 −
7 140
BIBLIOGRAPHY
Chapra, S. C. (2012). Applied Numerical
Methods with MATLAB for Engineers
and Scientists 3rd Ed. New York:
McGraw-Hill.

Hamming, R. (1962). Numerical Methods for


Scientists & Engineers 2nd ed. New
York: Dover Publication, Inc.

Hoffman, J. D. (2001). Numerical Methods for


Engineers and Scientists. New York:
Marcel Dekker, Inc.

Vous aimerez peut-être aussi