MATH130 Lec 3.0 Solving Systems of Linear Equations

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 64

MATH 130:

NUMERICAL
SOLUTIONS TO CE
PROBLEMS
ENGR. OWEN FRANCIS A. MAONGAT, CE, RMP, RES, SO2
Instructor
1st Sem, SY 2024-2025
Lecture No. 2
Numerical Solutions to CE Problems – Solving System of Linear Equation

Desired Learning Outcomes (DLO)

• Evaluate and determine the roots of linear equations using


direct & iterative methods, applying these techniques to
effectively solve civil engineering problems.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 UNIQUE SOLUTION

 A system of equations with a unique solution has exactly one set


of values for the variables that satisfies all equations. This occurs
when the coefficient matrix is non-singular (i.e., it has a non-zero
determinant).
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 UNIQUE SOLUTION

Consider the system of equations:


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 UNIQUE SOLUTION
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 UNIQUE SOLUTION
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 MULTIPLE SOLUTIONS

 A system with multiple solutions (infinitely many solutions) occurs


when the equations are dependent, meaning one equation can
be derived from another
.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 MULTIPLE SOLUTIONS

Consider the system of equations:


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 MULTIPLE SOLUTIONS
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 TRIVAL AND NON-TRIVAL SOLUTIONS

 For homogeneous systems (where the constant terms are all


zero), the trivial solution is always present. A non-trivial solution
exists if the determinant of the coefficient matrix is zero..
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 TRIVAL AND NON-TRIVAL SOLUTIONS

Consider the system of equations:


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 TRIVAL AND NON-TRIVAL SOLUTIONS


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 TRIVAL AND NON-TRIVAL SOLUTIONS


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 NO SOLUTION

 A system with no solution occurs when the equations are


inconsistent, often geometrically represented by parallel lines
that never intersect.
.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.1 Unique and Multiple Solutions, Trivial and Non-Trivial


Solutions, No Solution

 NO SOLUTION.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2 Direct Methods


 Direct methods are algorithms that provide an exact solution to
a system of linear equations in a finite number of steps.
 These methods are typically preferred when the system is
relatively small and stability or accuracy is a concern.

 Here are some of the most commonly used direct methods:


1. Gauss Elimination Method
2. Gauss-Jordan Method
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method


 The Gaussian Elimination Method is a systematic procedure
used to solve a system of linear equations.
 It involves transforming the system's augmented matrix into an
upper triangular form using elementary row operations.
 Once in upper triangular form, back-substitution is used to find
the solutions to the variables.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method


 Gauss Elimination Algorithm:
1. Form the Augmented Matrix: Combine the coefficient matrix
and the constants from the right-hand side of the equations into
an augmented matrix.

2. Forward Elimination: Transform the augmented matrix into an


upper triangular matrix using elementary row operations (swap
rows, multiply a row by a non-zero scalar, add/subtract multiples
of rows).
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method


 Gauss Elimination Algorithm:
3. Back Substitution: Once the matrix is in upper triangular form,
solve for the variables starting from the last equation and working
upwards.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method


Example Problem:

Consider the system of linear equations:

3
2
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method

Step 1: Form the Augmented Matrix


We start by writing the system as an augmented matrix:

Step 2: Forward Elimination


We aim to make the elements below the pivot (leading
coefficient) in each column zero
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method

Step 2: Forward Elimination


1. Eliminate the first column below the pivot (10 in Row 1)
• Multiply Row 1 by ​and subtract from Row 2.
• Multiply Row 1 by ​and subtract from Row 3.
After these operations, the augmented matrix becomes:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method

Step 2: Forward Elimination


2. Eliminate the second column below the pivot ( in Row 2)
• Multiply Row 2 by ​and add it to Row 3.
The augmented matrix is now in upper triangular form:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method

Step 3: Back Elimination

Now that the matrix is in upper triangular form, we can solve for
the variables starting from the last row.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.1 Gaussian Elimination Method


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method


 The Gauss-Jordan Elimination Method is an extension of
Gaussian Elimination.
 While Gaussian Elimination transforms a system of linear
equations into an upper triangular matrix to facilitate back-
substitution, Gauss-Jordan Elimination goes a step further by
converting the matrix into Reduced Row-Echelon Form
(RREF).
 This form allows for the direct reading of solutions without the
need for back-substitution.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method


 Objectives
 Simplify the system: Transform the augmented matrix into
RREF
 Identify solutions: Easily determine whether the system has a
unique solution, infinitely many solutions, or no solution.
 Directly obtain solutions: In RREF, each leading variable
corresponds to one equation, making it straightforward to read off
the solutions.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method


 Gauss-Jordan Elimination Algorithm
1. Form the Augmented Matrix: Combined the coefficient matrix
with the constants from the right-hand side of the equations.
2. Perform Row Operations:
* Use row operations (row swapping, multiplying a row by a non-
zero constant, and adding or subtracting rows) to convert the matrix
into reduced row echelon form (RREF).
* In RREF, the leading entry in each row is 1, and all other entries
in the column containing the leading 1 are zeros.
3. Extract the Solutions: Once the matrix is in RREF, the solutions to
the system can be directly read off from the matrix.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method


