

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Project for Math 2605
Implementing the QR method This project is concerned with the QR algorithm applied to the problem of finding one eigenvector of a matrix. You may do it using Maple, MATLAB, or Java. You may do this project only if you also do the project on the power method. The QR algorithm is the power method in disguise. Does the disguise work better in practice? The aim of this project is to investigate this. If we run the QR iteration, say, 10 steps and produce A(10), this will upper triangular only if there are large separations between all of the eigenvalues. And the first column of U (1)^ will be a good approximate eigenvector of A only if the largest eigenvalue (in absolute value) is much larger than the second. In general, we won’t be so lucky, so we have to shift
|Au − (u · Au)u| < (1)
where is our tolerance level. For purposes of this project, take = 10−^8. If so, we are done. If not, we shift by the upper left entry of A(10), which will be c = u · Au. That is, replace A by (A − cI)−^1 , and go back to the beginning with this new A. If the first column of A(10)^ is not nearly zero below the first entry, let B be the 2 × 2 matrix in the upper left. Since B is 2 × 2, finding these eigenvalues is easy. Compute the eigenvalues of B, and let c be one of these eigenvalues – either the largest one if they are both real, or the one with the positive imaginary part if the are a complex conjugate pair. Replace A by (A − cI)−^1 , and go back to the beginning with this new A. Extra credit: In your write up, explain why this is a good thing to do. As before, once you have made a complex shift, you will be working in Cn, not Rn, and from this point forward, you must replace (1) by
|Au − 〈u, Au〉u| < (2)
and you should now use 〈u, Au〉 as the value to shift by. Keep running this loop until either (2) or (1) is satisfied, depending on whether you made a complex shift or not. How well does this work? To examine this, generate 10 random 6 × 6 matrices. Say how you generate them
1
(1) Does it work for all 10 of your matrices?
(2) How many times did you get a complex eigenvector and eigenvalue?
(3) How much shifting did you have to do? Keep track of what you shifted by in each case. Which example required the most shifts? Which required the fewest?
(4) Try replacing 10 QR iterations with some other number of iterations. How does this affect the efficiency of the method. Can you suggest some optimal policy for choosing the number based on your experience?
(5) Compare results with what you found using the power method au natural.
It will probably be most convenient to do the project up to here using Maple or MATLAB. The following optional extra credit part should be done in Java. This will give more than the usual extra credit. If you do both parts below, it counts as an entire second project. However, the second part can only be done one – for either this project, or the one on the power method. (This one is recommended if you want to do it for one).
Write an applet that uses your package to find eigenvectors. For still more extra credit:
You may wish to display the real and complex parts of T and U separately.