Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ax = b Methods for Solution of the System of Equations (ReCap):

Similar presentations


Presentation on theme: "Ax = b Methods for Solution of the System of Equations (ReCap):"โ€” Presentation transcript:

1 Ax = b Methods for Solution of the System of Equations (ReCap):
Direct Methods: one obtains the exact solution (ignoring the round-off errors) in a finite number of steps. These group of methods are more efficient for dense and banded matrices. Gauss Elimination; Gauss-Jordon Elimination LU-Decomposition Thomas Algorithm (for tri-diagonal banded matrix) Iterative Methods: solution is obtained through successive approximation. Number of computations is a function of desired accuracy/precision of the solution and are not known apriori. More efficient for sparse matrices. Jacobi Iterations Gauss Seidal Iterations with Successive Over/Under Relaxation

2 Gauss Elimination for the matrix equation Ax = b:
๐‘Ž 11 ๐‘Ž 12 โ€ฆ ๐‘Ž 1๐‘— โ€ฆ ๐‘Ž 1๐‘› ๐‘Ž 21 ๐‘Ž 22 โ€ฆ ๐‘Ž 2๐‘— โ€ฆ ๐‘Ž 2๐‘› โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ ๐‘Ž ๐‘–1 ๐‘Ž ๐‘–2 โ€ฆ ๐‘Ž ๐‘–๐‘— โ€ฆ ๐‘Ž ๐‘–๐‘› โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ ๐‘Ž ๐‘›1 ๐‘Ž ๐‘›2 โ€ฆ ๐‘Ž ๐‘›๐‘— โ€ฆ ๐‘Ž ๐‘›๐‘› ๐‘ฅ 1 ๐‘ฅ 2 โ‹ฎ ๐‘ฅ ๐‘– โ‹ฎ ๐‘ฅ ๐‘› = ๐‘ 1 ๐‘ 2 โ‹ฎ ๐‘ ๐‘– โ‹ฎ ๐‘ ๐‘› Approach in two steps: Operating on rows of matrix A and vector b, transform the matrix A to an upper triangular matrix. Solve the system using Back substitution algorithm. Indices: i: Row index j: Column index k: Step index

3 Matrix after the kth Step:
We only need to perform steps up to k = n - 1 in order to make the matrix upper triangular

4 Gauss Elimination Algorithm
Forward Elimination: For k = 1, 2, โ€ฆ. (n - 1) Define multiplication factors: ๐‘™ ๐‘–๐‘˜ = ๐‘Ž ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘˜ Compute: ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— - ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ; ๐‘ ๐‘– = ๐‘ ๐‘– โˆ’ ๐‘™ ๐‘–๐‘˜ ๐‘ ๐‘˜ for i = k+1, k+2, โ€ฆ.n and j = k+1, k+2, โ€ฆ.n Resulting System of equation is upper triangular. Solve it using the Back-Substitution algorithm: ๐‘ฅ ๐‘› = ๐‘ ๐‘› ๐‘Ž ๐‘›๐‘› ; ๐‘ฅ ๐‘– = ๐‘ ๐‘– โˆ’ ๐‘—=๐‘–+1 ๐‘› ๐‘Ž ๐‘–๐‘— ๐‘ฅ ๐‘— ๐‘Ž ๐‘–๐‘– ; ๐‘–= ๐‘›โˆ’1 , ๐‘›โˆ’2 , โ€ฆ3, 2, 1

5

6 For large n: Number of Floating Point Operations required to solve a system of equation using Gauss elimination is โ“ 2n3/3 (*of the order of*) When is the Gauss Elimination algorithm going to fail ? For k = 1, 2, โ€ฆ. (n - 1) ๐‘™ ๐‘–๐‘˜ = ๐‘Ž ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘˜ ; ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— - ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ; ๐‘ ๐‘– = ๐‘ ๐‘– โˆ’ ๐‘™ ๐‘–๐‘˜ ๐‘ ๐‘˜ for i = k+1, k+2, โ€ฆ.n and j = k+1, k+2, โ€ฆ.n If akk is zero at any step! The akkโ€™s are called โ€œPivotsโ€ or โ€œPivotal Elementโ€ If this happens at some step, solve the system by exchanging rows such that akk is non-zero.

