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

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

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

alance<br />

Examples This example shows the basic idea. The matrix A has large elements in the<br />

upper right and small elements in the lower left. It is far from being symmetric.<br />

2-124<br />

A = [1 100 10000; .01 1 100; .0001 .01 1]<br />

A =<br />

1.0e+04 *<br />

0.0001 0.0100 1.0000<br />

0.0000 0.0001 0.0100<br />

0.0000 0.0000 0.0001<br />

Balancing produces a diagonal T matrix with elements that are powers of two<br />

and a balanced matrix B that is closer to symmetric than A.<br />

[T,B] = balance(A)<br />

T =<br />

1.0e+03 *<br />

2.0480 0 0<br />

0 0.0320 0<br />

0 0 0.0003<br />

B =<br />

1.0000 1.5625 1.2207<br />

0.6400 1.0000 0.7813<br />

0.8192 1.2800 1.0000<br />

To see the effect on eigenvectors, first compute the eigenvectors of A.<br />

[V,E] = eig(A); V<br />

V =<br />

-1.0000 0.9999 0.9937<br />

0.0050 0.0100 -0.1120<br />

0.0000 0.0001 0.0010<br />

Note that all three vectors have the first component the largest. This indicates<br />

V is badly conditioned; in fact cond(V) is 8.7766e+003. Next, look at the<br />

eigenvectors of B.<br />

[V,E] = eig(B); V<br />

V =<br />

-0.8873 0.6933 0.0898<br />

0.2839 0.4437 -0.6482<br />

0.3634 0.5679 -0.7561

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

Saved successfully!

Ooh no, something went wrong!