Category: Solution of linear systems

How to use the different techniques to solve linear systems? A discussion of Lower upper factorization is presented with full detailed solved problems for 2×2 matrices and 3×3 matrices.

Solved problems for 3×3 matrix by Crout’s LU-option -1.

We have two solved problems for the 3×3 matrix by Crout’s LU decomposition. for which we will apply the same technique used to derive the elements of the lower matrix and the upper matrix.

The first solved problem for the 3×3 matrix by Crout’s LU-Option-1.

The first problem for the 3×3 matrix is Crout’s LU decomposition. It is required to find both the Lower and upper matrix decomposition LU by using Crout’s method through a given matrix A. The given matrix is 3×3.

We will apply the previous post technique to get the L1 and U1 matrix components by using the following steps.

Step-1 Convert matrix A to a lower matrix.

First, we have matrix A as (1 1 1, 4 3 -1, 3 5 3 ). We will estimate the determinant value of this matrix A, it is estimated as equal to +10. Since the determinant value is not equal to zero, then the matrix is invertible and we can proceed to find L and U matrices based on Crout’s method.

 The three elements in the first column vector of the A matrix which are 1 4 3 will be set as L11 &L21 and L31. L11=1, L21=4,L31=3. While for U12, we will divide a21/a11=1/1=1. While U13=a13/a11=1.

As for the upper matrix U1, the u11=1, U12=a21/a11=1/1=1 and u13=a13/a11=1/1=1. The detailed procedures are shown in the slide image.

The first solved problem of the two solved problems for 3x3 matrix by Crout's LU decomposition.

Step-2-Derive the values for the L22, L23, and U23-option-1.

We will use a11 as a pivot, we multiply (-1)*(a12/a11)*column 1 and add the result to the 2nd column, similarly, we multiply (-1)*(a13/a11)*column 1 and add the result to the 3rd column.  If we call the new matrix L1, the elements of the matrix are as follows:

The first row is (1   0   0). The second row is (4  -1   -5). The third row is (3  2   0). If we compare the first row of L1 to the next matrix, we have (L11 0 0), then L11=1. If we compare the second row of L1 to the next matrix, we have (L21 L22  L22*U23), then L21=4.

If we compare the third row of L1 to the next matrix, we have (L31 L32  L32*U23+L33), then L31=3 and L32 =2.

First solved problem -How to get the value of L22 for L1 matrix?

Step-3-Derive the value for the L33.

We want to proceed to get the final l matrix, we want to let  -5 equal zero. We multiply (-1)*(-5/-1)*column 2 and add the result to the 3rd column. The final elements of the Lower matrix l will be as follows:

The first row is (1   0   0). The second row is (  4 -1  -5*-1+(-5)). The third row is (  3  2  -5*2+(0)).

1st solved problem-How to get the value of L33?

Step-4-Check the product of(L*U)=A-matrix for a 3×3 matrix.

In the final slide, we have all the elements in the first column of the matrix identical to the first column of the lower matrix. The diagonals of the U matrix U11=U22=U33=1. L22=-1. U23=+5 while L33=-10. U12=1 and u13=1.

We can write both the lower matrix and the upper matrix and check whether the multiplication of the lower matrix by the upper matrix will give us the final A matrix or not. Using the row-by-column multiplication, we can see that L*U multiplication will give the matrix A.

How to derive the expression of L and U matrices?

The second solved problem-Crout’s LU-Option-1.

First, we have matrix A as ( 10 3 4, 2 – 10 3, 3 2 -10 ). We will estimate the determinant value of this matrix A, which is estimated as equal to +1163 Since the determinant value is not equal to zero, then the matrix is invertible and we can proceed to find L and U matrices based on Crout’s method. The second solved problem, the detailed procedure to estimate the determinant is shown in the next slide image.

2nd solved problem-check whether matrix is invertible.

Step-1 Convert matrix A to a lower matrix.

The three elements in the first column vector of the A matrix which are 10 2 3 will be set as L11 &L21 and L31. L11=10, L21=2,L31=3. While for U12, we will divide a21/a11=3/10=3/10. While U13=a13/a11=4/10.

The second solved problem of the two solved problems for 3x3 matrix by Crout's LU decomposition.

Step-2-Derive the values for the L22, L23, and U23.

We will use a11 as a pivot, we multiply (-1)*(a12/a11)*column 1 and add the result to the 2nd column, similarly, we multiply (-1)*(a13/a11)*column 1 and add the result to the 3rd column.  If we call the new matrix L1, the elements of the matrix are as follows:

