Simultaneous Linear Equations and Matrix Algebra

Simultaneous Linear Equations and
Matrix Algebra
Major: All Engineering Majors
Author(s): Autar Kaw
Transforming Numerical Methods Education for STEM
Undergraduates
http://nm.MathForCollege.com
Inverse of a Matrix
Find Inverse of Matrix
 
 
 
 
 
 
 
 
Setting up equations to find inverse
 
 
 
 
 
 
 
 
 
 
 
Putting the solutions in matrix
 
 
 
 
 
 
 
 
 
 
 
 
 
THE END
Naïve Gauss Elimination Steps
Naïve Gaussian Elimination
A method to solve simultaneous linear
equations of the form [A][X]=[C]
Two steps
1. Forward Elimination
2. Back Substitutio
n
Forward Elimination
The goal of forward elimination is to transform the
coefficient matrix into an upper triangular matrix
 
Back Substitution
Solve each equation starting from the last equation
 
 
 
THE END
     
Determinant of a Square Matrix
Determinant of a Square Matrix
Using Naïve Gauss Elimination
Using Naïve Gauss Elimination
Theorem of Determinants
If a multiple of one row of [A]
n
x
n 
is added or
subtracted to another row of [A]
n
x
n
 to result in [B]
n
x
n
then det(A)=det(B)
Theorem of Determinants
The determinant of an upper triangular, lower
triangular or diagonal matrix [A]
n
x
n 
is given by
Forward Elimination of a Square
Matrix
Using forward elimination to transform [A]
n
x
n 
to an
upper triangular matrix, [U]
n
x
n
.
 
 
Using Naive Gaussian Elimination method, find
the determinant of the following square matrix.
Finding the Determinant
 
 
.
 
 
 
 
 
After forward elimination steps
What does det(A)=0 and det(A)≠0 mean
for [A][X]=[C]
 
 
THE END
Naïve Gauss Elimination Pitfalls
Pitfall#1. Division by zero
Is division by zero an issue here?
Is division by zero an issue here?
Is division by zero an issue here? YES
Is division by zero an issue here? YES
Division by zero is a possibility at any step
of forward elimination
Pitfall#2. Large Round-off Errors
Exact Solution
Pitfall#2. Large Round-off Errors
Solve it on a computer using 
6
 significant digits with chopping
Pitfall#2. Large Round-off Errors
Solve it on a computer using 
5
 significant digits with chopping
Is there a way to reduce the round off error?
Avoiding Pitfalls
Increase the number of significant digits
  Decreases round-off error
  Does not avoid division by zero
Avoiding Pitfalls
Use Gaussian Elimination with Partial
Pivoting
Avoids division by zero
Reduces round off error
 
THE END
Gauss Elimination with Partial
Pivoting
What is Different About Partial
What is Different About Partial
Pivoting
Pivoting
?
?
 
Example (2
nd
 step of FE)
Which two rows would you switch?
Example (2
nd
 step of FE)
Gaussian Elimination with Partial Pivoting
A method to solve simultaneous linear
equations of the form [A][X]=[C]
Two steps
1. 
Forward Elimination
2. Back Substitution
 
THE END
Gauss Elimination with Partial
Pivoting Example
 
 
 
Solve the following set of equations
by Gaussian elimination with partial
pivoting
Forward Elimination
Number of Steps of Forward
Elimination
Number of steps of forward elimination is
(
n
1
)=(3
1)=2
Forward Elimination: Step 1
Examine absolute values of first column, first row
 
and below.
  Largest absolute value is 144 and exists in row 3.
  Switch row 1 and row 3.
Forward Elimination: Step 1 (cont.)
 
 
.
 
 
Divide Equation 1 by 144 and
multiply it by 64,                   .
Subtract the result from
Equation 2
Substitute new equation for
Equation 2
Forward Elimination: Step 1 (cont.)
 
 
.
 
 
 
 
Divide Equation 1 by 144 and
multiply it by 25,                  .
Subtract the result from
Equation 3
Substitute new equation for
Equation 3
Forward Elimination: Step 2
Examine absolute values of second column, second row
 
