Generalized Eigenvalue in Mathematica
-
30-03-2021 - |
Question
I am trying to solve a generalized eigenvalue problem with Mathematica. I want to find the eigenvalues and eigenvectors of the matrix A with respect to B. But when I use Eigensystem
I receive the following error.
A = {{1, 2, 3}, {3, 6, 8}, {5, 9, 2}}
B = {{3, 5, 7}, {1, 7, 9}, {4, 6, 2}}
Eigensystem[{A, B}]
Eigensystem::exnum: Eigensystem has received a matrix with non-numerical or exact
elements. >>
What should I do?
Solution
Well, as for what you can, you can throw an N[]
there.
As why you get the error you do, I am not sure now. may be someone else knows.
A={{1,2,3},{3,6,8},{5,9,2}};
B={{3,5,7},{1,7,9},{4,6,2}};
Eigensystem[{N@A,N@B}]
Out[48]= {{1.6359272851306594,0.52597489217711,0.011174745769153706},
{{0.0936814383974197,0.7825455672726674,-0.6155048523299302},
{-0.8489102791046691,0.3575364071543101,0.389254486922913},
{0.8701002165041747,-0.4913210011447429,0.03910610020848224}}}
OTHER TIPS
Copying directly from these answers, with invertible matrices you can use this to get exact results as Root
objects:
A = {{1, 2, 3}, {3, 6, 8}, {5, 9, 2}};
B = {{3, 5, 7}, {1, 7, 9}, {4, 6, 2}};
Eigensystem[Inverse[B].A] // RootReduce
{{Root[-1 + 92 #1 - 226 #1^2 + 104 #1^3 &, 3], Root[-1 + 92 #1 - 226 #1^2 + 104 #1^3 &, 2], Root[-1 + 92 #1 - 226 #1^2 + 104 #1^3 &, 1]}, {{Root[-1418 - 9903 #1 - 3824 #1^2 + 192 #1^3 &, 2], Root[-2817 + 627 #1 + 2480 #1^2 + 192 #1^3 &, 2], 1}, {Root[-1418 - 9903 #1 - 3824 #1^2 + 192 #1^3 &, 1], Root[-2817 + 627 #1 + 2480 #1^2 + 192 #1^3 &, 3], 1}, {Root[-1418 - 9903 #1 - 3824 #1^2 + 192 #1^3 &, 3], Root[-2817 + 627 #1 + 2480 #1^2 + 192 #1^3 &, 1], 1}}}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow