On Fri, Nov 11, 2011 at 12:11, Andres Cimmarusti <acimmarusti at gmail.com>wrote:
> ...The built-in maxima functions: eigenvalues and eigenvectors
> immediately fail, even when the matrix has all real components. It
> says "solve is unable to find the roots of the characteristic
> polynomial".
>
Maxima is oriented to symbolic, not numerical, calculations. Quintic
polynomials cannot in general be solved symbolically (with the usual
elementary functions). This is why Maxima complains for general 5x5
matrices. On the other hand, if the input is explicitly approximate (using
floating-point numbers), I agree that Maxima should use approximate methods.
The simple workaround is to calculate the characteristic polynomial with
charpoly(matrix,var) and then use a numeric rootfinder on the resulting
polynomial (e.g. allroots). But direct numeric eigenvalue calculation will
be faster and more accurate.
> ... when I tried using 'solve' with this quartic polynomial, maxima just
> couldn't do it.
I suspect that Maxima had no problem doing it, but WxMaxima was unable to
display the result.
...I get warned the expression is too long to display.
Again, this is probably a problem with the WxMaxima front end.
> ...This is a well known quintic polynomial whose roots cannot be obtained
> analytically by any means, but they should be possible, numerically.
>
See above -- solve is explicitly a *symbolic* solver. You can use allroots
or realroots for numerical calculation of roots.
By the way, if your ultimate goal is numerical roots of polynomials
(whether for eigenvalues or other applications), in general it is *not* a
good idea to first calculate the roots symbolically then substitute
floating-point numbers. As a general rule, this will produce less precise
results, sometimes *much* less precise, than using something like realroots
or allroots.
-s