Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. (Applying LU and LUP decompositions, 16pt) In this problem, we'll use the LU/LUP decomposition to solve a linear system of equations. a) [4pt]
3. (Applying LU and LUP decompositions, 16pt) In this problem, we'll use the LU/LUP decomposition to solve a linear system of equations. a) [4pt] For A [11-15-13 -13 5;14 -8 16 -3 -17;-14 1 16 14 12;14 16 -1 10 15;4 16 10 16 6] ; find matrices P, L, and U so that PA = LU using Matlab's lu function. Based on your results: did Matlab use pivoting during the lu-computation? b) [5pt] For b = [-49;1;40;79:92] solve Ax = b using the LU decomposition as follows. Solving Ax = b is the same as solving PAX = Pb. (With P from a). Since PA = LU, we need to solve LUX = Pb, and we can split that into two triangular systems as follows: = Ly Pb, and Ux = y. Solve both of these systems using Matlab's linsolve, and state x and y explicitly. Hint: which one do you need to solve first? Remember what you have, and what you need. c) [2pt] Compare the quality of the x you found in b to the solution of Ax = b you get from using linsolve by comparing the differences Ax - b. d) [1pt] You want so solve Ax = b for more than one vector b, so you collect the b-vectors into a single matrix B. Your goal then is to find a matrix X so that AX = B (one column x in X for each column b in B). (Check: If A is an mxn matrix, and B is a kxp matrix, what are the dimensions of X?) For B [3-15-19 20 16 -27;-22 19 -15 5 15 2;-21 -16 7 3 -7 17;-15 26 -2 25 4 26:21 -9 -9 -13 -26 -23] solve AX = B using linsolve, and check that AX = B in Matlab. Hint: linsolve(A,B) works. e) [4pt] We now want to solve AX = B (with A from part a, and B from part d) using the LUP decomposition from parts a/b. Solving AX = B is the same as solving PAX = PB, so, as earlier, we can split this into two triangular systems: LY PB and UX = Y. Solve these two equations using Matlab's linsolve. First find Y in LY = PB, and then use that to find X in UX Y. Check that AX - B is close to the zero matrix.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started