7 Gauss-Jordon Elimination for the matrix equation Ax = b:
๐‘Ž 11 ๐‘Ž 12 โ€ฆ ๐‘Ž 1๐‘— โ€ฆ ๐‘Ž 1๐‘› ๐‘Ž 21 ๐‘Ž 22 โ€ฆ ๐‘Ž 2๐‘— โ€ฆ ๐‘Ž 2๐‘› โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ ๐‘Ž ๐‘–1 ๐‘Ž ๐‘–2 โ€ฆ ๐‘Ž ๐‘–๐‘— โ€ฆ ๐‘Ž ๐‘–๐‘› โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ ๐‘Ž ๐‘›1 ๐‘Ž ๐‘›2 โ€ฆ ๐‘Ž ๐‘›๐‘— โ€ฆ ๐‘Ž ๐‘›๐‘› ๐‘ฅ 1 ๐‘ฅ 2 โ‹ฎ ๐‘ฅ ๐‘– โ‹ฎ ๐‘ฅ ๐‘› = ๐‘ 1 ๐‘ 2 โ‹ฎ ๐‘ ๐‘– โ‹ฎ ๐‘ ๐‘› Approach: Operating on rows of matrix A and vector b, transform the matrix A to an identity matrix. The vector b transforms into the solution vector. Indices: i: Row index j: Column index k: Step index

8 Gauss-Jordon Algorithm: For k = 1, 2, โ€ฆn
1 0 โ€ฆ 0 โ€ฆ โ€ฆ 0 โ€ฆ 0 โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ 0 0 โ€ฆ 1 โ€ฆ 0 โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ 0 0 โ€ฆ 0 โ€ฆ ๐‘ฅ 1 ๐‘ฅ 2 โ‹ฎ ๐‘ฅ ๐‘– โ‹ฎ ๐‘ฅ ๐‘› = ๐‘ 1 ๐‘ 2 โ‹ฎ ๐‘ ๐‘– โ‹ฎ ๐‘ ๐‘› Gauss-Jordon Algorithm: For k = 1, 2, โ€ฆn ๐‘Ž ๐‘˜๐‘— = ๐‘Ž ๐‘˜๐‘— ๐‘Ž ๐‘˜๐‘˜ ; ๐‘ ๐‘˜ = ๐‘ ๐‘˜ ๐‘Ž ๐‘˜๐‘˜ ; ๐‘—=๐‘˜,โ€ฆ๐‘› ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— - ๐‘Ž ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ; ๐‘ ๐‘– = ๐‘ ๐‘– โˆ’ ๐‘Ž ๐‘–๐‘˜ ๐‘ ๐‘˜ for i = 1, 2, 3, โ€ฆ.n (โ‰  k) and j = k,โ€ฆn Final b vector is the solution. If we work with the augmented matrix: ๐‘Ž ๐‘˜๐‘— = ๐‘Ž ๐‘˜๐‘— ๐‘Ž ๐‘˜๐‘˜ ๐‘—=๐‘˜,โ€ฆ๐‘›+1 ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— - ๐‘Ž ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— i = 1, 2, 3, โ€ฆ.n (โ‰  k) and j = k,โ€ฆโ€ฆn + 1 (n+1)th column is the solution vector

9 Homework: Calculate the number of floating point operations required for the solution using the Gauss- Jordon Algorithm! When is the Gauss-Jordon algorithm going to fail ? Inverse of a matrix (n ร— n) can be computed using the Gauss- Jordon Algorithm: Augment an identity matrix of order n with the matrix to be inverted. Resulting matrix will be (n ร— 2n) Carry out the operations using Gauss-Jordon Algorithm Original matrix will become an identity matrix and the augmented identity matrix will become its inverse!

10 ๐‘Ž 11 ๐‘Ž 12 โ€ฆ ๐‘Ž 1๐‘— โ€ฆ ๐‘Ž 1๐‘› | ๐‘Ž 21 ๐‘Ž 22 โ€ฆ ๐‘Ž 2๐‘— โ€ฆ ๐‘Ž 2๐‘› | โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ | ๐‘Ž ๐‘–1 ๐‘Ž ๐‘–2 โ€ฆ ๐‘Ž ๐‘–๐‘— โ€ฆ ๐‘Ž ๐‘–๐‘› | โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ | ๐‘Ž ๐‘›1 ๐‘Ž ๐‘›2 โ€ฆ ๐‘Ž ๐‘›๐‘— โ€ฆ ๐‘Ž ๐‘›๐‘› | 1 0 โ€ฆ 0 โ€ฆ โ€ฆ 0 โ€ฆ 0 โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ 0 0 โ€ฆ 1 โ€ฆ 0 โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ 0 0 โ€ฆ 0 โ€ฆ 1 Gauss-Jordon Algorithm: For k = 1, 2, โ€ฆn ๐‘Ž ๐‘˜๐‘— = ๐‘Ž ๐‘˜๐‘— ๐‘Ž ๐‘˜๐‘˜ ๐‘—=๐‘˜,โ€ฆ2๐‘› ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— - ๐‘Ž ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— i = 1, 2, 3, โ€ฆ.n (โ‰  k) and j = k,โ€ฆโ€ฆ2n Can you see why this inversion algorithm works?

