Generalised Eigenvalue Problem in Mathematica

Click For Summary
SUMMARY

The discussion addresses the computation of eigenvalues for a generalized eigenvalue problem in Mathematica, specifically using the command Eigenvalues[{A,B}]. Users encountered an error due to non-numerical or exact elements in the matrices A and B. A solution involves modifying the matrix entries to include machine precision values, such as adding decimal points. Alternatively, users can compute eigenvalues using Eigenvalues[Inverse[B].A] or by calculating the characteristic polynomial det(A - x B)=0.

PREREQUISITES
  • Understanding of generalized eigenvalue problems
  • Familiarity with Mathematica version 12.0 or later
  • Knowledge of matrix operations and properties
  • Basic concepts of symbolic computation
NEXT STEPS
  • Learn how to use Eigenvalues with symbolic matrices in Mathematica
  • Explore the computation of characteristic polynomials in Mathematica
  • Research the implications of using machine precision versus exact numbers in numerical computations
  • Investigate the adjugate matrix and its applications in eigenvalue problems
USEFUL FOR

Mathematicians, researchers in numerical analysis, and users of Mathematica who are solving generalized eigenvalue problems with symbolic matrices.

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 2 ·
Replies
2
Views
4K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K