Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 11 Matrix Inverse and Condition. zHow do we get inverse [A]  1 ? zOne way is through LU decomposition and back- substitution zSolve [A]{x i }

Similar presentations


Presentation on theme: "Chapter 11 Matrix Inverse and Condition. zHow do we get inverse [A]  1 ? zOne way is through LU decomposition and back- substitution zSolve [A]{x i }"— Presentation transcript:

1 Chapter 11 Matrix Inverse and Condition

2 zHow do we get inverse [A]  1 ? zOne way is through LU decomposition and back- substitution zSolve [A]{x i } = {b i } with zPut together x’s to get [A] -1 ={x 1, x 2,x 3,x 4 } Matrix Inverse Sequentially!

3 z[A] [A]  1 = [ I ] zUse LU factorization to find [X] = [A]  1 zLU decomposition: [A] = [L][U] zForward substitution: [L][Y] = [ I ] zBack substitution: [U][X] = [Y]

4 Matrix Inverse zForward Substitution [L][Y] = [ I ]

5 Matrix Inverse zback Substitution [U][X] = [ Y ]

6 function x = LU_Solve_Gen(L, U, B) % Function to solve the equation L U x = B % L --> Lower triangular matrix (1's on diagonal) % U --> Upper triangular matrix % B --> Right-hand-side matrix [n n2] = size(L); [m1 m] = size(B); % Solve L d = B using forward substitution for j = 1 : m d(1,j) = B(1,j); for i = 2 : n d(i,j) = B(i,j) - L(i, 1:i-1) * d(1:i-1,j); end % SOlve U x = d using back substitution for j = 1 : m x(n,j) = d(n,j) / U(n,n); for i = n-1 : -1 : 1 x(i,j) = (d(i,j) - U(i,i+1:n) * x(i+1:n,j)) / U(i,i); end

7 » B=eye(3) B = 1 0 0 0 1 0 0 0 1 » x=LU_solve_gen(L,U,B) x = 11.0000 -10.0000 3.0000 9.0000 -8.0000 2.5000 -5.0000 5.0000 -1.1667 » inv(A) ans = 11.0000 -10.0000 3.0000 9.0000 -8.0000 2.5000 -5.0000 5.0000 -1.1667 » A=[-19 20 -6;-12 13 -3;30 -30 12] A = -19 20 -6 -12 13 -3 30 -30 12 » [L,U]=LU_factor(A); L = 1.0000 0 0 0.6316 1.0000 0 -1.5789 4.2857 1.0000 U = -19.0000 20.0000 -6.0000 0 0.3684 0.7895 0 0.0000 -0.8571 Example: Matrix Inverse MATLAB function

8 Error Analysis and System Condition zThe matrix inverse provides a means to discern whether a system is ill-conditioned 1.Normalize rows of matrix [A] to 1. If the elements of [A]  1 are >> 1, the matrix is likely ill-conditioned 2.If [A]  1 [A] is not close to [ I ], the matrix is probably ill-conditioned 3.If ([A]  1 )  1 is not close to [A], the matrix is ill- conditioned

9 Vector and Matrix Norms  Norm: provide a measure of the size or “length” of multi- component mathematical entities such as vectors and matrices Euclidean norm of a vector (3D space)

10 Matrix Norm zFor n  n matrix, the Frobenius norm zFrobenius norm provides a single value to quantify the size of matrix [A] zOther alternatives – p norms for vectors p = 2 : Euclidean norm

11 Vector and Matrix Norms zVector norms ( p-norms) zMatrix norms Column-sum norm Row-sum norm Sum of absolute values Maximum-magnitude or uniform-vector norm

12  Condition number defined in terms of matrix norms  Cond[A] is great than or equal to 1  Matrix A is ill-conditioned if Cond[A] >> 1  If [A] has 10  7 rounding error and Cond[A] = 10 5, then the solution [X] may be valid to only 10  2 Matrix Condition Number Relative error of the norm

13 Matrix Condition Evaluation zHilbert matrix – notoriously ill-conditioned zRow-sum norm (last row has the largest sum) Normalization

14 Matrix Condition Evaluation z5  5 Hilbert matrix zCondition number

15 MATLAB Norms and Condition Numbers >> A=[1 1/2 1/3 1/4 1/5; 1 2/3 2/4 2/5 2/6; 1 3/4 3/5 3/6 3/7; 1 4/5 4/6 4/7 4/8; 1 5/6 5/7 5/8 5/9]; >> Ainv = inv(A) Ainv = 25 -150 350 -350 126 -300 2400 -6300 6720 -2520 1050 -9450 26460 -29400 11340 -1400 13440 -39200 44800 -17640 630 -6300 18900 -22050 8820 >> norm(A,inf) ans = 3.7282 >> norm(Ainv,inf) ans = 1.1648e+005 >> cond(A,inf) ans = 4.3426e+005 >> cond(A,'fro') ans = 2.7944e+005 >> cond(A) ans = 2.7746e+005 >> norm(X,p) >> cond(X,p) >> Cond(A,’fro’) >> cond(A) p-norm Frobenius norm Spectral norm

16 CVEN 302-501 Homework No. 7 zChapter 10 zProb. 10.4(20), 10.5(20) both using LU decomposition (hand calculation only, hand partial pivoting if necessary), Prob. 10.8 a)&b) (20). zChapter 11 zProb. 11.2 (15), 11.3 a) & b) (20) (Hand Calculations) zProb. 11.6 (25) (Hand Calculations; Check your solutions using MATLAB) zDue Monday 10/13/08 at the beginning of the period


Download ppt "Chapter 11 Matrix Inverse and Condition. zHow do we get inverse [A]  1 ? zOne way is through LU decomposition and back- substitution zSolve [A]{x i }"

Similar presentations


Ads by Google