![]()
![]()
Lab for Matrix Inversion
![]()
Gauss-Jordan Method for Matrix
Inversion. Construct the inverse for the matrix
A, by using Gaussian elimination. Let the coefficients of
A and the identity matrix I be stored in the augmented
matrix [A, I] = (
)
which has n rows and 2n columns. The system can be written
![[Graphics:mi.txtgr2.gif]](mi.txtgr2.gif)
![[Graphics:mi.txtgr3.gif]](mi.txtgr3.gif)
Row operations will be used to eliminate
in column p. This is equivalent to solving the n linear systems
where
is the i-th base vector.
Remark. In the following subroutine the notation i=!=p means
"i not equal to j".
Report to be handed in.
Computer Exercises
Exercise 1. Find the inverse of the matrix
First, form the augmented matrix [A, I] and store it in the variable AI.
Second, construct the inverse matrix using Gauss-Jordan
elimination.
Remark. All the computations are printed too !
Extract the inverse matrix B. from the augmented matrix M = [I,B].
Verify that B is the inverse of A.
Exercise 2. Find the inverse of the 5x5 Hilbert matrix
First, form the augmented matrix [A, I] and store it in the variable AI.
Second, construct the inverse matrix using Gauss-Jordan
elimination.
Remark. All the computations are printed too !
Extract the inverse matrix B. from the augmented matrix M = [I,B].
Verify that B is the inverse of A.
Exercise 3. Hilbert matrices
are known to be ill-conditioned. Find the inverse of the 5x5 matrix
that approximates the 5x5 Hilbert matrix.
Remark. The entries in the matrix for this exercise must be typed in
by hand in order to make sure that only six decimal places are stored
in the computer.
First, form the augmented matrix [A, I] and store it in the variable AI.
Second, construct the inverse matrix using Gauss-Jordan
elimination.
Remark. All the computations are printed too !
Extract the inverse matrix B. from the augmented matrix M = [I,B].
Verify that B is the inverse of A.
Everything might appear to be working nicely, but compare the inverse of the Hilbert matrix using exact arithmetic with the inverse of the chopped Hilbert matrix
Observe the difference between the computed inverse matrices when the Hilbert matrix is chopped.
What is your conclusion regarding the propagation of error ?
![]()
![]()
(c) John H. Mathews, 1998