fix or workaround for resultant bug
- Subject: fix or workaround for resultant bug
- From: Barton Willis
- Date: Tue, 28 Jul 2009 11:32:16 -0500
Too often, I'm getting a "quotient is not exact" error from algsys. The
resultant
function seems to be the troublemaker. Maybe the problem is that the
polynomials
have algebraic coefficients. I've tried several values for resultant and
algebraic.
No luck. These (ugly) equations are generated by an odelin extension.
Can anybody suggest a fix or workaround?
(%i357) p : [658952*%xo^3+((-1776*sqrt(37)-9647)*((1776*sqrt(37)-9647)^
(1/3))^2+82369*(1776*sqrt(37)-9647)^(1/3)+4036081)*%xo^2+
((-7104*sqrt(37)-38588)*((1776*sqrt(37)-9647)^(1/3))^2+329476*(1776*sqrt
(37)-9647)^(1/3)+6260044)*%xo+(-7104*sqrt(37)-38588)*((1776*sqrt(37)-9647)^
(1/3))^2+329476*
(1776*sqrt(37)-9647)^(1/3)+5601092,((1776*sqrt(37)+9647)*((1776*sqrt
(37)-9647)^(1/3))^2-82369*(1776*sqrt(37)-9647)^(1/3)-4036081)*%xo^2+
((14208*sqrt(37)+77176)*((1776*sqrt(37)-9647)^(1/3))^2-658952*(1776*sqrt
(37)-9647)^(1/3)-12520088)*%xo+(21312*sqrt(37)+115764)*((1776*sqrt
(37)-9647)^(1/3))^2-988428*
(1776*sqrt(37)-9647)^(1/3)-16803276,%xo]$
(%i358) (resultant : 'subres, algebraic : true)$
(%i359) apply('resultant, p);
quotient is not exact
(%i360) (resultant : 'red, algebraic : true)$
(%i361) apply('resultant, p);
quotient is not exact
Barton
-----maxima-bounces at math.utexas.edu wrote: -----
>To:?Maxima?Mailing?List?<maxima at math.utexas.edu>
>From:?Robert?Dodier?<robert.dodier at gmail.com>
>Sent?by:?maxima-bounces at math.utexas.edu
>Date:?07/28/2009?12:42AM
>Subject:?[Maxima]?patch?for?eigenvector?to?consider
>
>Hello,
>
>I'm?pondering?the?following?patch,?which?attempts?to?make?the
>output?of?the?eigenvectors?function?more?comprehensible?when
>there?are?multiple?eigenvectors?for?the?same?eigenvalue.
>However,?it?makes?the?output?somewhat?clumsier?when?there
>is?just?1?eigenvector?per?eigenvalue,?a?common?special?case.
>
>Examples.?(Sorry?for?the?messy?output.)
>
>(%i1)?M1?:?matrix?([0,?1,?0,?0],?[0,?0,?0,?0],?[0,?0,?2,?0],?[0,?0,?0,
>2]);
>?????????????????????????[?0??1??0??0?]
>?????????????????????????[????????????]
>?????????????????????????[?0??0??0??0?]
>(%o1)????????????????????[????????????]
>?????????????????????????[?0??0??2??0?]
>?????????????????????????[????????????]
>?????????????????????????[?0??0??0??2?]
>(%i2)?[vals,?vecs]?:?eigenvectors?(M1);
>(%o2)?[[[0,?2],?[2,?2]],?[[[1,?0,?0,?0]],
>???????????????????????????????????[[0,?0,?1,?0],?[0,?0,?0,?1]]]]
>(%i3)?for?i?thru?length?(vals[1])?do?disp?(val[i]?=?vals[1][i],
>mult[i]?=vals[2][i],?vec[i]=vecs[i]);
>????????????????????????????val??=?0
>???????????????????????????????1
>
>????????????????????????????mult??=?2
>????????????????????????????????1
>
>??????????????????????vec??=?[[1,?0,?0,?0]]
>?????????????????????????1
>
>????????????????????????????val??=?2
>???????????????????????????????2
>
>????????????????????????????mult??=?2
>????????????????????????????????2
>
>???????????????vec??=?[[0,?0,?1,?0],?[0,?0,?0,?1]]
>??????????????????2
>
>(%o3)?????????????????????????done
>(%i4)?M2?:?matrix?([1,?0,?0,?0],?[0,?2,?0,?0],?[0,?0,?3,?0],?[0,?0,?0,
>4]);
>?????????????????????????[?1??0??0??0?]
>?????????????????????????[????????????]
>?????????????????????????[?0??2??0??0?]
>(%o4)????????????????????[????????????]
>?????????????????????????[?0??0??3??0?]
>?????????????????????????[????????????]
>?????????????????????????[?0??0??0??4?]
>(%i5)?[vals,?vecs]?:?eigenvectors?(M2);
>(%o5)?[[[1,?2,?3,?4],?[1,?1,?1,?1]],
>[[[1,?0,?0,?0]],?[[0,?1,?0,?0]],?[[0,?0,?1,?0]],?[[0,?0,?0,?1]]]]
>(%i6)?for?i?thru?length?(vals[1])?do?disp?(val[i]?=?vals[1][i],
>mult[i]?=vals[2][i],?vec[i]=vecs[i]);
>????????????????????????????val??=?1
>???????????????????????????????1
>
>????????????????????????????mult??=?1
>????????????????????????????????1
>
>??????????????????????vec??=?[[1,?0,?0,?0]]
>?????????????????????????1
>
>????????????????????????????val??=?2
>???????????????????????????????2
>
>????????????????????????????mult??=?1
>????????????????????????????????2
>
>??????????????????????vec??=?[[0,?1,?0,?0]]
>?????????????????????????2
>
>????????????????????????????val??=?3
>???????????????????????????????3
>
>????????????????????????????mult??=?1
>????????????????????????????????3
>
>??????????????????????vec??=?[[0,?0,?1,?0]]
>?????????????????????????3
>
>????????????????????????????val??=?4
>???????????????????????????????4
>
>????????????????????????????mult??=?1
>????????????????????????????????4
>
>??????????????????????vec??=?[[0,?0,?0,?1]]
>?????????????????????????4
>
>(%o6)?????????????????????????done
>
>
>I'm?inclined?to?apply?the?patch?because?without?it,?the?output
>is?pretty?much?incomprehensible?when?there?are?multiple
>eigenvectors?per?eigenvalue.?Yes?/?no?/?maybe???
>
>Thanks?for?your?comments.
>
>Robert?Dodier
>
>PS.
>diff?-u?-r1.4?eigen.mac
>---?share/matrix/eigen.mac??22?Nov?2007?17:11:14?-0000??1.4
>+++?share/matrix/eigen.mac??28?Jul?2009?05:21:34?-0000
>@@?-114,7?+114,7?@@
>????????unknowns:endcons(concat(notknwn,index1),unknowns),
>????????vectr:columnvector(unknowns),matrx:mat.vectr,
>????????nondiagonalizable:false,
>-???????listall:[eigvals],realonly:false,algebraic:true,
>+???????eigvecs:[],realonly:false,algebraic:true,
>????????for?index1?thru?count?do
>????????(count:mi(count-part(multiplicities,index1)+1),
>????????mmatrx:matrx-part(eigvals,1,index1)*vectr,
>@@?-132,8?+132,8?@@
>????????(print("?"),print("algsys?failure:?the?eigenvector(s)?for?the",
>????????index1,"th?eigenvalue?will?be?missing.")),
>????????if?hermitianmatrix?and?%rnum>1?then?unit:gramschmidt(unit),
>-???????listall:append(listall,unit)),
>-???????return(listall)))$
>+???????eigvecs:append(eigvecs,[unit])),
>+???????return([eigvals,?eigvecs])))$
>
>
>?/*?the?first?arg?is?of?the?form?[r1,r2,r3].
>_______________________________________________
>Maxima?mailing?list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima