Chapter 12 Gaussian Elimination (II) Speaker: Lung-Sheng Chien Reference book: David Kincaid, Numerical Analysis Reference lecture note: Wen-wei Lin, chapter 2, matrix computation
OutLine Weakness of A=LU - erroneous judgment: A is invertible but A=LU does not exist - unstable, A is far from LU A=LU versus PA=LU Pivoting strategy Implementation of PA=LU MATLAB usage
Fail of LU: singular of leading principal minor Question: How about interchanging row 1 and row 2? and
unstable of LU: near singular of leading principal minor [1] ? Theoretical: Numerical: ifthen Problem: for double-precision, we only have 16 digit-accuracy, we cannot accept, why?
backward substitution step 1: step 2: Question: why not due to rounding error unstable of LU: near singular of leading principal minor [2]
Case 1:Case 2: unstable of LU: near singular of leading principal minor [3] wrong solution
Question: How about interchanging row 1 and row 2? LU-factorization backward substitution step 1: step 2: unstable of LU: near singular of leading principal minor [4] Key observation: without pivoting (rounding normal number) pivoting (rounding error does not occur for normal number)
Case 1:Case 2: unstable of LU: near singular of leading principal minor [5] Why not 1?
without pivotingpivoting (NOT stable) (stable) Objective: control growth rate of control multiplier unstable of LU: cause and controllability definelargest component of matrix
OutLine Weakness of A=LU A=LU versus PA=LU - controllability of lower triangle matrix L Pivoting strategy Implementation of PA=LU MATLAB usage
since is not maximum among since is not maximum among Recall LU example in chapter 11 [1]
Recall LU example in chapter 11 [2] since is not maximum among Question: How can we control, is uniform bound possible?
PA = LU in MATLAB
sinceis maximum among PA = LU: assume P is given [1] /11-10/ /111 since is maximum among
PA = LU: assume P is given [2] / /11-10/ /111 since is maximum among /111/ /11 Observation: though proper permutation, we can control Question: in fact, we cannot know permutation matrix in advance, how can we do?
Sequence of matrices during LU-decomposition
OutLine Weakness of A=LU A=LU versus PA=LU Pivoting strategy - partial pivoting (we adopt this formulation) - complete pivoting Implementation of PA=LU MATLAB usage
(1) find a such that (2) swap rowand row Partial pivoting and complete pivoting thenwith Partial pivoting (1) find a such that (2) swap rowand row thenwith (2) swap columnand column complete pivoting
Define permutation matrix Recall permutation matrix interchange row 2, 3 interchange column 2, 3 Let interchange row 2, interchange column 2, Symmetric permutation:
x1 x2 x Meaning of matrix coefficient relationship between node and node constraint on node node is named x1 x3x3 x2x change node 2 to node 3 and node 3 to node 2 write constraint for now node index x1 x2x2 x3x3 x2x2x3x x2x3 x1 x2 x3
Identity matrix is invariant under symmetric permutation x1 x2 x x1 x2 x3 x2x3 change node 2 to node 3 and node 3 to node 2 x1 x3x3 x2x x2x2 x3x3 x2x2x3x3 1
PA = LU: partial pivoting [1]
PA = LU: partial pivoting [2] where Interchange columns 2, Interchange rows 2, verify
PA = LU: partial pivoting [3] / /11-10/ /11-10/ /11-10/11 where
/ Interchange columns 3, / Interchange rows /111 PA = LU: partial pivoting [4] / /11-10/11 verify
PA = LU: partial pivoting [5] /11-10/ / /11 where /111/ /11 we have
OutLine Weakness of A=LU A=LU versus PA=LU Pivoting strategy Implementation of PA=LU - commutability of GE matrix and permutation - recursive formula MATLAB usage
Interchange rows and columns 2, / Interchange rows and columns 3, /111 Implementation issue: commutability of GE matrix and permutation [1]
Implementation issue: commutability of GE matrix and permutation [2] Observation: If we define, then where interchanges rows or columns and interchange
Implementation issue: commutability of GE matrix and permutation [3] partial rows (k and p) interchange symmetric permutation on an Identity matrix
we have compute update original matrix stores in lower triangle matrix Algorithm ( PA = LU ) [1] Given full matrix, construct initial lower triangle matrix for use permutation vector to record permutation matrix let,and
Algorithm ( PA = LU ) [2] define permutation matrix then after swapping rows, we have compute by swappingand then for ifthen endif swap rowand row find a such that
Algorithm ( PA = LU ) [3] endfor by updating by updating matrix then decomposewhere 5 (recursion is done)
Question: recursion implementation Initialization - check algorithm holds for k=1 Recursion formula - check algorithm holds for k, if k-1 is true Termination condition - check algorithm holds for k=n Breakdown of algorithm - check which condition PA=LU fails Exception: algorithm works only for square matrix? normal abnormal Extension of algorithm
Exception: algorithm works only for square matrix? [1] Case 1: Case 2:
Case 3: Exception: algorithm works only for square matrix? [2] we can simplify it as Question: what is termination condition of case 3 ?
OutLine Weakness of A=LU A=LU versus PA=LU Pivoting strategy Implementation of PA=LU MATLAB usage - abs - max
Command “abs”: take absolute value In PA=LU algorithm, we need to take absolute value of one column vector for pivoting abs also works for matrix
Command “max”: take maximum value