11 Ax = b LU-Decomposition: A general method
In most engineering problems, the matrix A remains constant while the vector b changes with time. The matrix A describes the system and the vector b describes the external forcing. e.g., all network problems (pipes, electrical, canal, road, reactors, etc.); structural frames; many financial analyses. If all bโ€™s are available together, one can solve the system by augmented matrix but in practice, they are not! Instead of performing โ“ n3 floating point operations to solve whenever a new b becomes available, it is possible to solve the system by performing โ“ n2 floating point operations if a LU Decomposition is available for matrix A LU-decomposition requires โ“ n3 floating point operations!

12 Ax = b Consider the system: (b changes!)
Perform a decomposition of the form A = LU, where L is a lower-triangular and U is an upper-triangular matrix! LU-decomposition requires โ“ n3 floating point operations! For any given b, solve Ax = LUx = b This is equivalent to solving two triangular systems: Solve Ly = b using forward substitution to obtain y (~n2 operations) Solve Ux = y using back substitution to obtain x (~n2 operations) Most frequently used method for engineering applications! We will derive LU-decomposition from Gauss Elimination!

13 An example of gauss elimination (four decimal places shown): 3 โˆ’1 1 โˆ’2 โˆ’ โˆ’3 ๐‘ฅ 1 ๐‘ฅ 2 ๐‘ฅ 3 = 2 โˆ’ โˆ’1 1 0 โˆ’ โˆ’ ๐‘ฅ 1 ๐‘ฅ 2 ๐‘ฅ 3 = 2 โˆ’ โˆ’1 1 0 โˆ’ โˆ’ ๐‘ฅ 1 ๐‘ฅ 2 ๐‘ฅ 3 = 2 โˆ’ โˆ’ At this point, you may solve the system using back-substitution to obtain x1 = 1, x2 = 3 and x3 = 2. Check the following matrix identity: โˆ’ โˆ’ โˆ’1 1 0 โˆ’ โˆ’ = 3 โˆ’1 1 โˆ’2 โˆ’ โˆ’3 One can derive the general algorithm of LU-Decomposition by carefully studying Gauss Elimination! l21 = -2/3 = l31 = 1/3 = l32 = /5.6667 =

14 Matrix after the kth Step:
Changed 1-time and became zero Changed 2-times and became zero Changed k- times and became zero Changed 0-times Changed 1-time Changed 2-times Changed 3-times Changed (k-1)-times

15 Gauss-Elimination Steps (example 4ร—4 matrix): ๐‘Ž 11 (1) ๐‘Ž 12 (1) ๐‘Ž 13 (1) ๐‘Ž 14 (1) ๐‘Ž 21 (1) ๐‘Ž 22 (1) ๐‘Ž 23 (1) ๐‘Ž 24 (1) ๐‘Ž 31 (1) ๐‘Ž 32 (1) ๐‘Ž 33 (1) ๐‘Ž 34 (1) ๐‘Ž 41 (1) ๐‘Ž 42 (1) ๐‘Ž 43 (1) ๐‘Ž 44 (1) ๐‘Ž 11 (1) ๐‘Ž 12 (1) ๐‘Ž 13 (1) ๐‘Ž 14 (1) 0 ๐‘Ž 22 (2) ๐‘Ž 23 (2) ๐‘Ž 24 (2) 0 ๐‘Ž 32 (2) ๐‘Ž 33 (2) ๐‘Ž 34 (2) 0 ๐‘Ž 42 (2) ๐‘Ž 43 (2) ๐‘Ž 44 (2) ๐‘Ž 11 (1) ๐‘Ž 12 (1) ๐‘Ž 13 (1) ๐‘Ž 14 (1) 0 ๐‘Ž 22 (2) ๐‘Ž 23 (2) ๐‘Ž 24 (2) 0 0 ๐‘Ž 33 (3) ๐‘Ž 34 (3) ๐‘Ž 44 (4) ๐‘Ž 11 (1) ๐‘Ž 12 (1) ๐‘Ž 13 (1) ๐‘Ž 14 (1) 0 ๐‘Ž 22 (2) ๐‘Ž 23 (2) ๐‘Ž 24 (2) 0 0 ๐‘Ž 33 (3) ๐‘Ž 34 (3) 0 0 ๐‘Ž 43 (3) ๐‘Ž 44 (3) Step 1 Step 2 Step 3

