linear algebra - Problem with Eigenvectors when given a matrix containing approximate numbers and symbols
I'm trying to diagonalize a certain 2 x 2 matrix, but Mathematica refuses to find the eigenvectors. In particular, when I input
Eigenvectors[{{1.8741*10^7 + 1.40161*10^6 B, 2.79374*10^7},
{2.79374*10^7, -3.1235*10^7 - 1.40161*10^6 B}}]
(B is a parameter). I receive the error
Eigenvectors::eivec0: Unable to find all eigenvectors
and the bogus output
{{0, 0}, {0, 0}}
On the other hand, Mathematica has no problem with the eigenvalues, for some reason. Can someone help me figure out what's going on here?
Answer
Although the documentation could be clearer on this point, Eigenvectors
doesn't like to work symbolically on a matrix containing elements with approximate numbers. The solution is to Rationalize
the matrix.
data = {{1.8741*10^7 + 1.40161*10^6 B, 2.79374*10^7},
{2.79374*10^7, -3.1235*10^7 - 1.40161*10^6 B}};
Eigenvectors[Rationalize[data]] // Column
Comments
Post a Comment