Example Problem:

Consider the system of linear equations:

3
2
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 1: Form the Augmented Matrix


We start by writing the system as an augmented matrix:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

1. Divide Row 1 by 10 to make the leading coefficient 1 in


the first row:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

2. Subtract 3 times Row 1 from Row 2 to eliminate the


term in Row 2
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

3. Subtract 2 times Row 1 from Row 3 to eliminate the


term in Row 3
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

4. Divide Row 2 by 9.4 to make the leading coefficient 1 in


the second row:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

5. Subtract 0.6 times Row 2 from Row 3 to eliminate the


term in Row 3
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

6. Divide Row 3 by 9.3936 to make the leading coefficient


1 in the third row:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

7. Subtract 0.3 times Row 3 from Row 1 and 0.0106


times Row 3 from Row 2 to eliminate the terms from Rows 1
and 2:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

7. Subtract 0.3 times Row 3 from Row 1 and 0.0106


times Row 3 from Row 2 to eliminate the terms from Rows 1
and 2:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 2: Perform row operations to obtain the RREF

8. Subtract 0.2 times Row 2 from Row 1 to eliminate the


term from Rows 1:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Step 3: Read of the Solutions

The resulting matrix is in reduced row echelon form


(RREF), and the solution to the system is:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.2.2 Gauss-Jordan Elimination Method

Summary

 The Gauss-Jordan Elimination Method is a powerful tool for


solving systems of linear equations.
 It involves reducing the augmented matrix to its reduced row
echelon form, allowing for the direct extraction of the solution
without the need for back-substitution.
 This method is particularly useful when dealing with systems that
require a systematic and exact approach to finding solutions.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3 Iterative Methods


 Iterative methods are techniques for solving systems of linear
equations where a sequence of approximations converges to the
exact solution.
 These methods are particularly useful when dealing with large
systems where direct methods (like Gaussian elimination) are
computationally expensive.
 Two common iterative methods are the Jacobi Method and the
Gauss-Seidel Method.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


 The Jacobi Method is an iterative algorithm used to solve a
system of linear equations.
 The key idea is to solve each equation for the corresponding
variable assuming that all the other variables remain fixed.
 The method iteratively updates the variables until the changes
between iterations are smaller than a given tolerance.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


 Jacobi Method Algorithm:
1. Given: A system of linear equations , where A is the coefficient
matrix, x is the vector of variables, and b is the right-hand side
vector.

2. Initialize: Choose an initial guess


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


 Jacobi Method Algorithm:
3. Iterate: For each equation in the system:

Here, is the updated value of at the iteration, andare the values of


the other variables from the iteration.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


 Jacobi Method Algorithm:
4. Check Convergence: If the difference between successive
approximations is below a predetermined tolerance, stop.
Otherwise, continue iterating.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


Example Problem:

Consider the system of linear equations:

3
2
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


We can apply the Jacobi Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


We can apply the Jacobi Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


We can apply the Jacobi Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


We can apply the Jacobi Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method


We can apply the Jacobi Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.1 Jacobi Method

Continue until convergence: The process will continue until


the difference between successive iterations for each variable is
below a chosen tolerance, say 0.001.

Jacobi Method: In each iteration, all values of x1, x2​, and x3​
are calculated based on the previous values from the prior
iteration. None of the updated values are used until the next
iteration.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


 The Gauss-Seidel Method is similar to the Jacobi Method but
with one key difference: it updates the variables sequentially
within each iteration.
 This means that the current value of a variable is immediately
used in the computation of subsequent variables in the same
iteration, potentially leading to faster convergence.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


 Gauss-Seidel Algorithm:
1. Given: A system of linear equations
2. Initialize: Choose an initial guess
3. Iterate: For each equation in the system:

Here, are the updated values from the current iteration, and are the
values from the previous iteration.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


 Gauss-Seidel Algorithm:
4. Check Convergence: As in the Gauss-Seidel Method, stop if the
change between iterations is below a certain tolerance.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


Example Problem:

Consider the system of linear equations:

3
2
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


We can apply the Gauss-Seidel Method as follows:

1. Rearrange equations to solve for each


Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


We can apply the Gauss-Seidel Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


We can apply the Gauss-Seidel Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method


We can apply the Gauss-Seidel Method as follows:
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.2 Gauss-Seidel Method

Continue until convergence: The Gauss-Seidel method


generally converges faster than the Jacobi method because it
uses the most recently updated values within the same iteration.

Gauss-Seidel Method: In each iteration, the updated value of


each variable is immediately used for the subsequent
calculations within the same iteration, leading to generally faster
convergence.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.3 Summary

• Jacobi Method updates each variable using the values from the
previous iteration.

• Gauss-Seidel Method updates variables sequentially, using the


most recent values during the same iteration, often leading to
faster convergence.

Both methods are widely used in numerical analysis for solving


large systems of linear equations, especially when direct methods
are not feasible.
Numerical Solutions to CE Problems – Solving System of Linear Equation

3.3.3 Summary

You might also like