Subject: eivals errors with "part: fell off the end"
From: Barton Willis
Date: Mon, 11 Feb 2013 01:03:23 +0000
This is a bug--no robust function should terminate with "part fell off the end." If you can, please report this bug.
Maxima is only able to find one root of the characteristic polynomial. Maybe the bug is related to that.
A workaround that might be useful:
Download alt_eigen from http://sourceforge.net/apps/phpbb/maxima/viewforum.php?f=3&sid=cbf2bd8bc978703c8c25a18e82afc2ae . Try:
(%i9) load("alt_eigen.mac")$
(%i10) M : genmatrix(lambda([i,j], binomial(i+j-2,j-1)),7,7)$
Substituting each of the six roots of z^6=1274*z^5-63700*z^4+283320*z^3-63700*z^2+1274*z-1 into [matrix([-2*z^4+2506*z^3-87906*...<junk> ] results in an
eigenvector:
(%i11) alt_eigen(M,'var=z);
(%o11) [z^6=1274*z^5-63700*z^4+283320*z^3-63700*z^2+1274*z-1,[matrix([-2*z^4+2506*z^3-87906*z^2-17344*z+140],[-5*z^4+6202*z^3-188552*z^2+71937*z-
714],[-3*z^5+3814*z^4-181370*z^3+624361*z^2-112692*z+1540],[z^5-1284*z^4+75396*z^3-441687*z^2+82722*z-1798],[-10*z^4+10661*z^3-6370*z^2-25568*z+1197],[-7*z^4+5134*z^3+117208*z^2-189*z-430],[-6435*z^3-34398*z^2+1274*z+65])],z=1,[matrix([-6],[-3],[1],[3],[1],[-3],[1])]]
(%i12) [p,v] : [first(%), first(second(%))]$
(%i13) map(lambda([s], subst(s,v)), bfallroots(p)), fpprec : 20;
(%o13) [matrix([1.2574876635652720698b2],[-6.5526112154596401749b2],[1.4482035446669560041b3],[-1.7306053535507924476b3],[1.1760737726747644592b3],[-4.300761717009841431b2],[6.6019461708975639708b1]),matrix([-2.6850417011070932831b2],[7.3040626266362944743b2],[-5.756262334434097987b2],[-2.380535372583672007b2],[6.5057116610417675419b2],[-3.8097803194293172377b2],[7.6475350612171847757b1]),matrix([-7.5830340073751073778b3],[6.1048741233868218782b3],[4.271971787747816324b3],[-3.6047658508556292122b3],[-4.4668354526852661743b3],[4.9570051981534655268b3],[-1.3034048621254445651b3]),matrix([-1.7429090508886696985b6],[-3.1460730554069719964b6],[-3.5673532536855526254b6],[-2.1782186089810490714b6],[8.2319001450052880131b5],[3.0727257517222543262b6],[-1.3986771502580001633b6]),matrix([5.5647854061320168983b7],[2.0702554437212992527b8],[4.7770255364442447398b8],[8.1834196284758837192b8],[1.0447750948708952509b9],[7.5904329978372248406b8],[-7.4540988022260659874b8]),matrix([-1.8385024579221020386b10],[-1.1418709226133598751b11],[-4.2172290919493986511b11],[-1.194014615348813858b12],[-2.856031526350694882b12],[-6.0675691677454864393b12],[-1.1795780645903717086b13])]
If you want numerical solutions, likely this is among the worst way to find them.
Yikes--what's the story with:
(%i16) M : genmatrix(lambda([i,j], binomial(i+j-2,j-1)),15,15)$
(%i17) alt_eigen(M,'var=z);
factor: ran out of primes.
#0: alt_eigen(m=matrix([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[1,3,6,10,15,21,28,36,4...,extra=[var = z])(alt_eigen.mac line 120)
--Barton
________________________________________
From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of andre maute [andre.maute at gmx.de]
Sent: Sunday, February 10, 2013 17:42
To: maxima at math.utexas.edu
Subject: eivals errors with "part: fell off the end"
Hi list,
consider the following code,
---- eivals-bug.mac ----
display2d : false;
load("eigen");
H[i,j] := binomial(i+j-2,j-1);
genmatrix(H,7,7);
eivals(%);
---- eivals-bug.mac ----
which errors with
---- eivals-bug.txt ----
Maxima 5.27.0 http://maxima.sourceforge.net
using Lisp SBCL 1.0.57-1.fc17
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
STYLE-WARNING: redefining MAXIMA::$FILE_TYPE in DEFUN
(%i1) batch(eivals-bug.mac)
read and interpret file: /home/user/eivals-bug.mac
(%i2) display2d : false
(%o2) false
(%i3) load("eigen")
(%o3) "/home/user/opt/maxima/share/maxima/5.27.0/share/matrix/eigen.mac"
(%i4) H[i,j]:=binomial(-2+j+i,j-1)
(%o4) H[i,j]:=binomial(-2+j+i,j-1)
(%i5) genmatrix(H,7,7)
(%o5) matrix([1,1,1,1,1,1,1],[1,2,3,4,5,6,7],[1,3,6,10,15,21,28],
[1,4,10,20,35,56,84],[1,5,15,35,70,126,210],
[1,6,21,56,126,252,462],[1,7,28,84,210,462,924])
(%i6) eivals(%)
part: fell off the end.
-- an error. To debug this try: debugmode(true);
(%o6) "/home/user/eivals-bug.mac"
---- eivals-bug.txt ----
Regards Andre
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima