(%i169) p1:-x*y^3+y^2+x^4-9*x/8$
(%i170) p2:y^4-x^3*y-9*y/8+x^2$
(%i180) algsys([p1,p2],[x,y]);
(%o180) [[x = 1/2,y = 1],[x = 9/8,y = 9/8],[x = 1,y = 1/2],[x = 0,y = 0]]
the system seems to have 4 (real) solutions.
`? algsys' says:
...
The method is as follows:
(1) First the equations are factored and split into subsystems.
(2) For each subsystem <S_i>, an equation <E> and a variable <x>
are selected. The variable is chosen to have lowest nonzero
degree. Then the resultant of <E> and <E_j> with respect to <x>
is computed for each of the remaining equations <E_j> in the
subsystem <S_i>. This yields a new subsystem <S_i'> in one fewer
variables, as <x> has been eliminated. The process now returns to
(1).
...
so `algsys' uses the resultant of the two polynomial with respect to x or y. i do this by hand:
(%i184) factor(resultant(p1,p2,x));
(%o184) 4096*(y-1)*y*(2*y-1)*(8*y-9)*(y^2+y+1)*(4*y^2+2*y+1)*(64*y^2+72*y+81)
(resultant with respect to x gives a similar result)
this gives 6 additional solution for y that can be found by sove. if i substitute such an y in the original polyomial the resulting polynomials in x have degree 4 and are also solvable. why don't `algsys' or `solve' don't find these solution?
Logged In: YES
user_id=895922
Originator: NO
Here is a workaround for your equations; the workaround might help in general:
(%i34) load(grobner)$
Loading maxima-grobner $Revision: 1.2 $ $Date: 2006/11/08 03:40:02 $
(%i35) p1:-x*y^3+y^2+x^4-9*x/8$
(%i36) p2:y^4-x^3*y-9*y/8+x^2$
(%i37) eqs : map('ratnumer, [p1,p2])$
(%i38) eqs : poly_reduced_grobner(eqs,[x,y])$
(%i39) algsys(eqs,[x,y]);
(%o39) [[x=0,y=0],[x=1,y=1/2],[x=9/8,y=9/8],[x=1/2,y=1],[x=(sqrt(3)*%i-1)/4,y=-(sqrt(3)*%i+1)/2],[x=-
(sqrt(3)*%i+1)/4,y=(sqrt(3)*%i-1)/2],[x=(9*sqrt(3)*%i-9)/16,y=-(9*sqrt(3)*%i+9)/16],[x=-(9*sqrt(3)*%i+9)/16,y=(9*sqrt(3)*%i-9)/16],[x=(sqrt(3)*%i-1)/2,y=-
(sqrt(3)*%i+1)/4],[x=-(sqrt(3)*%i+1)/2,y=(sqrt(3)*%i-1)/4]]
Commit [2986fc], which fixed a number of algsys bugs - see [bugs:#3208] - has made this worse. I think this is due to heap overflow in radcan called from function EBAKSUBST1. My changes didn't cause this, but they did allow the solution to procede to the point of failure.
Related
Bugs:
#3208Commit: [2986fc]
Commit [640ca7] has fixed the crash. Still only the 4 real solutions.
Related
Commit: [640ca7]
I have traced this and looked at one missed solution manually. The others are similar.
algsys:
1. decided to eliminate x and solve for y. Reasonable.
2. calculates resultant(eq,eq2,y) and solves for y to find 4 real roots and 3 complex conjugate pairs.
3. correctly finds solutions for the 4 real roots for y
4. fails for the 6 complex roots roots for y
For each complex root y, algsys
1. substitutes y into eq1 and eq2
2. calculates the resultant == 0 to confirm a solution exists
3. solves a cubic polynomial for x, giving messy roots
4. fails to confirm the the (x,y) pair is a solution as the symbolic calculation explodes.
There are a number of opportunities for improvement. It may be desirable to
1. issue a warning about missed roots when the resultant==0 but no corresponding solution is found.
2. check constant expressions numerically to see if they are close to zero
3. convert "messy" roots to floats if appropriate. algsys already returns numerical roots in certain circumstances.
4. rectform can blow out the expression size a lot. A check on this would be prudent. (Done in commit [e49d61])
Related
Commit: [e49d61]
Last edit: David Billinghurst 2016-10-08
A reduced test case, isolated from the transcript above, is:
Last edit: David Billinghurst 2016-10-07
(%i1) p1:-xy^3+y^2+x^4-9x/8$
p2:y^4-x^3y-9y/8+x^2$
(%i3) p3:eliminate([p1,p2],[y])[1];
(%o3) 4096x(4096x^9-10440x^6+7073*x^3-729)
(%i4) sols:solve([p1,p2,p3],[x,y]);
(%o4) [[x=0,y=0],[x=1/2,y=1],[x=9/8,y=9/8],[x=1,y=1/2],[x=(sqrt(3)%i-1)/2,y=-(sqrt(3)%i+1)/4],[x=-(sqrt(3)%i+1)/2,y=(sqrt(3)%i-1)/4],[x=(3^(5/2)%i-9)/16,y=-(3^(5/2)%i+9)/16],[x=-(3^(5/2)%i+9)/16,y=(3^(5/2)%i-9)/16],[x=(sqrt(3)%i-1)/4,y=-(sqrt(3)%i+1)/2],[x=-(sqrt(3)%i+1)/4,y=(sqrt(3)%i-1)/2]]
(%i5) length(%);
(%o5) 10
Test:
(%i6) for k thru 10 do
(subst(sols[k],[p1,p2]),expand(%%),print(%%));
[0,0]
[0,0]
[0,0]
[0,0]
[0,0]
[0,0]
[0,0]
[0,0]
[0,0]
[0,0]
(%o6) done