Search for question
Question

Problem Description: This problem has four parts. Develop one MATLAB function which outputs the solutions of all parts.

(1) Solve the following system of equations using LU factorization with partial pivoting.

2x1 - 6x2- x3 = 40

-3x1 - 1x2 + 6x3 = 20

-8x1 + x₂ - 2x3 = 50

Output the lower triangular matrix L, the upper triangular matrix U, the permutation matrix P, the intermediate solution vector d (see Chapra Sec. 10.2.1: Step 2.), and the final

solution vector x.

Hint: You may use the MATLAB function [L.U.P] = lu(A), which returns lower triangular matrix L., upper triangular matrix U, and permutation matrix P so that P*A= L*U.

2) Evaluate the inverse invA of the matrix of the coefficients A using LU decomposition. Output also the intermediate matrix D=LIP.

3) Evaluate the determinant of A using the LU factors. Output also the determinant of the permutation matrix det(P).

4) Evaluate the condition number using the Frobenius norm of both the matrix A and its inverse invA you have evaluated above.