3.1 (12/25) LU decomposition Perform LU decomposition on matrix A by implementing your own function (lu) based on following pseudocode. Please validate your final solution by using ||LU – PA||F, which...


3.1 (12/25) LU decomposition Perform LU decomposition on matrix A by implementing your<br>own function (lu) based on following pseudocode. Please validate your final solution by using<br>||LU – PA||F, which should be a small value (for this problem, e < 10-6).<br>Algorithm 1 LU Decomposition with Partial Pivoting<br>Input: U + A, L + I, P + I<br>DI is the identity matrix<br>1: for k = 1:n – 1 do<br>Find i > k to maximize |U(i, k)|<br>U(k, k : n) + U (i, k : n)<br>L(k, 1: k) + L(i, 1 : k)<br>P(k, :) + P(i, :)<br>for j = k +1:n do<br>L(j, k) = U (j, k)/U(k, k)<br>U(j, k : n) = U(j, k : n) – L(j, k)U(k, k : n)<br>end for<br>Dn is the number of rows of A<br>-<br>2:<br>3:<br>D switching specified elements<br>4:<br>5:<br>6:<br>7:<br>8:<br>9:<br>10: end for<br>11: return P, L,U<br>

Extracted text: 3.1 (12/25) LU decomposition Perform LU decomposition on matrix A by implementing your own function (lu) based on following pseudocode. Please validate your final solution by using ||LU – PA||F, which should be a small value (for this problem, e < 10-6).="" algorithm="" 1="" lu="" decomposition="" with="" partial="" pivoting="" input:="" u="" +="" a,="" l="" +="" i,="" p="" +="" i="" di="" is="" the="" identity="" matrix="" 1:="" for="" k="1:n" –="" 1="" do="" find="" i=""> k to maximize |U(i, k)| U(k, k : n) + U (i, k : n) L(k, 1: k) + L(i, 1 : k) P(k, :) + P(i, :) for j = k +1:n do L(j, k) = U (j, k)/U(k, k) U(j, k : n) = U(j, k : n) – L(j, k)U(k, k : n) end for Dn is the number of rows of A - 2: 3: D switching specified elements 4: 5: 6: 7: 8: 9: 10: end for 11: return P, L,U

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here