[Maxima] Newbie question about eigenvalues calculating

reyssat eric.reyssat at math.unicaen.fr
Sun Apr 26 14:49:46 CDT 2009

```A polynomial of degree 5 is in general not solvable by radicals, so you
cannot expect maxima (or others) to give exact formulas.
But you may find approximate values using allroots(charpoly(...));

For instance this gives me the eigenvalues for 50 instances of your
matrices in less than one second of computation :

define(B0(m), genmatrix (lambda ([i, j], diff(m^(j-1),m,i-1)/(i-1)!),
5,5))\$
define(B1(m), genmatrix (lambda ([i, j], diff(m^(j+4),m,i-1)/(i-1)!), 5,5))\$
A0(M):= genmatrix (lambda ([i, j], 1.0*sum(k^(i+j+3),k,0,M)), 5,5)\$
A1(M):= genmatrix (lambda ([i, j], 1.0*sum(k^(i+j+8),k,0,M)), 5,5)\$
U(M,m):=B0(m) - B1(m).(invert(A1(M))).A0(M)\$
eigen(M,m):=allroots(charpoly(U(M,m),x))\$
for M:5 thru 9 do for m:1 thru 10 do print(eigen(M,m));

For larger values of m (try M=6, m=15), allroots cannot find all the
roots (might be a problem of precision, some coefficients in the
characteristic polynomial being quite large).

Eric Reyssat

Hiisi a écrit :
> Dear list! I recently installed Maxima for my university studying. I
> study S-splines and have to calculate optimal parameters for them.
> Here's description of the task.
> A0:
> matrix([S5,S6,S7,S8,S9],[S6,S7,S8,S9,S10],[S7,S8,S9,S10,S11],[S8,S9,S10,S11,S12],[S9,S10,S11,S12,S13]);
> A1:
> matrix([S10,S11,S12,S13,S14],[S11,S12,S13,S14,S15],[S12,S13,S14,S15,S16],[S13,S14,S15,S16,S17],[S14,S15,S16,S17,S18]);
> where Si: sum(k^i,k,0,M); and k is a range from 0 to some K; M is a
> number.
> B0:
> matrix([1,m,m^2,m^3,m^4],[0,1,2*m,3*m^2,4*m^3],[0,0,1,3*m,6*m^2],[0,0,0,1,4*m],[0,0,0,0,1]);
> B1:
> matrix([m^5,m^6,m^7,m^8,m^9],[5*m^4,6*m^5,7*m^6,8*m^7,9*m^8],[10*m^3,15*m^4,21*m^5,28*m^6,36*m^7],[10*m^2,20*m^3,35*m^4,56*m^5,84*m^6],[5*m,15*m^2,35*m^3,70*m^4,126*m^5]);
> where m is a number.
> Matrix U is B0 - B1.(invert(A1)).A0;
> The task is to calculate the eigenvalues of U. I need to do it with
> different m and M to find out the best couple. The problem is: I can't
> do it. When I'm trying eigenvalues(U); Maxima is calculating but it
> takes so long time and I didn't saw results yet even when it's been
> running all night. I was trying to calculate eigenvalues of A0 for
> example but received the following error: solve is unable to find the
> roots of the characteristic polynomial. Is it too big or am I doing
> something wrong?
> Thanks for Re:!
>
> --
> Hiisi.
> Registered Linux User #487982. Be counted at: http://counter.li.org/
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>

```