and below.
  Largest absolute value is 2.917 and exists in row 3.
  Switch row 2 and row 3.
Forward Elimination: Step 2 (cont.)
 
 
.
 
 
 
 
 
Divide Equation 2 by 2.917 and
multiply it by 2.667,
Subtract the result from
Equation 3
Substitute new equation for
Equation 3
Back Substitution
Back Substitution
 
 
 
 
Solving for 
a
3
Back Substitution (cont.)
 
 
 
 
Solving for 
a
2
 
 
 
Back Substitution (cont.)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Gaussian Elimination with Partial Pivoting
Solution
 
 
 
Slide Note
Embed
Share

Delve into the intricacies of solving simultaneous linear equations using matrix algebra. Explore the concept of finding the inverse of a matrix and understand the steps involved in setting up equations to find the inverse. Learn about forward elimination and back substitution in Gaussian elimination to solve linear equations efficiently.

  • Mathematics
  • Linear Algebra
  • Matrix Operations
  • Engineering Education
  • Numerical Methods

Uploaded on Feb 23, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Simultaneous Linear Equations and Matrix Algebra Major: All Engineering Majors Author(s): Autar Kaw http://nm.MathForCollege.com Transforming Numerical Methods Education for STEM Undergraduates

  2. Inverse of a Matrix

  3. Find Inverse of Matrix Find inverse of 25 64 144 ?11 ?21 ?31 ?12 ?22 ?32 ?13 ?23 ?33 5 8 1 1 1 ? 1= 12 ?11 ?21 ?31 ?12 ?22 ?32 ?13 ?23 ?33 1 0 0 0 1 0 0 0 1 25 64 144 5 8 1 1 1 = 12

  4. Setting up equations to find inverse ?11 ?21 ?31 ?11 ?21 ?31 1 0 0 25 64 144 5 8 1 1 1 0.04762 0.9524 4.571 = = 12 ?12 ?22 ?32 0 1 0 25 64 144 5 8 1 1 1 ?12 ?22 ?32 0.08333 1.417 5.000 = = 12 ?13 ?23 ?33 ?13 ?23 ?33 0.03571 0.4643 1.429 0 0 1 25 64 144 5 8 1 1 1 = = 12

  5. Putting the solutions in matrix ?11 ?21 ?31 0.04762 0.9524 4.571 ?12 ?22 ?32 0.08333 1.417 5.000 ?13 ?23 ?33 0.03571 0.4643 1.429 = = = 0.04762 0.9524 4.571 0.08333 1.417 5.000 0.03571 0.4643 1.429 [?] 1= 1 0 0 0 1 0 0 0 1 0.04762 0.9524 4.571 0.08333 1.417 5.000 0.03571 0.4643 1.429 25 64 144 5 8 1 1 1 = 12

  6. THE END

  7. Nave Gauss Elimination Steps

  8. Nave Gaussian Elimination A method to solve simultaneous linear equations of the form [A][X]=[C] Two steps 1. Forward Elimination 2. Back Substitution

  9. Forward Elimination The goal of forward elimination is to transform the coefficient matrix into an upper triangular matrix ?1 ?2 ?3 106.8 177.2 279.2 25 64 144 5 8 12 1 1 1 = ?1 ?2 ?3 106.8 96.21 0.735 25 0 0 5 1 = 4.8 0 1.56 0.7

  10. Back Substitution Solve each equation starting from the last equation ?1 ?2 ?3 106.8 96.21 0.735 25 0 0 5 1 = 4.8 0 1.56 0.7

  11. THE END

  12. Determinant of a Square Matrix Using Na ve Gauss Elimination

  13. Theorem of Determinants If a multiple of one row of [A]nxn is added or subtracted to another row of [A]nxn to result in [B]nxn then det(A)=det(B)

  14. Theorem of Determinants The determinant of an upper triangular, lower triangular or diagonal matrix [A]nxn is given by det A = ?11 ?22 ... ??? ... ??? ? = ??? ?=1

  15. Forward Elimination of a Square Matrix Using forward elimination to transform [A]nxn to an upper triangular matrix, [U]nxn. ?? ? ?? ? det ? = det ?

  16. Using Naive Gaussian Elimination method, find the determinant of the following square matrix. 25 64 144 5 8 1 1 1 12

  17. Finding the Determinant After forward elimination steps 25 64 144 5 8 12 1 1 1 25 0 0 5 1 4.8 0 1.56 0.7 . det A = ?11 ?22 ?33 = 25 4.8 0.7 = 84.00

  18. What does det(A)=0 and det(A)0 mean for [A][X]=[C] det ? = 0 implies [A][X]=[C] has no solution or infinite solutions det ? 0 implies [A][X]=[C] has a unique solution.

  19. THE END

  20. Nave Gauss Elimination Pitfalls

  21. Pitfall#1. Division by zero 10?2 7?3= 3 6?1+ 2?2+ 3?3= 11 5?1 ?2+ 5?3= 9 ?1 ?2 ?3 0 6 5 10 2 1 7 3 5 3 11 9 =

  22. Is division by zero an issue here? 12?1+ 10?2 7?3= 15 6?1+ 5?2+ 3?3= 14 5?1 ?2+ 5?3= 9 ?1 ?2 ?3 12 6 5 10 5 1 7 3 5 15 14 9 =

  23. Is division by zero an issue here? YES ?1 ?2 ?3 12?1+ 10?2 7?3= 15 6?1+ 5?2+ 3?3= 14 24?1 ?2+ 5?3= 28 12 6 24 10 5 1 7 3 5 15 14 28 = ?1 ?2 ?3 12 0 0 10 0 21 7 6.5 19 15 6.5 2 = Division by zero is a possibility at any step of forward elimination

  24. Pitfall#2. Large Round-off Errors ?1 ?2 ?3 20 3 5 15 10 7 3 45 = 2.249 1 1.751 9 Exact Solution ?1 ?2 ?3 1 1 1 =

  25. Pitfall#2. Large Round-off Errors ?1 ?2 ?3 20 3 5 15 10 7 3 45 = 2.249 1 1.751 9 Solve it on a computer using 6 significant digits with chopping ?1 ?2 ?3 0.9625 1.05 0.999995 =

  26. Pitfall#2. Large Round-off Errors ?1 ?2 ?3 20 3 5 15 10 7 3 45 = 2.249 1 1.751 9 Solve it on a computer using 5 significant digits with chopping ?1 ?2 ?3 0.99995 0.625 1.5 = Is there a way to reduce the round off error?

  27. Avoiding Pitfalls Increase the number of significant digits Decreases round-off error Does not avoid division by zero

  28. Avoiding Pitfalls Use Gaussian Elimination with Partial Pivoting Avoids division by zero Reduces round off error

  29. THE END

  30. Gauss Elimination with Partial Pivoting

  31. What is Different About Partial Pivoting? At the beginning of the k th step of forward elimination, find the maximum of ???, ??+1,?,................, ??? If the maximum of these values is ??? in the ?th row, ? ? ?, then switch rows ? and ?.

  32. Example (2nd step of FE) ?1 ?2 ?3 ?4 ?5 6 0 0 0 0 14 7 4 9 17 5.1 6 12 23 12 3.7 1 1 6 11 6 2 5 6 8 9 3 = 11 8 43 Which two rows would you switch?

  33. Example (2nd step of FE) ?1 ?2 ?3 ?4 ?5 ?1 ?2 ?3 ?4 ?5 6 0 0 0 0 14 7 4 9 17 5.1 6 12 23 12 3.7 1 1 6 11 6 2 5 6 0 0 0 0 19 17 4 9 7 5.1 12 12 23 6 3.7 11 1 6 1 6 5 3 8 9 6 8 9 3 43 11 8 2 = = 11 8 43 6

  34. Gaussian Elimination with Partial Pivoting A method to solve simultaneous linear equations of the form [A][X]=[C] Two steps 1. Forward Elimination 2. Back Substitution

  35. THE END

  36. Gauss Elimination with Partial Pivoting Example

  37. Solve the following set of equations by Gaussian elimination with partial pivoting ?1 ?2 ?3 106.8 177.2 279.2 25 64 144 5 8 1 1 1 = 12 25 64 144 5 8 1 1 1 106.8 177.2 279.2 12

  38. Forward Elimination

  39. Number of Steps of Forward Elimination Number of steps of forward elimination is (n 1)=(3 1)=2

  40. Forward Elimination: Step 1 Examine absolute values of first column, first row and below. 25 , 64 , 144 Largest absolute value is 144 and exists in row 3. Switch row 1 and row 3. 144 64 25 12 8 5 1 1 1 279.2 177.2 106.8 25 64 144 5 8 1 1 1 106.8 177.2 279.2 12

  41. Forward Elimination: Step 1 (cont.) Divide Equation 1 by 144 and 144 64 25 12 8 5 1 1 1 279.2 177.2 106.8 64 144= 0.4444 multiply it by 64, . 279.2 0.4444 = 63.99 144 12 1 5.333 0.4444 124.1 . 64 8 1 177.2 124.1 53.10 Subtract the result from Equation 2 63.99 0 5.333 2.667 0.4444 0.5556 Substitute new equation for Equation 2 144 0 25 12 1 279.2 53.10 106.8 2.667 5 0.5556 1

  42. Forward Elimination: Step 1 (cont.) Divide Equation 1 by 144 and 144 0 25 12 1 279.2 53.10 106.8 2.667 5 0.5556 1 25 144= 0.1736 multiply it by 25, . 279.2 0.1736 = 25.00 144 12 1 2.083 0.1736 48.47 . 25 2.083 2.917 5 1 106.8 48.47 58.33 Subtract the result from Equation 3 25 0 0.1736 0.8264 144 0 0 12 1 279.2 53.10 58.33 Substitute new equation for Equation 3 2.667 2.917 0.5556 0.8264

  43. Forward Elimination: Step 2 Examine absolute values of second column, second row and below. 2.667 , 2.917 Largest absolute value is 2.917 and exists in row 3. Switch row 2 and row 3. 144 0 0 12 1 279.2 53.10 58.33 144 0 0 12 1 279.2 58.33 53.10 2.667 2.917 0.5556 0.8264 2.917 2.667 0.8264 0.5556

  44. Forward Elimination: Step 2 (cont.) Divide Equation 2 by 2.917 and multiply it by 2.667, 2.667 2.917= 0.9143. 144 0 0 12 1 279.2 58.33 53.10 2.917 2.667 0.8264 0.5556 58.33 0.9143 = 0 0 2.917 0.8264 2.667 0.7556 53.33 0 2.667 2.667 0.5556 0.7556 0.2 53.10 53.33 0.23 . 0 0 Subtract the result from Equation 3 0 144 0 0 12 1 279.2 58.33 0.23 Substitute new equation for Equation 3 2.917 0 0.8264 0.2

  45. Back Substitution

  46. Back Substitution ?1 ?2 ?3 144 0 0 12 1 279.2 58.33 0.23 144 0 0 12 1 279.2 58.33 0.23 = 2.917 0 0.8264 0.2 2.917 0 0.8264 0.2 Solving for a3 0.2?3= 0.23 ?3= 0.23 0.2 = 1.15

  47. Back Substitution (cont.) ?1 ?2 ?3 144 0 0 12 1 279.2 58.33 0.23 = 2.917 0 0.8264 0.2 Solving for a2 2.917?2+ 0.8264?3= 58.33 ?2=58.33 0.8264?3 2.917 =58.33 0.8264 1.15 2.917 = 19.67

  48. Back Substitution (cont.) ?1 ?2 ?3 144 0 0 12 1 279.2 58.33 0.23 = 2.917 0 0.8264 0.2 144?1+ 12?2+ ?3= 279.2 ?1=279.2 12?2 ?3 =279.2 12 19.67 1.15 144 144 = 0.2917

  49. Gaussian Elimination with Partial Pivoting Solution ?1 ?2 ?3 106.8 177.2 279.2 25 64 144 5 8 1 1 1 = 12 ?1 ?2 ?3 0.2917 19.67 1.15 =

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#