The first row is (10 3 4). The second row is (2 -10 3). The third row is (3  2   -10). If we compare the first row of L1 to the next matrix, we have (L11 0 0), then L11=1. If we compare the second row of L1 to the next matrix, we have (L21 L22  L22*U23), then L21=2.

If we compare the third row of L1 to the next matrix, we have (L31 L32  L32*U23+L33), then L31=3 and L32 =.1. To get U23 divide ((2.2)/(-10.6)=-11/53.

Second solved problem.Derive the values for L22 and L32.

Step-3-Derive the value for the L33-Crout’s LU decomposition.

We want to proceed to get the final l matrix, we want to let  2.2 to be equal zero. We multiply (-1)*(2.2/-10.60)*column 2 and add the result to the 3rd column. The final elements of the Lower matrix l will be as follows:

The first row is (10   0   0). The second row is (  2 -10.60 0). The third row is (  3  1.1 -1163/106). As we can see L33 will be equal to -1163/106.

The 2nd solved problem -Find the value of L33.

Step-4-Check the product of(L*U)=A-matrix for a 3×3 matrix.

Using the row-by-column multiplication, we can see that L*U multiplication will give the matrix A.

2nd solved problem check L*U product.

The full detailed steps are shown in the previous slide images, at the end we will check the product of L*U against the Matrix A value.

This is a link to the next post is the introduction to the permutation matrix.

References

This is the Omni calculator for estimating various items of linear algebra -LU Decomposition Calculator.

Another calculator to use is a Calculator for matrices.

  • 9A- A Second option for Crout’s LU decomposition-3×3 matrix

    9A- A Second option for Crout’s LU decomposition-3×3 matrix

    A Second option for Crout’s LU decomposition-3×3 matrix.

    In this post, we will discuss how to get the elements of the lower and upper matrices using Crout’s method for the 3×3 Matrix.

     We have two options; the second option is to convert matrix A to an upper matrix, then we can get all the elements of the upper  Matrix, and besides, we can get the value of L22&L32 and L33.

    The details of equating Matrix A to the multiplication of the lower Matrix L by the upper Matrix U are shown on the slide page

    Step-1-equate the product of L*U to the A- matrix.

    We have three equations for which we want to develop Crout’s LU decomposition for a 3×3 matrix.
    The first equation is (a11*x1+a12*x2+a13*x3=b1). The second equation is (a21*x1+a22*x2+a23*x3=b2).

    The third equation is (a31*x1+a32x2+a33*x3=b3).

    We can express these equations as A*x=b. The next task is to try to get L and U matrices using Crout’s LU decomposition for a 3×3 matrix-Option 2.

    The matrix A which is(a11 a12 a13,a21 a22 a23, a31 a32 a33). Consider the lower matrix L matrix as (L11 0 0, L21 L22,0, L31 L32 L33) which is a 3×3 matrix.

    Using the expression of L*U =A, we can drive a new matrix which is a 3×3 matrix, that contains the elements of both the lower and upper matrix.

     If we write  A as  3×3, for which the elements are (  a11  a12 a13, a21  a22  a23, and  (a31 a32 a33) equal to the multiplication of L by U.

    We know that according to Crout’s method, we have all the diagonals of Matrix U are Ones. The left-hand side is Matrix A, while on the right-hand side are L*U matrices.

    Step-2-Derive the expression for L11, L12, L13 & U12, U13.

    The second slide shows that the three elements L11&L21 and L31 are equal to a11&aa12 and a13. While a1U12=a21/L11 and since L11 equals a11, we can derive the expression of u12 as equal to (a12/a11), and similarly, U13 is equal to a13/a11.

    Equating matrix A to Lu matrix.

    As a quick reminder of the values of L11, L21, and L31, Copy the entire first column of matrix A and place it in the first column of the Lower matrix. Divide a12/a11 this is the value of U12 and Divide a13/a11 this is the value of U13. Please refer to the next slide image.

    Strategy to get L&U values.

    Step-3-A Second option for Crout’s LU decomposition-3×3 matrix.

    Option 2 is to convert matrix A to an upper matrix, as shown in the slide. We want a21 and a31 to be zeros; we set a11 as a pivot, then multiply the first row by (-a21/a11) and add the result to the second row.

    . The new matrix if we call it A1, has the first column as (a11 0 0), the second column elements are (a12 ((a22-a21/a11*(a12)) (( a32 -a21/a11*(a12)). The third column elements are (a13 ((a23-a21/a11*(a13)) (( a32 -a21/a11*(a12)). For the third row/ third column, the element will be set equal to L31U13+L32U23-U13L31+L33=L23U23+L33.

    A Second option for Crout's LU decomposition-3x3 matrix

    Step-4- How to find L22, and L32?

    If we look at the second row / second column element of matrix A, we have (a22=L21*U12+L22), so we can get a value for L22 equal to (a22-L21*U12) or l22=a22-a21*a12/a11.

    While the third row / second column element of matrix A is a32,  we have (a32=L31*U12+L32), so we can get a value for L32 equal to (a32-L31*U12) or L32=a32-a31*a12/a11.

    If we refer back to matrix A1, we find that the second row /the second column, which is ((a22-a21/a11*(a12)) can be set equal to L21.

    The third row/ the second column, ((a23-a21/a11*(a13), can be equal to L32. If we refer back to matrix A1, we find that the second row /the third column, which is (( a32 -a21/a11*(a12)), can be set equal to L22*U23.

    The third row/the third column, (( a32 -a21/a11*(a12)) can be equal to L32*U23+L33.

    Convert matrix A tomatrix A1.

    Step-5- How to find L33, U23& U12, and U13?

    We move to the next slide and check the final terms of matrix A, from which we can get the values of L22 and L32. We proceed to get
    matrix U1 by letting L32=0. We use L22 as a pivot, multiply the second row by(-1)*L32/L22 and add the value to the third row.

    The Final upper Matrix contains the following: As a first row, we have (L11 U12*L11 U13*L11); as a second row, we have (0 L22   L22*U23 ); as a third row, we have (0 0 L33).

    Get data for matrix U.

    To get the values of U12 and U13 divide the first row/second column element by L11 and divide the first row/third column element by L11. To get U23 divide the second row/3rd column element by L22. A summary of the steps we made to Get L22 and l23 elements.

    Convert matrix A to an upper matrix.

    A summary of the steps we made to Get L33 &U12 and U13.

    Convert matrix U1 to u2.


    This is a link to download the PDF file used for the illustration of this post.

    The next post is Solved problems for 3×3 matrix by Crout’s LU-option 1.

    This is the Omni calculator for estimating various items of linear algebra -LU Decomposition Calculator.

    This is a link to another –Calculator for matrices.

  • 9- Crout’s LU decomposition for a 3×3 matrix-Option 1

    9- Crout’s LU decomposition for a 3×3 matrix-Option 1

    Crout’s LU decomposition for a 3×3 matrix-Option 1.

    The elements of the upper and lower matrix, 3×3, can be obtained using the Gauss elimination method. The U matrix for Crout’s LU decomposition for a 3×3 matrix is (3×3) matrix composed of (u11 u21 u13) or the first row and ( 0 1 u23) for the second row. For the last row, the matrix is (0 0 1).

    The following steps explain how to find the components of both the lower L and the upper U matrix.

    Step-1-equate the product of L*U to the A- matrix.

    We have three equations for which we want to develop Crout’s LU decomposition for a 3×3 matrix.
    The first equation is (a11*x1+a12*x2+a13*x3=b1). The second equation is (a21*x1+a22*x2+a23*x3=b2).

    The third equation is (a31*x1+a32x2+a33*x3=b3). We can express these equations as A*x=b. The next task is to get L and U matrices using Crout’s LU decomposition for a 3×3 matrix Option 1.

    The matrix A which is(a11 a12 a13,a21 a22 a23, a31 a32 a33). Consider the lower matrix L matrix as (L11 0 0, L21 L22,0, L31 L32 L33) a 3×3 matrix.

    Using the expression L*U =A, we can drive a new 3×3 matrix that contains the elements of both the lower and upper matrix.

    By writing down the matrix A as  3×3 (a11  a12 a13, a21  a22  a23 and  (a31 a32 a33) =the multiplication of l by U, or the multiplication of ( L11 0  0, L21 L22  0, L31 L32  0) multiplied by  ( 1 U12 U13, 0  1  U23, 0  0 1), as we know that according to Crout’s method, we have the diagonal of Matrix U is ones. The left-hand side is matrix A, while on the right-hand side are L*U matrices.

    Crout's LU decomposition for a 3x3 matrix.

    Step-2-Derive the expression for L11, L12, L13 &U12, U13 for Crout’s LU decomposition for a 3×3 matrix.

    From the second slide, we can see that by multiplying the lower matrix’s First row by the upper matrix’s First Column, we get (L11*1)  equal to the first element a11 of matrix A.

    Multiply the third row of the lower matrix by the First Column of the upper matrix, we get (L31) which will be equal to a31.

    At first sight, we see that the first column of The lower triangulation matrix is identical to the first column of the original Matrix since L11=a11. L21=a21, L31=a31.

    We will proceed to multiply the first row of the lower matrix by the second column of the upper matrix. We can write that (l11*u12 +0*1+0*0)=a12.

    We have L11 equals to a11, so U12 will be set=a12/a11, since L11*U12=a12.

    If we multiply the first row of the lower matrix by the third column of the upper matrix. We can write that (l11*u13 =a13. So U13 will be set=a12/a13, since L11*U13=a13. We have L11 equals to a11, so U12 will be set=a12/a11, since L11*U12=a12.

    Crout's LU decomposition for a 3x3 matrix-part 2.

    As a quick reminder of the values of L11, L21, and L31, please Copy the entire first column of matrix A and place it in the first column of the Lower matrix. Divide a12/a11, this is the value of U12, and Divide a13/a11, this is the value of U13. Please refer to the next slide image.

    Derive the values  of L11,L21,L31. Crout's method.
    Derive the values of L11, L21, L31. Crout’s method.

    .

    Step-3-Convert A matrix to a lower matrix as option-1-Crout’s LU decomposition for a 3×3 matrix.

    Option 1 is to convert matrix A to a lower matrix, as we can see from the slide. We want a12 and a13 to be zeros, we set a11 as a pivot, then multiply the first column by (-a12/a11) and add the result to the second column. Similarly, we can multiply the first column by (-a13/a11) and add the result to the third column.

    If we have a look at the second row / second column element, we have (a22-a21/a11*a21). Please refer to the upper left corner of this slide, if we compare matrix A and the product of l by U, we can see that a22=L21*U12+L22.

    Since we already know that a21/a11=U12, L21=a12, we can rewrite the second row / second column element, which has (a22-a12/a11*a21), to be equal to l21*u12+l22-U12*L21=L22. We can also rewrite the third row / second column element, which has (a32-a12/a11*a31), to be equal to L31*u12+l32-U12L31=L32.

    For the second row/ third column, the element will be equal to L21*U13+L22*U23-U13*L21=L22*U23. For the third row/ third column, the element will be equal to L31*U13+L32*U23-U13*L31+L33=L23*U23+L33.

    How to find Lower matrix L1?

    Step-4-Derive the value for the U23 for Crout’s LU decomposition for a 3×3 matrix.

    After adjusting its rows, we move to the next slide and check the lower matrix L1.

    We can get the value of U23 by dividing the second row/third column element over the second row/second column element. To reach the final lower matrix L, we want to let L22 U23 equal zero.

    Consider L22 as a pivot. Divide L22*U23/L22, multiply by (-1) *second column and add the result to the third column.

    How to find the final Lower matrix L?


    Step-5-The final Crout’s LU decomposition for a 3×3 matrix.

    We will move to the last slide. As we have explained, we can get the value of U23 as a summary from matrix L1. The final L matrix will give the final values of all elements of the lower matrix L, including L33.

    Crout's LU decomposition for a 3x3 matrix

    This is the PDF file used to illustrate this post.

    The previous post: Step-by-step Introduction to Crout’s LU decomposition for a 2×2 matrix.

    The next post is A Second option for Crout’s LU decomposition-3×3 matrix.

    This is the Omni calculator for estimating various items of linear algebra -LU Decomposition Calculator.

    This is a link to another –Calculator for matrices.

  • 8-Introduction to Crout’s LU decomposition for a 2×2 matrix.

    8-Introduction to Crout’s LU decomposition for a 2×2 matrix.

    Introduction to Crout’s LU decomposition for a 2×2 matrix.

    The elements of the upper and lower matrix, 2×2, can be obtained by using the Gauss elimination method. Next is how to solve for x,y for two equations using the lower upper triangulation, through an example.

    Step-1-derive the expression for Crout’s LU decomposition for a 2×2 matrix.

    We have two equations for which we want to develop Crout’s LU decomposition for a 2×2 matrix. The first equation is (2x+3y=13) and the second equation is (3x+4y=18). As we can see the determinant of the matrix equals -1, not zero.

    Then the matrix is invertible. We set this Matrix A to be equal to two matrices multiplied by each other One of these is called the lower Matrix. The other Matrix is the upper Matrix.

    The lower Matrix is expressed as lij. Where I represent the row and j represents the column. The lower Matrix has L11, L22, and l21 in the case of 2×2 matrix nonzeros. The element L12 is zero. For the symbols, we will write A matrix (2 3 3 4); we are saying a11, a12, a21, and a22.

    Derive the expression for Crout's LU decomposition for a 2x2 matrix

    Unlike the previous method LU decomposition, Crout’s LU decomposition for the 2×2 matrix considers that the upper matrix has a diagonal=1, beside the lower corner element=U21=0, while The L matrix’s diagonal based on Crout’s LU decomposition for 2×2 matrix is not =1.

    Step-2-The values for L and U matrices for Crout’s LU decomposition for a 2×2 matrix.

    Since A = the lower multiplication by the upper matrices, we will perform the multiplication of lower and upper metrics and equate the product to the elements of matrix A. The multiplication of the  First row by the first column, we can express as L11=a11.

    The multiplication of the  First row by the second column we can express as (L11*U12)=a12.If we multiply the second row by the first column, we can express it as  (L21)=a21.

    If we multiply the second row by the second column, we can express it as  (L21*U12)+U22=a22. From equations I and III we have L11=a11&L21=a12. From equation II, we get U12=a12/a11. Finally,L22=a22-(a21*(a12/a11)).


    We apply this information for the given matrix A which is (2  3  3 4). The first column will be placed as the first column of the L matrix.

    We need to have the value of L22. For the U matrix, we have diagonals U11&U22=1, while U12=a12/a11=3/2.

    Perform the row echelon to convert matrix A to an upper matrix, taking the value of U22 as the value of L22. The final value of L22=-1/2.


    Derive the expressions for L and U matrices.


    For the given two sets of equations, 2x + 3y = 13 and 3x + 4y = 18.We have A=(2 3 3 4), b=(13 18). Since A*x=b, while A=L*U. Consider U*x=c. Then L*c=b. Since L and b are known, we can get the value of C, but we need to estimate the inverse of matrix L.

    The other alternative is to multiply U-1*L-1*x and equate the value to b. Then X=U-1L-1b.

    The expression of C as equal to L-1*b.

    Step-3-Derive the value for the inverse matrix L-1 for Crout’s LU decomposition for a 2×2 matrix.

    We will get the inverse matrix L-1, for a 2×2 matrix, we can get the determinant swap the corner element, and change the signs for the other diagonal. The determinant value of L=-1.The inverse matrix of L is (1/2 0 3 -2). We will make a check that L*l-1=I.

    How to detrmine the inverse of matrix L?

    Step-4-get the values for the C matrix for Crout’s LU decomposition for a 2×2 matrix.

    We can estimate the value of matrix C by multiplying L-1*B, L-1 we have just estimated, while b matrix is (2×1) matrix= ( 13 18). As we can see C=(13/2 3), is a 2×1 matrix. Since Ux= C, we can get the value of the unknowns by multiplying U-1*C.

    How to find matrix c?

    Step 5-get the values inverse matrix U-1 for Crout’s LU decomposition for a 2×2 matrix.

    We can get the inverse of matrix U, by using the identity matrix, the inverse of Matrix U is a 2×2 matrix with elements as ( 1  -3/2  0  1). Multiply U-1*C to get the X vector. The inverse of Matrix U is a 2×2 matrix with elements as ( 1 -3/2 0 1). We can get X=2 and y=3.

    Estimate the values of x and y from The C matrix.

    Step 6-get the values for x, and y from matrix C for Crout’s LU decomposition for a 2×2 matrix.

    The final value of X – the matrix can be estimated as a (2×1) matrix, 2 3). We will check our given equation to satisfy the requirements. As an alternative method to estimate the vector-matrix X, multiply U-1L-1B. The calculation will yield the same values for x and Y.

    Check the values of x and Y.

    This is the pdf file used for the illustration of this post.

    The next post: Crout’s LU decomposition for a 3×3 matrix.

    This is the Omni calculator for estimating various items of linear algebra -LU Decomposition Calculator.

    This is a link to another –Calculator for matrices.

  • 7-A Solved problem 9-5 LU decomposition.

    7-A Solved problem 9-5 LU decomposition.

    A Solved problem 9-5 LU decomposition.

    This solved problem 9.5 from Prof. Chapra’s reference book Numerical Methods for Engineers.

    It is required to solve three simultaneous equations by the Lu decomposition for a 3×3 matrix, we are going to solve this problem by using LU factorization(decomposition).

    Solved problem 9.5 L U decomposition

    Matrix A is the matrix for the variables which are (3×3), the first row(3 -0.10 -0.20) will be reserved for (U11 u12 u13) elements for the Upper matrix U1.


    Step-1-Derive the expression for U1 and L1 matrices for the Solved problem 9-5 LU decomposition.

    For the upper matrix U1, we have the first row set as(3 -0.10 -0.20), being an upper matrix (U21 and U21 should be =0, This is done by using a factor (-a21/a11) and factor (-a32/a11).
    The first factor is to be multiplied by R1 and added to R2. While the second factor will be multiplied by R1 and added to R3.

    As we can see from the next slide image: (-a21/a11)=-(0.10/3). multiply by R1+R2, then for U21=-(0.10/3)*3+0.10=0. While for u22=(-010/3)*-0.10+7=7.003. for u23=(-010/3)*-0.20+(-0.30)=-0.2933.

    For the elements of lower matrix L1, we have a diagonal of +1, and the upper elements l11=l12=l13=0. For L21=-(-a21/a11)=+0.033, l31=-1(-a33/a11)=-1(-0.30/3)=+0.1. The unknown element is l23 that element will be estimated i the next step.

    Derive the expression for U2 and L2 matrices for the Solved problem 9.5 Lu decomposition.

    Step-2-Derive the expression for U and L matrices for the Solved problem 9-5 LU decomposition.

    For u32 to be zero, multiply by (+0.19/7.003), using 7.003 as a pivot, then multiply by R2 and add to R33, u32=(0.19/7.003)*7.003+(-0.19)=0. The reversed sign for this factor(-0.19/7.003) will be the value of L32=-0.027.

    The element of L2 will be the final elements for L matrix as(1 0 0, 0 1 0, 0.10 -0.027 1). The elements of the U2 matrix will be the final elements for the U matrix as (3 -0.10 -0.20, 0 0 0, 0 1 0, 0.10 -0.027 1).

    Derive the expression for u1,L1 U2 and L2 for the Solved problem 9.5 Lu decomposition.

    Step-3-Derive the expression for the inverse matrices L-1 and U-1 for the Solved problem 9-5 LU decomposition.

    Step-4-Derive the value for the C matrix for the Solved problem 9-5 LU decomposition.

    The matrix A can be represented as the product of L*U, or the lower matrix multiplied by the upper matrix. we need to get the inverse matrix L-1 and also the inverse matrix u-1.

    We can find out the elements of these two inverted matrices by using an Excel sheet as shown in the next slide image.

    The value of the inverse matrix L-1 and U-1 for the Solved problem 9.5 Lu decomposition.

    Now for the expression of AX=B, since A=LU, So AX=LUX=B. Consider UX=C, while L* C=B, we can get the elements of matrix C by multiplying both sides by the inverted matrix L-1.

    L-1*B=( 1 0 0, -0.03333 1 0, -0.100904 0.027129 1) by (7.85 -19.3 71.40). this will create a matrix C (3×1) matrix which can be presented as ( 7.85 -19.5617 70.0842).

    The final value of matrix C.

    Step-5-get the values for x1, x2, x3 for the X-matrix for the Solved problem 9-5 LU decomposition.

    After we have obtained the values for the C matrix, we will consider the expression of U*X=C, and multiply both sides by U-1, so we can get the value of the X matrix which is the (3×1) matrix. The invert matrix U-1 is (0.3333 0.00475 0.006793,0 0.142789 0.00418, 0 0 0.0998). This matrix is to be multiplied by the C matrix. The final value of X – the matrix can be estimated as a (3×1) matrix, (2.9996 -2.5002 6.99444).

    This solution is very close to the solution of Prof. Chapra solution is shown in the last slide image.

    The final value of matrix x for the Solved problem 9.5 Lu decomposition.


    This is the pdf file used for the illustration of this post.

    The next post: Step-by-step Introduction to Crout’s LU decomposition for a 2×2 matrix.

    This is the Omni calculator for estimating various items of linear algebra -LU Decomposition Calculator.

    This is a link to another –Calculator for matrices.

  • 6- Solved problem for x-y-z values by LU decomposition.

    6- Solved problem for x-y-z values by LU decomposition.

    A solved problem for x-y-z values by LU decomposition for a 3×3 matrix.

    We have three simultaneous linear equations, it is required to get x,y, and z for these equations by using Lu decomposition.

    We start by converting matrix A into U1 matrix by letting a21,a31 values are zero to constitute an upper matrix.

    Reverse the signs of the estimated two factors to get the value of L21 as=(+4) and for L31 as=(+2). the l32 is unknown.

    For the a33 since it is already 0, we need not create any multiplication. This zero will be placed as the l33 value in our created L1 lower matrix.

    solved problem for x-y-z values by LU decomposition.

    The factors shown are (-a21/a11) and (-a11/a31). The first factor value=-(8/2)=-4, while the second factor=(-4/2)=-2.

    The U1 matrix is formed for the first row (2 1 4) which are the values of u11,u12, and u13.

    For the second row of the U1-matrix( 0 -7-14) which are the values for U21, U22 U23, the last row is(0 9 -9).

    Step-2-Derive the expression for U2 and L2 matrices.

    Convert a32 which is (9) to zero by multiplying by (-9/-7)R2 adds the value to R3, and we have used -7 as a second pivot, and the result which is (+9/7)-7+9=0 will be the value of u32, the corresponding L32 value is the reversed sign factor which is(-)*(9/7)=-9/7. The detailed calculations are shown in the next slide image.

    solved problem for x-y-z values by LU decomposition.

    The final shape of U2 and l2 will constitute the L and U matrices both of these matrices are 3×3 matrices, hence A can be set to be the product (L*U). A routine check of the product of L*u will produce the same elements of matrix A to be performed.

    Step-3-Derive the expression for the inverse matrix L-1 matrix for the solved problem for x-y-z.

    We will use the augmented matrix to get the inverse matrix L-1 value which will be (3×3 matrix). The process will continue till the left side of the matrix is an identity matrix and the right side of the augmented matrix will be the required inverse matrix of the lower matrix, denoted as Ll-1.

    Derive the expression for L-1 matrix for the solved problem for x-y-z.

    Step-5-Get the value of C- matrix.

    The C matrix is set to the multiplication of the lower matrix inverse by the matrix, B, and expressed as =L-1*B, both matrix’s values are known.

    The C matrix is a (3×1). The detailed calculations of the multiplication of the rows by columns are shown in the next slide images.

    We have U*x=C. We can write the matrix of U and the matrix of X and equate that multiplication to the matrix C.

    The value of the inverse matrix L-1.

    The expression of Ux=C.

    Step-6-Get the value of the X- matrix for the solved problem for x-y-z.

    C-matrix is =(12 -28 -27) it is 3×1 matrix. We have U*X=C, and the inverse matrix U-1 is needed to be estimated to get the expression for x=U-1*C. So we can estimate the final values of x,y, and z, by multiplying by the inverse matrix of U which is (U-1)

    We will derive the expression for the inverse matrix -U-1, by using the augmented matrix method. The full details of the necessary calculations are shown in the next two slide images.

    The inverse matrix U-1 estimation.

    The steps followed to get the inverse of the U matrix can be checked from the next slide image.

    Use the expression for U-1*C=x.

    The inverse of U is also an upper matrix and is called U-1 and written as ( 1/2 1/14 1/27) for the first row, ( 0 -1/7 12/27) for the second row, and ( 0 0 -1/27) for the third row. The inverse of the Upper matrix is to be multiplied by the matrix C, to get the values of x,y,z.

    The  product of  U-1*C=x.

    The last values for x,y, and z are for the solved problem for x-y-z.

    The multiplication of the inverse of matrix u by matrix c is shown and the final values for x,y, and z can be found to be=(3,2,1). The routine check for the estimated values for x,y, and z will be performed to satisfy the given three equations. The calculations are shown in the last slide image.

    The final values for x,y,z for the solved problem for x-y-z.

    We substitute the three equations with the values of x,y, and z and check whether these values satisfy the equations or not.

    The final check for x,y,z for the solved problem.


    This is the pdf file used for the illustration of this post.

    The next post: Solved problem 9-5 LU decomposition.

    This is the Omni calculator for estimating various items of linear algebra -LU Decomposition Calculator.

    This is a link to another –Calculator for matrices.