416 CHAPTER 15. NUMERICAL METHODS, EIGENVALUES

If you have Matlab work the above iteration, you get the following for the eigenvectoreigenvalue and number of iterations, and error . 1

.5− .5i−.5i

 , 1+ i, k = 18, 10−5

 0−0.1321+0.1862i−0.1325+0.1863i

In fact, this eigenvector is exactly right as is the eigenvalue 1+ i.

Thus this method will find eigenvalues real or complex along with an eigenvector asso-ciated with the eigenvalue. Note that the characteristic polynomial of the above matrix isλ

3−5λ2 +8λ −6 and the above finds a complex root to this polynomial. More generally,

if you have a polynomial λn + an−1λ

n−1 + · · ·+ a1λ + a0, a matrix which has this as itscharacteristic polynomial is called a companion matrix and you can show a matrix whichworks for this polynomial is of the form

−an−1 −an−2 · · · a0

1 0. . . . . .

1 0

You could use this or the earlier companion matrix described in the material on the rationalcanonical form. Thus this method is capable of finding roots to a polynomial equationwhich are close to a given complex number. Of course there is a problem with determiningwhich number you should pick. A way to determine this will be discussed later. It involvessomething called the QR algorithm.

Example 15.2.1 Find the eigenvalue of A =

 5 −14 11−4 4 −43 6 −3

 which is closest to−7.

Also find an eigenvector which goes with this eigenvalue.

We use the algorithm described above.

a=[5 -14 11;-4 4 -4;3 6 -3]; b=-7; F=inv(a-b*eye(3));S=1; u=[1;1;1]; d=1; k=1;while d >.0001 & k<1000w=F*u; [M,I]=max(abs(w)); T=w(I); u=w/T;d=abs(T-S); S=T; k=k+1;endukb+1/Ta*u-(b+1/T)*u

This yields the following after 8 iterations. 10−1

 , −6