Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss

Published  . 0 views
↓ Download
Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss
1 / 1
Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 1 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 2 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 3 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 4 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 5 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 6 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 7 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 8 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 9 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 10 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 11 of 12 Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss - slide 12 of 12
Description: Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss and Jordan) Purpose Invert a matrix Find the specific solution to a system of equations Elementary Row Operations Swap two rows Multiply an entire row by a (non-zero) scalar Add a multiple

Related Topics

Download Presentation

"Gauss-Jordan Elimination Ben Rorabaugh (ft. Gauss" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

slide1. Gauss-Jordan Elimination Ben Rorabaugh
(ft. Gauss and Jordan)<br>
slide2. Purpose Invert a matrix

Find the specific solution to a system of equations<br>
slide3. Elementary Row Operations Swap two rows

Multiply an entire row by a (non-zero) scalar

Add a multiple of a row to another row<br>
slide4. Pivoting Pivoting refers to choosing one row with a more easily workable number and swapping it so that the workable number is on the diagonal.<br>
slide5. Gauss-Jordan Elimination in the C++ Library<br>
slide6. Pivoting in the C++ Library The gaussj() function finds a pivot by finding the greatest element in the desired row.<br>
slide7. Pivoting in the C++ Library (continued) The function then swaps the chosen pivot row so that the pivot element is on the diagonal.<br>
slide8. Computing the Solution The function then divides all other rows by the pivot element.<br>
slide9. Computing the Solution (continued) The function then subtracts the pivot row from all other rows.

This entire process is repeated for all rows in the input matrix.<br>
slide10. Example g++ main.cpp -o main
./main in3.txt Input:
2w + 3x + 1y - 2z = -4
0w - 2x + 3y - 5z = 3
2w + 5x - 1y - 1z = -5
3w + 2x + 0y + 4z = 6

Expected Solution:
w = -2
x = 0
y = 6
z = 3<br>
slide11. Changes I made to the textbook's code The textbook's code will always calculate the inverse of matrix A, with the specific solution in column B, if applicable.
With the addition of a boolean parameter and some conditions using the parameter, we can have the program eliminate columns as expected<br>
slide12. The elimination algorithm for an n x n matrix Loop n times:
Find the largest (abs. value) element in the matrix (that hasn't already been pivoted with); this is the pivot element
If the pivot element is not on the diagonal, swap rows so that it is
Normalize the row of the pivot element
Loop through all non-pivot rows:
Subtract the pivot row times the coefficient of the row's element in the pivot column<br>