Mathematica Generalised Eigenvalue Problem in Mathematica

Click For Summary
The discussion revolves around solving a generalized eigenvalue problem in Mathematica, where users encounter an error due to non-numerical or exact elements in the matrices A and B. The command Eigenvalues[{A,B}] fails when both matrices contain exact integers or rationals, while introducing decimal points resolves the issue. An alternative approach suggested is to use Eigenvalues[Inverse[B].A], which accommodates symbolic entries but may be slower. Additionally, calculating the characteristic polynomial det(A - x B)=0 is recommended as a viable method. The thread highlights a gap in Mathematica's documentation regarding the handling of exact numbers in generalized eigenvalue problems.
Hootenanny
Staff Emeritus
Science Advisor
Gold Member
Messages
9,621
Reaction score
9
I have a generalised eigenvalue problem of the form

A\boldsymbol{u} = \lambda B\boldsymbol{u}\;,

where A and B are symmetric matrices with real symbolic entries. I'm trying to compute the eigenvalues with Mathematica using the command

Code:
Eigenvalues[{A,B}]

which according to the documentation should work. However, when I do, Mathematica returns the following error

Code:
Eigenvalues::exnum: Eigenvalues has received a matrix with non-numerical or exact elements.

The documentation is of no help. Does anyone have any suggestions?
 
Physics news on Phys.org
This
Eigenvalues[{{{1, 2}, {4, 3}}, {{5, 6}, {4, 3}}}]
fails.

This
Eigenvalues[{{{1, 2}, {4, 3}}, {{5, 6}, {4, 3.}}}]
succeeds. Note that lone ".' means that at least one machine precision value shows up in every calculation and thus not all items are exact.

Is it possible that all the entries you have are exact integers or rationals or complex?

Toss in a few decimal points or add 0. to few entries and see if your error message disappears.
 
Since you want to do the calculation with symbolic entries, try

Code:
Eigenvalues[Inverse[ B].A]

It's a little bit slower for real, nonexact matrices - but it will work for matrices with symbolic entries.

Of course, it might be better if you calculate the adjugate instead of the inverse (dividing by the determinant is unnecessary).

Or even just calculate the characteristic polynomial det(A - x B)=0 and solve for x.

I'm not sure why the generalized eigenvector command in Mathematica only works for non-exact (complex) numbers. http://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix#Generalized_eigenvalue_problem". You'd think that this would at least get a mention in the "Possible Issues" section...
 
Last edited by a moderator:

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
2
Views
2K