compute eigenvalues numerically



Andres Cimmarusti <acimmarusti at gmail.com> writes:

> Dear maxima users,
>
> I've been working on some calculations that eventually lead to a 5x5
> matrix, whose components can be complex. The next step is to calculate
> the eigenvalues and possibly the eigenvectors.
>
> 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".
>
> I looked at "dgeev" which uses lapack, and it worked superbly when the
> matrix components are real, but gave me errors when they were complex,
> as expected. Sadly dgeev only works for integers and floating point.

Try mnewton:

(%i2) load('mnewton);
(%o2)
     /home/work/maxima/sandbox/maxima-current-release/share/contrib/mnewton.mac
(%i3) mnewton([z^5-z-1],[z],[1]);
(%o3)                      [[z = 1.167303978261419]]
(%i4) subst(%,z^5-z-1);
(%o4)                        4.440892098500626e-16
(%i5) mnewton([z^5-z-1],[z],[1+%i]);
(%o5)          [[z = .3524715460317263 %i - .7648844336005847]]
(%i6) subst(%,z^5-z-1);
                                                                         5
(%o6) - .3524715460317263 %i + (.3524715460317263 %i -
.7648844336005847)
                                                            -
                                                            .2351155663994153
(%i7) expand(%);
(%o7)          1.110223024625157e-16 - 2.220446049250313e-16 %i
(%i8)


Leo

>
> Is there any other tool/function that will compute these things
> numerically? I deally I would want to later plot each eigenvalue as a
> function of one or two parameters.
> Perhaps maxima is not the appropriate tool to do this anymore (my
> original hope was to compute things analytically, but that's pretty
> much out the window now).. care to suggest a good way to go?
>
> As an additional thing, in an earlier stage of my work (which proved
> wrong), I was able to reduce the characteristic polynomial to a 4th
> order equation. Wikipedia says, analytical solutions are possible
> (http://en.wikipedia.org/wiki/Quartic_function#Summary_of_Ferrari.27s_method)
> through something known as the Ferrari's method. However, when I tried
> using 'solve' with this quartic polynomial, maxima just couldn't do
> it. After many minutes, maxima simply crashed...(it was disconnected
> from WxMaxima)
>
> I have to say that the coefficients of the polynomial were quite
> lengthy, but I feel it should have worked...Naturally when I try a
> general quartic polynomial like listed in the wikipedia article,
> things work fine, though I get warned the expression is too long to
> display. What are the limitations here?...it really is just a lot of
> algebra...
>
> Now, in the case of quintic polynomials, which brings me back to my
> original question, 'solve' can't even do this:
>
> solve( z^5 -z -1 = 0 , z);
>
> This is a well known quintic polynomial whose roots cannot be obtained
> analytically by any means, but they should be possible, numerically.
> Is there a way to get the roots using solve or other tool in maxima?
> if so, can I "instruct" eigenvalues / eigenvectors to use this instead
> of plain solve?
>
> I'm using Maxima 5.21.1 on Debian Squeeze. GCL 2.6.7
>
> Thanks for your input
>
> Andres
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>

-- 
Leo Butler                      leo.butler at member.ams.org
SDF Public Access UNIX System -   http://sdf.lonestar.org