numerical computation
DESCRIPTION
Numerical Computation. Lecture 7: Finding Inverses: Gauss-Jordan United International College. Review. During our Last Two Classes we covered: Linear Systems : LU Factorization (or Decomposition). Today. We will cover: Gauss-Jordan Method for finding Inverses. Review. - PowerPoint PPT PresentationTRANSCRIPT
Numerical Computation
Lecture 7: Finding Inverses: Gauss-Jordan
United International College
Review
• During our Last Two Classes we covered:– Linear Systems: LU Factorization (or
Decomposition)
Today
• We will cover:– Gauss-Jordan Method for finding Inverses
Review
Row Operations as Matrices
• Definition: An n×n matrix is called an elementary matrix if it can be obtained from the n×n identity matrix I by performing a single elementary row operation.
Row Operations as Matrices
• Row Operations: – Interchange two rows– Add r * times one row to another row – Multiply one row by a scalar
Row Operations as Matrices
• If the elementary row operation matrix E results from performing a certain row operation on the identity I, and if A is an m×n matrix ,then the product EA is the matrix that results when this same row operation is performed on A .
• That is, when a matrix A is multiplied on the left by an elementary matrix E ,the effect is to perform an elementary row operation on A .
Row Operations as Matrices
• Example: For the matrix
• Consider the elementary matrixThis matrix is obtained from I by adding 3*row 1 to row 3.
• Note that EA is the matrix that results from adding 3*row 1to row 3.
Gauss-Jordan Method
• To find the inverse to an nxn matrix A: – Adjoin the identity matrix I to the right side of A,
thereby producing a matrix of the form
– Apply row operations to this matrix until the left side is reduced to I. If successful, these operations will convert the right side to A-1 ,so that the final matrix will have the form
IA
1 AI
Gauss-Jordan Method
• Example:
801
352
321
A
Gauss-Jordan Method
• Example: Do row operations to get upper triangular form: (Like Gaussian Elimination)
Gauss-Jordan Method
• Example: Continue doing row operations to get 0’s in columns above the pivots:
Gauss-Jordan Method
• Example: At this point the last matrix on the left is the Identity. Thus, the right matrix must be the inverse to A:
Gauss-Jordan Method
• Example:
Matlab Implementation
• Task: Implement Gaussian Jordan method in a Matlab M-file.
• Notes• Input = Coefficient matrix A• Output = Inverse Matrix A-1
• Discussion: How can we modify our Gaussian Elimination code to do this?
Why does Gauss-Jordan Work?
• Recall: – Adjoin the identity matrix I to the right side of A,
thereby producing a matrix of the form
– Apply row operations to this matrix until the left side is reduced to I.
IA
1 AI
Why does Gauss-Jordan Work?
• Recall: – Every row operation applied to [A | I] can be
represented by an elementary matrix E. That is, the row operation is equivalent to E* [A | I].
– Thus, Gauss-Jordan can be viewed as a series of matrix operations
Ep Ep-1 … E1 [A | I] = [I | B] – But, this means that Ep Ep-1 … E1 A = I. – Then, Ep Ep-1 … E1 = A-1 . – Thus, the right side of [A | I] is transformed to B = Ep Ep-1 … E1 I = A-1