numerical computation

17
Numerical Computation Lecture 7: Finding Inverses: Gauss-Jordan United International College

Upload: orlando-lynch

Post on 01-Jan-2016

28 views

Category:

Documents


1 download

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 Presentation

TRANSCRIPT

Page 1: Numerical Computation

Numerical Computation

Lecture 7: Finding Inverses: Gauss-Jordan

United International College

Page 2: Numerical Computation

Review

• During our Last Two Classes we covered:– Linear Systems: LU Factorization (or

Decomposition)

Page 3: Numerical Computation

Today

• We will cover:– Gauss-Jordan Method for finding Inverses

Page 4: Numerical Computation

Review

Page 5: Numerical Computation

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.

Page 6: Numerical Computation

Row Operations as Matrices

• Row Operations: – Interchange two rows– Add r * times one row to another row – Multiply one row by a scalar

Page 7: Numerical Computation

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 .

Page 8: Numerical Computation

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.

Page 9: Numerical Computation

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

Page 10: Numerical Computation

Gauss-Jordan Method

• Example:

801

352

321

A

Page 11: Numerical Computation

Gauss-Jordan Method

• Example: Do row operations to get upper triangular form: (Like Gaussian Elimination)

Page 12: Numerical Computation

Gauss-Jordan Method

• Example: Continue doing row operations to get 0’s in columns above the pivots:

Page 13: Numerical Computation

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:

Page 14: Numerical Computation

Gauss-Jordan Method

• Example:

Page 15: Numerical Computation

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?

Page 16: Numerical Computation

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

Page 17: Numerical Computation

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