15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 Sparse Matrices<br />

Functions for Iterative Methods for Sparse Systems (Continued)<br />

Function<br />

qmr<br />

symmlq<br />

Method<br />

Quasiminimal residual<br />

Symmetric LQ<br />

These methods are designed to solve Ax = b or min b – Ax . For the<br />

Preconditioned Conjugate Gradient method, pcg, A must be a symmetric,<br />

positive definite matrix. minres and symmlq can be used on symmetric<br />

indefinite matrices. For lsqr, the matrix need not be square. The other five can<br />

handle nonsymmetric, square matrices.<br />

All nine methods can make use <strong>of</strong> preconditioners. The linear system<br />

Ax<br />

=<br />

b<br />

is replaced by the equivalent system<br />

M – 1 Ax = M – 1 b<br />

The preconditioner M is chosen to accelerate convergence <strong>of</strong> the iterative<br />

method. In many cases, the preconditioners occur naturally in the<br />

mathematical model. A partial differential equation with variable coefficients<br />

may be approximated by one with constant coefficients, for example.<br />

Incomplete matrix factorizations may be used in the absence <strong>of</strong> natural<br />

preconditioners.<br />

The five-point finite difference approximation to Laplace's equation on a<br />

square, two-dimensional domain provides an example. The following<br />

statements use the preconditioned conjugate gradient method preconditioner<br />

M = R'*R, where R is the incomplete Cholesky factor <strong>of</strong> A.<br />

A = delsq(numgrid('S',50));<br />

b = ones(size(A,1),1);<br />

tol = 1.e-3;<br />

maxit = 10;<br />

R = cholinc(A,tol);<br />

[x,flag,err,iter,res] = pcg(A,b,tol,maxit,R',R);<br />

Only four iterations are required to achieve the prescribed accuracy.<br />

6-38

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

Saved successfully!

Ooh no, something went wrong!