# Generalised Eigenvalue Problem in Mathematica

1. Sep 11, 2011

### Hootenanny

Staff Emeritus
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 (Text):
Eigenvalues[{A,B}]
which according to the documentation should work. However, when I do, Mathematica returns the following error

Code (Text):
Eigenvalues::exnum: Eigenvalues has received a matrix with non-numerical or exact elements.
The documentation is of no help. Does anyone have any suggestions?

2. Sep 11, 2011

### Bill Simpson

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.

3. Sep 11, 2011

### Simon_Tyler

Since you want to do the calculation with symbolic entries, try

Code (Text):
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: Apr 26, 2017