Professional Documents
Culture Documents
decomposition for
, as well as
, no row interchange would take place if the Gauss Elimination with Partial
we showed in class
2
4
8
6
1
3
7
7
1
3
9
9
0
1 .
5
8
i) [25 points]
Show explicitly what the permutation matrix
, as well as
and
from the first row. Confirm your analytical results using appropriately the same command in MATLAB ("lu").
ii) [5 points]
Show why the triangularization part of the method allows for a simpler calculation of the determinant of .
3. [40 points]
Construct the following subroutines:
i) [25 points]
ii) [10 points]
GEPP
iii)[5 points]
Consider the linear system of equations A
, where
for 1
6 and
1
2
0
.
2
1
1
Apply your GEPP code and find the solution. Verify by using the "\" command in MATLAB.
Remark: Recall that you can only use essential built-in commands in MATLAB such as size, length, zeros, eye and
for/if statements. Any multiplication, needs to be in a component form(i.e. A(i,j)*B(j)). Remember to comment
important lines of your code. Modify the following script to prepare your codes:
i) function [P,L,U]=pplu(A);
[m m]=size(A);
U=A;
L=eye(m);
P=eye(m);
%
%
%
%
for i=1:m-1
%% Begin the Partial Pivoting
.
.
.
.
.
%% Partial Pivoting procedure ends and the triangularization procedure
%% continues
.
.
.
.
.
end