PHYCS 3730/6720 Lab Exercise
Reading and references:
Here we practice solving eigenvalue problems using Maple and
Python/numpy. The answer file
is Mylab11.txt. You may use Matlab
instead of Maple if you like.
Use Python in interactive mode and use the numpy.linalg package
to find the eigenvalues and eigenvectors of the matrix
9 3 3
3 2 4
3 4 2
Copy your Python session (with the results) to the answer file.
To check your understanding, use Python (interactive mode) to verify
that the eigenvector for the eigenvalue 12 satifies the eigenvalue
equation: matrix times eigenvector equals eigenvalue times
eigenvector. Copy the new parts of your Python session to the answer
Use Maple (or Matlab) to find the eigenvalues and eigenvectors of the same matrix.
Remember to use with(linalg). The functions eigenvals
and eigenvectors are what you are looking for. Be sure you
understand the output from the eigenvectors function. Copy
your Maple session to your answer file.
You may have noticed that the Maple (or the Matlab) and numpy
eigenvectors are not the same. This happens because the conventions
for normalization may be different. Numpy normalizes the vectors to
unit norm. Maple uses a different normalization. To see that is is
only a matter of normalization, for each of the three eigenvectors,
find the constant that, when it multiplies the Maple eigenvector, the
resulting product matches the Python eigenvector. Do this by copying
the Maple eigenvectors to Python (one-by-one) and using Python to
figure out the normalization constant. In your answer file, for each
eigenvector, show the Maple eigenvector, the constant, the result of
multiplying by the constant, and the Python eigenvector for the sake
Copy the relevant parts of your Python session to the answer file.