16 For elements above and on the diagonal i โ‰ค j:
Changed 1-time and became zero Changed 2-times and became zero Changed k- times and became zero Changed 0-times Changed 1-time Changed 2-times Changed 3-times Changed (k-1)-times For elements above and on the diagonal i โ‰ค j: aij is actively modified for the first (i - 1) steps and remains constant for the rest (n - i) steps For elements below on the diagonal j < i: aij is actively modified for the first j steps and remains at zero for the rest (n - j) steps Combined statement: Any element aij is actively modified for the first p steps where, p = min {(i-1), j}

17 Any element aij is actively modified for p-steps where, p = min {(i-1), j}
Modification formula: ๐‘Ž ๐‘–๐‘— ๐‘˜+1 = ๐‘Ž ๐‘–๐‘— ๐‘˜ - ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ Summing over p-steps: ๐‘˜=1 ๐‘ ๐‘Ž ๐‘–๐‘— ๐‘˜+1 โˆ’ ๐‘Ž ๐‘–๐‘— ๐‘˜ =โˆ’ ๐‘˜=1 ๐‘ ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ ๐‘= min ๐‘–โˆ’1 ,๐‘— For i โ‰ค j, p = i - 1 ๐‘Ž ๐‘–๐‘— ๐‘– โˆ’ ๐‘Ž ๐‘–๐‘— 1 =โˆ’ ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ ๐‘Ž ๐‘–๐‘— 1 = ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— ๐‘– + ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ Define: ๐‘™ ๐‘–๐‘– = ๐‘™ ๐‘—๐‘— =1 โŸน ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘– ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜

18 For i โ‰ค j, p = i - 1 ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘– ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ For j < i, p = j ๐‘Ž ๐‘–๐‘— ๐‘—+1 โˆ’ ๐‘Ž ๐‘–๐‘— 1 =โˆ’ ๐‘˜=1 ๐‘— ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ But ๐‘Ž ๐‘–๐‘— ๐‘—+1 =0 โ‡’ ๐‘Ž ๐‘–๐‘— 1 = ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘— ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ Combining two statements: ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘ ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ ๐‘= min ๐‘–,๐‘—

19 ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘ ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ ๐‘= min ๐‘–,๐‘—
Define the elements of matrix L as: ๐‘™ ๐‘–๐‘˜ = ๐‘™ ๐‘–๐‘˜ Define the elements of matrix U as: ๐‘ข ๐‘˜๐‘— = ๐‘Ž ๐‘˜๐‘— ๐‘˜ โ‡’ ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘ ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘= min ๐‘–,๐‘— This is equivalent to matrix multiplication: A = LU Can you see it?

20 ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘ ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘= min ๐‘–,๐‘—
๐‘Ž 11 ๐‘Ž 12 ๐‘Ž 13 ๐‘Ž 21 ๐‘Ž 22 ๐‘Ž 23 ๐‘Ž 31 ๐‘Ž 32 ๐‘Ž 33 = ๐‘™ ๐‘™ 21 ๐‘™ ๐‘™ 31 ๐‘™ 32 ๐‘™ ๐‘ข 11 ๐‘ข 12 ๐‘ข ๐‘ข 22 ๐‘ข ๐‘ข 33 ๐‘Ž 11 = ๐‘™ 11 ๐‘ข ๐‘Ž 12 = ๐‘™ 11 ๐‘ข ๐‘Ž 13 = ๐‘™ 11 ๐‘ข 13 ๐‘Ž 21 = ๐‘™ 21 ๐‘ข ๐‘Ž 22 = ๐‘™ 21 ๐‘ข 12 + ๐‘™ 22 ๐‘ข 22 ๐‘Ž 23 = ๐‘™ 21 ๐‘ข 13 + ๐‘™ 22 ๐‘ข 23 ๐‘Ž 31 = ๐‘™ 21 ๐‘ข ๐‘Ž 32 = ๐‘™ 31 ๐‘ข 12 + ๐‘™ 32 ๐‘ข 22 ๐‘Ž 33 = ๐‘™ 31 ๐‘ข 13 + ๐‘™ 32 ๐‘ข 23 + ๐‘™ 33 ๐‘ข 33 12 Unknowns and 9 equations! 3 free entries! In general, n2 equations and n2 + n unknows! n free entries!

