5
$\begingroup$

I am trying to calculate eigenvalues of a sparse matrix with only two distinct non-zero elements, here Alpha and Beta, which are both negative reals. Mathematica returns some complex expressions with Root[] values when using the Eigenvalues[] command on the following matrixA:

In all cases the matrices are symmetric and real and hence have real eigenvalues.

matrixA={
        {α, β, 0, 0, 0, 0, β, 0, 0, β},
        {β, α, β, 0, 0, 0, 0, 0, 0, 0},
        {0, β, α, β, 0, 0, 0, 0, 0, 0},
        {0, 0, β, α, β, 0, 0, 0, 0, 0},
        {0, 0, 0, β, α, β, 0, 0, 0, 0},
        {0, 0, 0, 0, β, α, β, 0, 0, 0},
        {β, 0, 0, 0, 0, β, α, β, 0, 0},
        {0, 0, 0, 0, 0, 0, β, α, β, 0},
        {0, 0, 0, 0, 0, 0, 0, β, α, β},
        {β, 0, 0, 0, 0, 0, 0, 0, β, α}
        }

For comparison, with all the other similar matrices I've tried (see below e.g. matrixB) Mathematica will put out simple decimal approximations (using Eigenvalues[matrixB] // N // Simplify)

Can anyone point out a way to get expressions for the matrixA as simple as for matrixB?

And yes, the desired simple answers for matrixA do exist, I can get them with other programs, but I want to use Mathematica!


I should add that I already have already used $Assumptions = α<0 && β <0 at the top of my worksheet.

matrixB={
        {α, β, 0, 0, 0, 0, 0, 0, 0, β},
        {β, α, β, 0, 0, 0, 0, 0, 0, 0},
        {0, β, α, β, 0, 0, 0, β, 0, 0},
        {0, 0, β, α, β, 0, 0, 0, 0, 0},
        {0, 0, 0, β, α, β, 0, 0, 0, 0},
        {0, 0, 0, 0, β, α, β, 0, 0, 0},
        {0, 0, 0, 0, 0, β, α, β, 0, 0},
        {0, 0, β, 0, 0, 0, β, α, β, 0},
        {0, 0, 0, 0, 0, 0, 0, β, α, β},
        {β, 0, 0, 0, 0, 0, 0, 0, β, α}
        }
$\endgroup$
1
  • $\begingroup$ You don't need the //N for matrixB: there is an analytical solution. If the highest power of the eigenvalues for matrixA is higher than those for matrixB, they won't be "as simple". $\endgroup$
    – Verbeia
    Commented Mar 4, 2012 at 22:54

3 Answers 3

12
$\begingroup$

The reason why you can't get a simple expression for eigenvalues is that the characterisitc polynomial of matrixA is not factorizable (in general) to lower order polynomials, unlike for matrixB.

CharacteristicPolynomial[matrixA, x] // Factor

enter image description here

CharacteristicPolynomial[matrixB, x] // Factor

enter image description here

There is no general method of solving sixth order polynomial equations, unlike for forth order ones. In general, you can still simplify a bit the expression for eigenvalues of matrixA adding an option Quartics -> True to Eigenvalues :

Eigenvalues[matrixA, Quartics -> True]

enter image description here

$\endgroup$
4
  • $\begingroup$ Very interesting, thanks for the thorough explanation I should have known of. I'm still looking for numerical approximations, though. I have other software that gives the results, but I don't know how to replicate that in Mathematica. $\endgroup$ Commented Mar 5, 2012 at 7:47
  • $\begingroup$ @WilliamKennerly Can you post the result that the other software gives you? $\endgroup$
    – rm -rf
    Commented Mar 5, 2012 at 7:59
  • $\begingroup$ @R.M Here you go. The answers are in the form (\Alpha - C\Beta), with the 10 values of C: -2.310 -1.652 -1.356 -0.887 -0.477 0.400 0.738 1.579 1.869 2.095 I'm sure that program is just doing a straight numerical diagonalization, say with LAPACK... so is there some way to get Mathematica to do that? $\endgroup$ Commented Mar 6, 2012 at 0:40
  • $\begingroup$ I doubt this is really correct in general, it would be if the associated Galois group of the characteristic polynomial is solvable, which is not the case here. I suppose there is an implicit assumption of solvability of the group, this could be true only for special values of alpha and beta. Look for example mathworld.wolfram.com/QuinticEquation.html $\endgroup$
    – Artes
    Commented Mar 7, 2012 at 1:06
8
$\begingroup$

Well, I figured out how the other programs do get numeric answers. Of course the trick is to eliminate the symbols. Since matrixA is so simply structured it can be massaged into a non-symbolic form, calculate numerically the eigenvalues of that, and then unmassage them to recover the symbolic eigenvalues. Divide the whole matrix by β then "re-zero" the main diagonal to α/β.

For reference,

reducedmatrixA=({
      {0, 1, 0, 0, 0, 0, 1, 0, 0, 1},
      {1, 0, 1, 0, 0, 0, 0, 0, 0, 0},
      {0, 1, 0, 1, 0, 0, 0, 0, 0, 0},
      {0, 0, 1, 0, 1, 0, 0, 0, 0, 0},
      {0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
      {0, 0, 0, 0, 1, 0, 1, 0, 0, 0},
      {1, 0, 0, 0, 0, 1, 0, 1, 0, 0},
      {0, 0, 0, 0, 0, 0, 1, 0, 1, 0},
      {0, 0, 0, 0, 0, 0, 0, 1, 0, 1},
      {1, 0, 0, 0, 0, 0, 0, 0, 1, 0}
     } )

numericeigenvalues = Sort[Eigenvalues[reducedmatrixA] // Simplify // N]
symboliceigenvalues = α + β numericeigenvalues

does the trick. Thanks everyone for your pointers on the algebra.

$\endgroup$
1
  • 2
    $\begingroup$ If all you want is the approximate numerical values, it is a lot quicker to calculate Sort[Eigenvalues[reducedmatrixA // N]] than Sort[Eigenvalues[reducedmatrixA] // Simplify // N] $\endgroup$
    – Simon
    Commented Mar 27, 2012 at 1:48
5
$\begingroup$

Presumably those other systems are making some assumptions about the values of α and β, which Mathematica does not. Mathematica's symbolic engine does not assume that symbols represent real-valued quantities.

You can probably get some simplification using the Assuming construct or the Assumptions option to Simplify and FullSimplify, like this:

FullSimplify[Eigenvalues[matrixA], 
 Assumptions -> {Element[α, Reals], Element[β, Reals]}]

Or even:

FullSimplify[Eigenvalues[matrixA], 
 Assumptions -> {α > 0, β > 0}]

The latter simplifies the first eigenvalue to:

α - 1/4 (1 + Sqrt[5] + Sqrt[2 (11 + Sqrt[5])]) β

However, some of the others are still higher-order expressions represented by Root expressions.

$\endgroup$
1
  • $\begingroup$ Thanks! I should have thought of FullSimplify[]... that gets 4 out of 10 of numerical approximations to the eigenvalues. So not all the way there yet. However I should have originally said that I do run the command $Assumptions=\[Alpha]<0 && \[Beta] <0 before I do any of the eigenvalue calculations. $\endgroup$ Commented Mar 5, 2012 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.