0% found this document useful (0 votes)
45 views

CE007-Module 2-Solution To System of Linear Equation Using Direct Methods

Ccfghhdffffff

Uploaded by

qjbjasis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

CE007-Module 2-Solution To System of Linear Equation Using Direct Methods

Ccfghhdffffff

Uploaded by

qjbjasis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

CE007: Numerical Solution on CE Problems

Module:

02 Solution for System


of Linear Equation:
Direct Methods
PREPARED BY: FRANKLYN F. MANGGAPIS
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Textbook Reference:

Chapra, S. & Canale, R. (2021).


Numerical Methods for Engineers (7th
edition). New York, USA: McGraw-
Hill Education
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Intended Learning Outcomes (ILOs)

At the end of this presentation, the student should be able to:

01 Define linear systems and construct their matrix


representation.

Determine the uniqueness of a solution of a linear


02
system.

03 Determine the solution of the linear system using direct


methods
MODULE 2.0: Solution for System of Linear Equation: Direct Methods

Linear System and


its Solution
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.1: Linear System and its Solution

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:

𝐴11 𝑥1 + 𝐴12 𝑥2 + ⋯ + 𝐴1𝑛 𝑥𝑛 = 𝐵1 𝐴11 𝐴12 ⋯ 𝐴1𝑛 𝑥1 𝐵1


𝐴21 𝑥1 + 𝐴22 𝑥2 + ⋯ + 𝐴2𝑛 𝑥𝑛 = 𝐵2 𝐴21 𝐴22 ⋯ 𝐴2𝑛 𝑥2 𝐵2
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ = ⋮
𝐴𝑛1 𝑥1 + 𝐴𝑛2 𝑥2 + ⋯ + 𝐴𝑛𝑛 𝑥𝑛 = 𝐵𝑛 𝐴𝑛1 𝐴𝑛2 ⋯ 𝐴𝑛𝑛 𝑥𝑛 𝐵𝑛
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.1: Linear System and its Solution

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

Conventional Matrix Form


Form
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.1: Linear System and its Solution

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)

At the end of this presentation, the student should be able to:

✓ 01 Define linear systems and construct their matrix


representation.

Determine the uniqueness of a solution of a linear


02
system.

03 Determine the solution of the linear system using direct


methods
MODULE 2.0: Solution for System of Linear Equation: Direct Methods

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).

If 𝐴 = 0; The system has no solution or infinite number of solutions.

If 𝐴 ≠ 0; The system has one solution.


MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.2: Uniqueness of Solution
Example:

Determine the number of the solution set of the system:


3𝑥1 − 5𝑥2 = 6
9𝑥1 − 2𝑥2 = 4

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)

At the end of this presentation, the student should be able to:

✓ 01 Define linear systems and construct their matrix


representation.

Determine the uniqueness of a solution of a linear


✓ 02
system.

03 Determine the solution of the linear system using direct


methods
MODULE 2.0: Solution for System of Linear Equation: Direct Methods

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

Gauss Elimination is considered as one of the most straightforward and


most familiar methods in solving linear systems. This method consist of two
phases; the elimination phase and the back-substitution phase. In the
elimination phase, series or row operations are performed in the coefficient
matrix until it becomes an upper triangular matrix. In the back-substitution
phase, solving each element of the solution will start at the last row up to the
first row.
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
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

Eq. 1: 2𝑥1 − 4𝑥2 + 𝑥3 = −11 ∴ 𝑥1 = 12 −11− −4 +4


3
2
=−
1
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

The Gauss-Jordan method is another method similar to the Gauss


Elimination, only that the goal of this method is to transform the coefficient
matrix into an identity matrix. Unlike the previous method, it has more steps in
the elimination phase, but it has no back-substitution phase.
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Topic 2.4: Solving System of Linear Equation: 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

3.1. Doolittle’s Decomposition Method


𝐴 = 𝐿𝑈

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

3.1. Doolittle’s Decomposition Method


Example:
Use Doolittle’s decomposition method to solve the equations Ax+b, where:
𝑥1 + 4𝑥2 + 𝑥3 = 7
𝑥1 + 6𝑥2 − 𝑥3 = 13
2𝑥1 − 𝑥2 + 2𝑥3 = 5

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

3.2. Crout’s Factorization Method


𝐴 = 𝐿𝑈

𝑎 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

3.2. Crout’s Factorization Method


Example:
Use Crout’s Factorization method to solve the equations Ax+b, where:
𝑥1 + 4𝑥2 + 𝑥3 = 7
𝑥1 + 6𝑥2 − 𝑥3 = 13
2𝑥1 − 𝑥2 + 2𝑥3 = 5
𝑎 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

3.3. Cholesky Decomposition Method


𝐴 = 𝐿𝐿𝑇

𝑎 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

3.3. Cholesky Decomposition Method


Example:
Use Cholesky Decomposition method to solve the equations Ax+b, where:
2𝑥1 − 2𝑥2 − 3𝑥3 = 7
-2𝑥1 + 5𝑥2 + 4𝑥3 = −12
−3𝑥1 + 4𝑥2 + 5𝑥3 = −12

𝑎 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)

At the end of this presentation, the student should be able to:

✓ 01 Define linear systems and construct their matrix


representation.

Determine the uniqueness of a solution of a linear


✓ 02
system.

✓ 03 Determine the solution of the linear system using direct


methods
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Open Forum

ANY
QUESTION?
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
End of Presentation

THANK YOU! ☺☺☺


If you have any inquiries, please contact me at:

[email protected]

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

a. Using Gauss Elimination Method


b. Using Gauss-Jordan Method
c. Any LU Decomposition Method
MODULE 2.0: Solution for System of Linear Equation: Direct Methods
Preliminary Coursework Activity #1

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

Use either gauss elimination or gauss-jordan method

You might also like