23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

icg<br />

2-150<br />

[L1,U1] = luinc(A,1e-5);<br />

Warning: Incomplete upper triangular factor has 1 zero diagonal.<br />

It cannot be used as a preconditioner for an iterative<br />

method.<br />

nnz(A)<br />

ans =<br />

nnz(L1)<br />

ans =<br />

nnz(U1)<br />

ans =<br />

1887<br />

5562<br />

4320<br />

The zero on the main diagonal of the upper triangular U1 indicates that U1 is<br />

singular. If you try to use it as a preconditioner,<br />

[x,flag,relres,iter,resvec] = bicg(A,b,1e-6,20,L1,U1)<br />

flag =<br />

relres =<br />

iter =<br />

resvec =<br />

2<br />

1<br />

0<br />

7.0557e+005<br />

the method fails in the very first iteration when it tries to solve a system of<br />

equations involving the singular U1 using backslash. bicg is forced to return<br />

the initial estimate since no other iterates were produced.<br />

Try again with a slightly less sparse preconditioner.<br />

[L2,U2] = luinc(A,1e-6)<br />

nnz(L2)<br />

ans =<br />

nnz(U2)<br />

ans =<br />

6231

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

Saved successfully!

Ooh no, something went wrong!