28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

P Row permutation matrix satisfying the equation L*U = P*X, or<br />

L*U = P*X*Q. Used for numerical stability.<br />

Q Column permutation matrix satisfying the equation P*X*Q = L*U.<br />

Used to reduce fill-in in the sparse case.<br />

Examples Example 1. Start with<br />

A = [ 1 2 3<br />

4 5 6<br />

7 8 0 ];<br />

To see the LU factorization, call lu with two output arguments.<br />

[L1,U] = lu(A)<br />

L1 =<br />

0.1429 1.0000 0<br />

0.5714 0.5000 1.0000<br />

1.0000 0 0<br />

U =<br />

7.0000 8.0000 0<br />

0 0.8571 3.0000<br />

0 0 4.5000<br />

Notice that L1 is a permutation of a lower triangular matrix: if you switch rows<br />

2 and 3, and then switch rows 1 and 2, the resulting matrix is lower triangular<br />

and has 1s on the diagonal. Notice also that U is upper triangular. To check that<br />

the factorization does its job, compute the product<br />

L1*U<br />

which returns the original A. The inverse of the example matrix, X = inv(A),<br />

is actually computed from the inverses of the triangular factors<br />

X = inv(U)*inv(L1)<br />

Using three arguments on the left side to get the permutation matrix as well<br />

[L2,U,P] = lu(A)<br />

lu<br />

2-1389

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!