21 Doolittleโ€™s Algorithm:
Define: ๐‘™ ๐‘–๐‘– = ๐‘™ ๐‘—๐‘— =1 The U matrix: i โ‰ค j ๐‘Ž ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— ๐‘– + ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ โ‡’ ๐‘Ž ๐‘–๐‘— = ๐‘ข ๐‘–๐‘— + ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘ข ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘–=1,2,โ€ฆ๐‘›; ๐‘—=๐‘–,๐‘–+1,โ€ฆ๐‘› The L matrix: j < i ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘— ๐‘™ ๐‘–๐‘˜ ๐‘Ž ๐‘˜๐‘— ๐‘˜ โ‡’ ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘— ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘™ ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘—โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘ข ๐‘—๐‘— ๐‘–=๐‘—+1,โ€ฆ๐‘›; ๐‘—=1,2,โ€ฆ๐‘›

22 Croutโ€™s Algorithm: ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘ ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘= min ๐‘–,๐‘— Define: ๐‘ข ๐‘–๐‘– = ๐‘ข ๐‘—๐‘— =1 The L matrix: j โ‰ค i ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘— ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— โ‡’ ๐‘™ ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘—โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘—=1,2,โ€ฆ๐‘›; ๐‘–=๐‘—, ๐‘—+1,โ€ฆ๐‘› The U matrix: i < j ๐‘Ž ๐‘–๐‘— = ๐‘˜=1 ๐‘– ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— โ‡’ ๐‘ข ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘™ ๐‘–๐‘– ๐‘–=1,2,โ€ฆ๐‘›; ๐‘—=๐‘–+1,โ€ฆ๐‘›

23 Doolittleโ€™s Algorithm (3ร—3 example): The L matrix: j < i
๐‘™ 11 = ๐‘™ 22 = ๐‘™ 33 =1 ๐‘™ ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘—โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘ข ๐‘—๐‘— ๐‘–=๐‘—+1,โ€ฆ๐‘›; ๐‘—=1,2,โ€ฆ๐‘›โˆ’1 j = 1, i = 2, 3: ๐‘™ 21 = ๐‘Ž 21 ๐‘ข 11 , ๐‘™ 31 = ๐‘Ž 31 ๐‘ข 11 j = 2, i = 3: ๐‘™ 32 = ๐‘Ž 32 โˆ’ ๐‘™ 31 ๐‘ข 12 ๐‘ข 22 The U matrix: i โ‰ค j ๐‘ข ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘–=1,2,โ€ฆ๐‘›; ๐‘—=๐‘–,๐‘–+1,โ€ฆ๐‘› i = 1, j = 1, 2, 3: ๐‘ข 11 = ๐‘Ž 11 , ๐‘ข 12 = ๐‘Ž 12 , ๐‘ข 13 = ๐‘Ž 13 i = 2, j = 2, 3: ๐‘ข 22 = ๐‘Ž 22 โˆ’ ๐‘™ 21 ๐‘ข 12 , ๐‘ข 23 = ๐‘Ž 23 โˆ’ ๐‘™ 21 ๐‘ข 13 i = 3, j = 3: ๐‘ข 33 = ๐‘Ž 23 โˆ’ ๐‘™ 31 ๐‘ข 13 โˆ’ ๐‘™ 32 ๐‘ข 23 ๐‘™ ๐‘™ 31 ๐‘™ 32 1 2 4 ๐‘ข 11 ๐‘ข 12 ๐‘ข ๐‘ข 22 ๐‘ข ๐‘ข 33 1 3 5

24 Verify this computation sequence!
Croutโ€™s Algorithm (3ร—3 example): Define: ๐‘ข ๐‘–๐‘– = ๐‘ข ๐‘—๐‘— =1 The L matrix: j โ‰ค i ๐‘™ ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘—โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘—=1,2,โ€ฆ๐‘›; ๐‘–=๐‘—, ๐‘—+1,โ€ฆ๐‘› The U matrix: i < j ๐‘ข 11 = ๐‘ข 22 = ๐‘ข 33 =1 ๐‘ข ๐‘–๐‘— = ๐‘Ž ๐‘–๐‘— โˆ’ ๐‘˜=1 ๐‘–โˆ’1 ๐‘™ ๐‘–๐‘˜ ๐‘ข ๐‘˜๐‘— ๐‘™ ๐‘–๐‘– ๐‘–=1,2,โ€ฆ๐‘›โˆ’1; ๐‘—=๐‘–+1,โ€ฆ๐‘› Verify this computation sequence! ๐‘™ ๐‘™ 21 ๐‘™ ๐‘™ 31 ๐‘™ 32 ๐‘™ 33 1 3 5 1 ๐‘ข 12 ๐‘ข ๐‘ข 2 4


Download ppt "Ax = b Methods for Solution of the System of Equations (ReCap):"

Similar presentations


Ads by Google