Question: Problem 1 (8 points) Implement in Matlab the following functions (2 points each). In the first three functions, you are not allowed to use the

 Problem 1 (8 points) Implement in Matlab the following functions (2

Problem 1 (8 points) Implement in Matlab the following functions (2 points each). In the first three functions, you are not allowed to use the lu function and the backslash operator. function [L, U, P] = lu-pp (A) %[L, U,P] = lu-pp (A) computes a unit lower triangular matriu L, %an upper triangular matris U, and a permutation matris p such that %P+A = L*U. %The LU factorization is computed using partial pivoting. function [L, U, P] = lu_spp (A) %[L, U,P] = lu_spp (A) computes a unit lower triangular matris L, %an upper triangular matris U, and a permutation matris P such that %P+A = L*U. %The LU factorization is computed using scaled partial pivoting function x = lu_solve (L,U,b) %Solves LUx=b by solving Ly=b and then Ux=y. %Lis unit lower triangular, U is upper triangular function (xm, XPP, Xspp] = solve all (A,b) % Solves a linear system A*2 = b using Matlab's lu and %lu-pp and lu_spp. %Returns %2m = Alb %upp solution computed using lu-pp and lu_solve | % spp solution computed using lu_spp and lu_sovle For this problem, we will investigate the errors in the computed solutions by solve_all. As a reference solution, we use a vector of ones. That is, for a given matrix A, if r = (1,1,..., 1)", we compute b= A*r and then solve Ar = b. If t is the computed solution, the error is 1-and the residual is 16 - Afl. Problem 1 (8 points) Implement in Matlab the following functions (2 points each). In the first three functions, you are not allowed to use the lu function and the backslash operator. function [L, U, P] = lu-pp (A) %[L, U,P] = lu-pp (A) computes a unit lower triangular matriu L, %an upper triangular matris U, and a permutation matris p such that %P+A = L*U. %The LU factorization is computed using partial pivoting. function [L, U, P] = lu_spp (A) %[L, U,P] = lu_spp (A) computes a unit lower triangular matris L, %an upper triangular matris U, and a permutation matris P such that %P+A = L*U. %The LU factorization is computed using scaled partial pivoting function x = lu_solve (L,U,b) %Solves LUx=b by solving Ly=b and then Ux=y. %Lis unit lower triangular, U is upper triangular function (xm, XPP, Xspp] = solve all (A,b) % Solves a linear system A*2 = b using Matlab's lu and %lu-pp and lu_spp. %Returns %2m = Alb %upp solution computed using lu-pp and lu_solve | % spp solution computed using lu_spp and lu_sovle For this problem, we will investigate the errors in the computed solutions by solve_all. As a reference solution, we use a vector of ones. That is, for a given matrix A, if r = (1,1,..., 1)", we compute b= A*r and then solve Ar = b. If t is the computed solution, the error is 1-and the residual is 16 - Afl

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!