SOLUTION OF SIMULTANEOUS LINEAR EQUATIONS LU Decompositio Method Jamie Traha, Autar Kaw, Kevi Marti Uiversity of South Florida Uited States of America kaw@eg.usf.edu http://umericalmethods.eg.usf.edu Itroductio Whe solvig multiple sets of simultaeous liear equatios with the same coefficie matrix but differet right had sides, LU Decompositio is advatageous over other umerical methods i that it proves to be umerically more efficiet i computatioa tha other techiques. I this worksheet, the reader ca choose a system of equatios ad see how each step of LU decompositio method is coducted. To lear more abo LU Decompositio method as well as the efficiecy of its computatioal time click h LU Decompositio method is used to solve a set of simultaeous liear equatios, [A [X] = [C], where [A] x is a o-sigular square coefficiet matrix, [X] x is the solutio vector, ad [C] x is the right had side array. Whe coductig LU decompositio method, oe must first decompose the coefficet matrix [A] x ito a lower triagular matrix [L] x, ad upper triagular matrix [U] x. These two matrice the be used to solve the solutio vector [X] x i the followig sequece: Recall that [A] [X] = [C]. Kowig that [A] = [L] [U] the first solvig with ward substitutio [L] [Z] = [C] ad the solvig with back substitutio [U] [X] = [Z] gives the solutio vector [X]. A simulatio of LU Decompositio method follows.
Sectio : Iput Below are the iput parameters to begi the simulatio. This is the oly sectio that requires user iput. The user ca chage the values that are highlighted ad Mathcad calculate the solutio vector [X]. ORIGIN := Number of equatios := 4 [A] x coefficiet matrix A :=. 4.. 9 8. [RHS] x right had side array RHS := 9..
Sectio : LU Decompositio Method This sectio divides LU Decompositio ito steps: ) Decompositio of coefficiet matrix [A] x ) Forward Substitutio ) Back Substitutio Step : Fidig [L] ad [U] How does oe decompose a o-sigular matrix [A], that is how do you fid [L] ad [U]? The followig procedure decomposes the coefficiet matrix [A] ito a lower triagular matrix [L] ad upper triagular matrix [U], give [A] = [L] [U]. For [U], the elemets of the matrix are exactly the same as the coefficiet matrix oe obtais at the ed of ward elimiatio steps i Naive Gauss Elimiatio. For [L], the matrix has i its diagoal etries. The o zero elemets o the o-diagoal elemets are multipliers that made the correspodig etries zero i the upper triagular matrix durig ward elimiatio. LU decompositio procedure: Variable ames: = umber of equatios U = x upper triagular matrix L = x lower triagular matrix ludecompose := U A i.. L ii, k.. i k +.. U L multiplier U ik, U kk, L multiplier ik, j.. U U multiplier U i, j i, j k, j Assigig coefficiet matrix [A] to local matrix [U] Iitializig diagoal of [L] to be uity Coductig (-) steps of Naive Gauss ward elimiatio. Defiig row elemets Computig multiplier values Puttig multiplier i proper row ad colum of [L] matrix. Geeratig rows of [U] matrix. Returig [U] ad [L]
Extractig [U] matrix from LU decompositio procedure: U := ludecompose The upper triagular matrix [U] is U = 4.4... 8.44. 44. Extractig [L] matrix from LU decompositio procedure: L := ludecompose The lower triagular matrix [L] is L =.8.8.4. 4.8 Notice that matrix [L] has oly oe ukow to be solved i its first row, ad matrix [U] has oly oe ukow to be solved i its last row. This will prove useful i solv the solutio vector [X] i the followig steps of LU decompositio method.
Step : Forward Substitutio Now that the [L] matrix has bee med, ward substitutio step [L] [Z] = [C] ca be coducted, begiig with the first equatio as it has oly oe ukow, c z := Equatio (.) l, Subsequet steps of ward substitutio ca be represeted by the followig mula: i c l z i ( i, j j ) j = i=.. z := Equatio (.) i l ii, The followig procedure coducts ward substitutio steps to solve [Z]. Variable ames: = umber of equatios RHS = x right had side array L = x lower triagular matrix RHS ward_substitutio := Z L, Z i.. sum j.. i sum sum + L Z i, j j RHS sum i Z i L ii, Solvig the first equatio as it has oly oe ukow. Defiig remaiig (-) rows whose ukows eed to be solved. Iitializig series sum to equal zero. Calculatig summatio term i Eq.(.) Usig Eq. (.) to solve itermediate solutio vector [Z]. Returig [Z] The [Z] solutio vector is ow Z := ward_substitutio Z =...99
Step : Back Substitutio Now that [Z] has bee foud, it ca be used i the back substitutio step, [U] [X] = [Z], to solve solutio vector [X] x, where [U] x is the upper triagular matrix calculated i Step, ad [Z] x is the right had side array. Back substitutio begis with solvig the th equatio as it has oly oe ukow. z x := Equatio (.) u, The remaiig ukows are solved workig backwards from the (-) th equatio to the first equatio usig the followig mula: z u x i ( i, j j ) j = i+ i= ( ).. x := Equatio (.4) i u ii, The followig procedure solves [X]. Variable ames = umber of equatios Z = x right had side array U = x upper triagular matrix Z back_substitutio := X U, i.. X sum j i +.. sum sum + U X i, j j Z sum i X i U ii, Solvig th equatio as it has oly oe ukow. Defiig remaiig (-) rows whose ukows eed to be solved. Iitializig series sum to zero. Calculatig summatio term from Eq. (.4). Usig Eq. (.4) to calculate solutio vector [X]. Returig solutio vector [X].
The solutio vector [X] is X := back_substitutio X =...844.4 Refereces Autar Kaw, Holistic Numerical Methods Istitute, http://umericalmethods.eg.usf.edu/mws, See Itroductio to Systems of Equatios. How does LU Decompositio method work? Savig of computatioal time fidig iverse of a matrix usig LU decompositio. Coclusio Mathcad helped us apply our kowledge of LU Decompositio method to solve a syst of simultaeous liear equatios. Questio : Solve the followig set of simultaeous liear equatios usig LU decompositio method 9..... x x x x 4 = 4. 8 Questio : Use LU decompositio repeatedly to fid the iverse of 9..... Questio : Look at the [Z] matrix i [L] [Z] = [C] step i LU decompositio method of Questio. Is it the same as the [RHS] matrix at the ed of ward elimiatio steps i Naive Gauss Elimiatio method? If yes, is this a coicidece?