Search code examples
linear-algebranumerical-methodssymbolic-matheigenvectormupad

How to Calculate Eigenvectors in MuPAD


I am using the Mupad computer algebra system in an attempt to calculate the Eigenvectors of a 3 X 3 matrix called A.

A := matrix([[3, 2, 1], [1, 3, 2], [0, 2, 6]]);

There seems to be two ways of doing this.

One calculates it using the linear algebra package:

export(linalg);
float(eigenvectors(A));

Whilst the other calculates it numerically:

numeric::eigenvectors(A)

I wont post the results of these operations as the output runs lines at a time.

My question is, using either of these methods doesn't seem to cleanly output what the actual eigenvector(s) is/are and when I compare the results to online calculators, such as here and here, the MuPAD answers dont equate to online resources

Am I calculating the eigenvectors correctly?


Solution

  • MuPAD does provide the same correct answers as provided in the links. The answer given by MuPAD using the command numeric::eigenvectors(A) gives:

        --
    |
    |
    |  [7.201472338, 3.545095909, 1.253431753],
    |
    |
    --
    
       +-                                            -+
       |  0.4097274422,  0.8600709534,  0.6400029533  |
       |                                              |
       |  0.4697503463,  0.3955281264, -0.7080821139  |,
       |                                              |
       |  0.7819578219, -0.3222350949,  0.2983553915  |
       +-                                            -+
    
                                                           --
                                                            |
                                                            |
       [1.423012071e-13, 3.657216627e-15, 2.253544688e-12]  |
                                                            |
                                                            |
                                                           --
    

    The first sub matrix of the matrix provides the eigenvalues. The second sub matrix of the matrix provides the associated eigenvectors. Comparing this to the links, we see that the eigenvalues are the same and the associated eigenvectors look different:

    enter image description here

    Although the Eigenvectors are different, upon closer inspection we see that the only difference is their lengths and not their direction. MuPAD normalises the Eigenvectors (equates their length to 1) prior to displaying output, whereas the links provided sets the last component of the Eigenvector to 1. Whilst the length of the Eigenvector is not of interest, its direction is, and therefore, the choice of length is a matter of preference or convention.