Octave for Chapter 8

Examples in this section provide sample Octave code for computing eigenvalues. You can access our code through the link at the bottom of each template. Feel free to modify the code and experiment to learn more!

You can write your own code using Octave software or online Octave cells. To access Octave cells online, go to the Sage Math Cell Webpage, select OCTAVE as the language, enter your code, and press EVALUATE.

To ”save” or share your online code, click on the Share button, select Permalink, then copy the address directly from the browser window. You can store this link to access your work later or share this link with others. You will need to get a new Permalink every time you modify the code.

Octave Tutorial

Octave Exercises

Let .
(a)
Use Octave to find the eigenvalues of .
(b)
Find the eigenvalues of . How do they compare?
(c)
Formulate and prove a conjecture about the relationship between the eigenvalues of and the eigenvalues of , where is a constant.
(d)
How do the eigenvectors of compare to the eigenvectors of ? Prove your claim.
Let
(a)
Find the eigenvalues of using Octave. List the eigenvalues below in increasing order.
(b)
By hand, find the corresponding eigenvectors of . List them below.
(c)
Use Octave to find the eigenvectors of . Reconcile your answers from the previous part with the answers you got from Octave.
Use Octave to find the eigenvalues of . Interpret the numbers you are seeing. Interpret your results geometrically.
Let When we use Octave to find the eigenvalues of , we get the following printout.
        ans =
 
 
        16.1168  
        -1.11684  
        -1.30368e-15  
    

Should we interpret the last eigenvalue as , or as a very small non-zero number? How can you be sure of your answer in this particular case?

Modify the code for the Power Method given in The Power Method and the Dominant Eigenvalue to approximate the dominant eigenvalue of . Experiment with the number of iterations. Compare your answer to the answer you get when using the eig function.
2024-10-01 02:16:32