CE007-Module 2-Solution To System of Linear Equation Using Direct Methods
CE007-Module 2-Solution To System of Linear Equation Using Direct Methods
Module:
Linear System
A linear system is a set of n equations A linear system can be written in
that can solve n number of unknowns. matrix form [𝐴𝑥 = 𝐵]:
This can be written as:
Example:
Express the linear system shown below into its matrix form:
Solution:
𝑥1 + 3𝑥2 + 6𝑥3 = −3 1 3 6 𝑥1 −3
−2𝑥1 − 5𝑥2 + 3𝑥3 = 3 −2 −5 3 𝑥2 = 3
3𝑥1 + 4𝑥2 − 6𝑥3 = 6 3 4 −6 𝑥3 6
The set 𝑥 = 𝑥1 , 𝑥2 , … , 𝑥𝑛 is considered the solution of the linear system if they are
correct in all equations.
Example:
Prove that 𝑥1 = 6, 𝑥2 = −3, 𝑥3 = 0 is the solution of the linear system shown below:
𝑥1 + 3𝑥2 + 6𝑥3 = −3
−2𝑥1 − 5𝑥2 + 3𝑥3 = 3
3𝑥1 + 4𝑥2 − 6𝑥3 = 6
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Intended Learning Outcomes (ILOs)
Uniqueness of
Solution
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.2: Uniqueness of Solution
A linear system can have zero, one, or infinite solution, as shown in the figure
below.
Figure 2.1: Graphical Representation of Linear System with (a) One solution,
(b) No solution, and (c) an infinite number of solutions.
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.2: Uniqueness of Solution
The type of coefficient matrix A can determine the uniqueness of the solution.
This can be done by assessing the singularity of the matrix A (by definition, a
singular matrix is a square matrix whose determinant is equal to zero).
Solution:
By computing the determinant of its coefficient matrix:
3 −5
𝐴 = = 3 −2 − 9 −5 = 39
9 −2
since 𝐴 = 0, the system has exactly one set of solutions.
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.2: Uniqueness of Solution
A. Direct Methods
1. Gauss Elimination The exact value of the solution set
2. Gauss-Jordan Method can be obtained.
3. LU – Decomposition
4. Row Pivoting
B. Iterative Methods
1. Gauss-Seidel The approximate value is obtained
2. Jacobi Method by iteration.
3. Conjugate Gradient
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Intended Learning Outcomes (ILOs)
Solving System of
Linear Equation:
Gauss Elimination
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.3: Solving System of Linear Equation: Gauss Elimination
1. Gauss Elimination
Example:
Determine the solution of the linear system shown below using Gauss Elimination
2𝑥1 − 4𝑥2 + 𝑥3 = −11
𝑥1 + 3𝑥2 + 2𝑥3 = −4
3𝑥1 + 5𝑥2 + 2𝑥3 = −2
Solution:
1. Construct an augmented matrix representing the linear system.
2 −4 1 −11
1 3 2 −4
3 5 2 −2
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.3: Solving System of Linear Equation: Gauss Elimination
Solution:
2. Perform the Elimination Phase.
1
2 −4 1 −11 𝑅2 −
2
𝑅1 2 −4 1 −11
1 3 2 −4 = 0 5 3/2 3/2
3
3 5 2 −2 𝑅3 − 𝑅1 0 11 1/2 29/2
2
2 −4 1 −11 2 −4 1 −11
11
0 5 3/2 3/2 𝑅3 − 𝑅2 = 0 5 3/2 3/2
5
0 11 1/2 29/2 0 0 −14/5 56/5
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.3: Solving System of Linear Equation: Gauss Elimination
Solution:
3. Perform the Back Substitution Phase:
14 56 56/5
Eq. 3: − 𝑥3 = ∴ 𝑥3 = −14/5 =−4
5 5
3 3 13 3 3
Eq. 2: 5𝑥2 + 𝑥3 = ∴ 𝑥2 = − (−4) =
52 2 2
2 2
𝟏 𝟑
∴ 𝒙𝟏 = − , 𝒙𝟐 = , 𝒙𝟑 = −𝟒 , is the solution of the linear system
𝟐 𝟐
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.3: Solving System of Linear Equation: Gauss Elimination
Example:
Determine the solution of the linear system shown below using Gauss Elimination
6 −4 1 −14 22
𝐴 = −4 6 −4 𝐵 = 36 −18
1 −4 6 6 7
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Solving System of
Linear Equation:
Gauss-Jordan Method
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.4: Solving System of Linear Equation: Gauss-Jordan Method
2. Gauss-Jordan Method
Example:
Determine the solution of the linear system shown below using Gauss Jordan
Method 2𝑥1 − 4𝑥2 + 𝑥3 = −11
𝑥1 + 3𝑥2 + 2𝑥3 = −4
3𝑥1 + 5𝑥2 + 2𝑥3 = −2
Solution:
1. Construct an augmented matrix representing the linear system.
2 −4 1 −11
1 3 2 −4
3 5 2 −2
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.4: Solving System of Linear Equation: Gauss-Jordan Method
Solution:
2. Perform the Elimination Phase.
1
2 −4 1 −11 𝑅2 −
2
𝑅1 2 −4 1 −11
1 3 2 −4 3 = 0 5 3/2 3/2
3 5 2 −2 𝑅3 − 𝑅1 0 11 1/2 29/2
2
−4
2 −4 1 −11 𝑅1 − 𝑅2 2 0 11/5 −49/5
5
0 5 3/2 3/2 11
= 0 5 3/2 3/2
0 11 1/2 29/2 𝑅3 − 𝑅2 0 0 −14/5 56/5
5
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.4: Solving System of Linear Equation: Gauss-Jordan Method
Solution:
2. Perform the Elimination Phase.
−11
2 0 11/5 −49/5 𝑅1 − 𝑅3 2 0 0 −1
14
0 5 3/2 3/2 −15 = 0 5 0 15/2
0 0 −14/5 56/5 𝑅2 − 28 𝑅3 0 0 −14/5 56/5
𝑅1 /2
2 0 0 −1 𝑅2 /5 1 0 0 −1
0 5 0 15/2 −14 = 0 1 0 3/2
𝑅3 /( )
0 0 −14/5 56/5 5 0 0 1 −4
𝟏 𝟑
∴ 𝒙𝟏 = − , 𝒙𝟐 = , 𝒙𝟑 = −𝟒 , is the solution of the linear system
𝟐 𝟐
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Solving System of
Linear Equation:
LU Decomposition
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
3. LU Decomposition
Decomposition method, sometimes called lower-upper (LU)
decomposition or factorization of a matrix, can be defined as the product of a
lower and an upper triangular matrices. This product sometimes comprises a
permutation matrix as well.
It is possible to show that any square matrix A can be expressed as a
product of a lower triangular matrix L and an upper triangular matrix U:
𝑨 = 𝑳𝑼
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
3. LU Decomposition
Three commonly used decompositions are:
Name Constraints
Doolittle's Decomposition 𝐿𝑖𝑖 = 1, 𝑖 = 1, 2, … , 𝑛
Crout's Decomposition 𝑈𝑖𝑖 = 1, 𝑖 = 1, 2, … , 𝑛
Choleski's Decomposition 𝐿 = 𝑈𝑇
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
1 0 0 𝑑 𝑒 𝑓
𝐿= 𝑎 1 0 𝑈= 0 𝑔 ℎ
𝑏 𝑐 1 0 0 𝑖
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
1 0 0 𝑑 𝑒 𝑓
𝐿= 𝑎 1 0 𝑈= 0 𝑔 ℎ
𝑏 𝑐 1 0 0 𝑖
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
𝑎 0 0 1 𝑔 ℎ
𝐿= 𝑏 𝑐 0 𝑈= 0 1 𝑖
𝑑 𝑒 𝑓 0 0 1
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
𝑎 0 0 𝑎 𝑏 𝑑
𝐿= 𝑏 𝑐 0 𝐿𝑇 = 0 𝑐 𝑒
𝑑 𝑒 𝑓 0 0 𝑓
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.5: Solving System of Linear Equation: LU Decomposition
𝑎 0 0 𝑎 𝑏 𝑑
𝐿= 𝑏 𝑐 0 𝐿𝑇 = 0 𝑐 𝑒
𝑑 𝑒 𝑓 0 0 𝑓
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Solving System of
Linear Equation:
Row Pivoting
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.6: Solving System of Linear Equation: Row Pivoting
4. Row Pivoting
The previous section discusses that gauss elimination cannot be
performed if the first row’s first element is zero. However, the most practical
remedy is to interchange the first row and any row with the non-zero first
element if this scenario happens. This technique is called row pivoting.
0 1 5 3 7 2
𝐴= 3 7 2 𝐴= 0 1 5
9 6 8 9 6 8
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.6: Solving System of Linear Equation: Row Pivoting
4. Row Pivoting
Example:
Three cable tension AB, AC and AD,
shown in the Figure, act top of the
flagpole, and their resultant is 400 kN
directed towards –z axis. To solve for
the tension in each cable, the
equations below are the established
using the equations of equilibrium.
Determine the tension of each cable
using Gauss Elimination
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Intended Learning Outcomes (ILOs)
ANY
QUESTION?
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
End of Presentation
Franklyn Manggapis
FRANKLYN F. MANGGAPIS
Instructor
Civil Engineering Department https://www.researchgate.net/profile/
Technological Institute of the
Philippines - Quezon Franklyn-Manggapis
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Preliminary Coursework Activity #1
Situation #1:
solve the following system of linear equation (show your solution and carry five
significant figures during the computation:
3𝑥1 − 0.1𝑥2 −0.2𝑥3 = 7.85
0.1𝑥1 + 7𝑥2 − 0.3𝑥3 = −19.3
0.3𝑥1 − 0.2𝑥2 + 10𝑥3 = 71.4
Situation #2:
Solve the following system of linear equation (show your solution and carry five
significant figures during the computation:
10𝑥1 + 2𝑥2 −𝑥3 +𝑥4 = 27
−3𝑥1 − 6𝑥2 + 2𝑥3 − 3𝑥4 = −61.5
2𝑥1 − 5𝑥2 − 3𝑥3 − 2𝑥4 = 0
𝑥1 + 𝑥2 + 5𝑥3 − 2𝑥4 = −21.5