12- Solved example- LU decomposition- partial pivoting.

Solved example for LU decomposition-partial pivoting.

LU decomposition with partial pivoting is a fundamental technique used in numerical analysis to enhance accuracy by managing small or zero pivot elements. This process is vital when working with a 3×3 matrix denoted as A.

For the given example, LU decomposition- partial pivoting is required.

A thorough understanding of LU decomposition-partial pivoting is essential for students and professionals tackling complex matrix problems.

Step one: Select the maximum absolute value to be a new pivot.

When checking the first column of the given matrix, the pivot value is -2. We will select the maximum absolute value of (6,3), the two values below the pivot. However, we will first check whether the matrix is invertible by estimating the determinant value. The steps are shown in the next slide.

solved example for LU decomposition-partial pivoting

The maximum absolute value is 6. We will swap the second row to be in the position of the first row. The first row will move to be in place of the second row. We will rewrite the matrix and call it A’.

Write the proper permutation matrix p12

Step Two- Write the proper permutation matrix P12 that causes the swap.

The swap between rows can be expressed using the permutation matrix P12, which is responsible for swapping row 1 to row 2. The matrix P12 will be multiplied by matrix A to form the new matrix A’.

How to swap between rows?

The multiplication will be on the left side of matrix A, as shown in the next slide image. Check that the multiplication of P12 by A will give Matrix A’s exact values. The next step is to check if matrix A’ is invertible or not. Please refer to the next slide to verify this step.

What is P23?

Step Three- Create two elimination matrices, M1 and M2.

To create the elimination matrix M1, we want the value of a21 equal to zero to make the upper matrix. To do this, we will multiply the first row by (-a21/a11) and add it to row 2. The value of the multiplication factor is(+ 1/3).
Similarly, we want the a31 value to be = 0, so we multiply the first row by(-a31/a11 )and add to r3. The multiplication factor is (-1/2).

How to create an upper matrix?

A new matrix will be formed as (6 – 6 7, 0 0 4/3, 0 -5 1/2). the elimination matrix M1 is a 3×3 matrix and it is( 1 0 0,1/3 10,0 0 1), while the second elimination matrix M2 is a 3×3 matrix and it is( 1 0 0,1/3 10, 0 0 1)

Create two elimination matrices M1 and M2

Check the multiplication of m2 by M1 will perform the necessary row operations.

Details of the two elimination matrices.

The elimination matrix will be a (3×3) matrix written as M1 and located at the left of P12.

The M2M1 matrix is ( 1 0 0, 1/3 1 0,-1/2 0 1). We will check that the M2M1 by A’ will lead to matrix B (6 – 6 7, 0 0 4/3, 0 -5 1/2). As we can see, the sequence of operations is considered as A followed to the left by P12 and followed again by M2M1, as we can see in the next slide image.

Check the product of P12by M2M1 by matrix A.

Step Four- Swap between row 2 and row 3.

As we can observe, the second pivot (intersection of row 2 with column 2) is zero, so we can not proceed to complete the U matrix; it is not possible to divide by zero. We will swap row 3 with row 2 and vice versa.

So, we will use permutation matrix P23 to perform this operation. The new matrix will be a 3×3 matrix ( 6 -6 7, 0 -5 1/2, 0 0 4/3). The sequence of operations will be as (P23 M2M1P12*A).

The upper matrix formed in this process is integral to applying LU decomposition-partial pivoting in solving linear systems.

Therefore, mastering LU decomposition- partial pivoting enhances one’s ability to tackle real-world computational challenges effectively.

Step Five- Find the final upper matrix.

Due to the previous operation, the upper matrix is formed as a 3×3 matrix and can be expressed as ( 6 -6 7, 0 -5 1/2, 0 0 4/3). This U matrix is a part of LU decomposition-partial pivoting.

page 9 Swap rows 2 and 3 for matrix B

Check that the multiplication of P23*M1*P12*A) will lead to the new matrix ( 6 -6 7, 0 -5 1/2, 0 0 4/3).

Expression for the upper matrix.

Step Six- Rewrite the u matrix expression and find the value of the lower matrix L.

We will rewrite the upper matrix expression by introducing the identity matrix expression as equal to the product of P23 by P23 the two permutation matrics.

Rewrite the expression of U matrix.

We have the LHS as (P23)*(M2M1P23*P23*P12A) is equal to the RHS U. To get the lower matrix L, which is part of LU decomposition-partial pivoting, we will consider the value of (P23M2M1P23) and divide both sides by this value. The new left side is P23P12A, which equals the inverse of (P23M2M1P23)multiplied by U. Use the expression of PA=LU. We have P = P23P12. The value of L equals the inverse of (P23M2M1P23)

The expression for the lower matrix.

In various applications, LU decomposition- partial pivoting is employed to optimize performance in solving matrix equations.

Three matrices are multiplied by each other for the value of the L matrix (P23*M2M1*P23). We will find that the value of the new matrix is( 1 0 0,1/3 0 1*1/2 1 0). The lower matrix L is the inverse of that matrix, and its value is (1 0 0, 1/2 1 0, -1/3 0 1).

page 13 Post 12 LU partial pivot

Exploring LU decomposition- partial pivoting can benefit those interested in numerical methods.

Step Seven- Check that PA=L*U.

It is better to check as a part of LU decomposition-partial pivoting that the product of PA=LU. We can check that both sides are equal; please refer to the next slide image.

page 14 Post 12 LU partial pivot

The example is quoted from Numerical Methods for Engineers by Jeffry R. Chasnov.

This link to the next post explains how to get x1,x2, and x3 using a Gaussian partial pivot.

Link to Omni calculator-LU Decomposition Calculator.

Another calculator to use is the Calculator for matrices.

error

Enjoy this blog? Please spread the word :)