eqs: [y^2+x^2-(400-400/(2/q+1))^2 = 0,(-y-400/(2/q+1)+400)^2+x^2-640000/(2/q+1)^2 = 0]
solve(eqs,[x,y]) gives correct solution, but solve(subst(sqrt(3),q,eqs),[x,y]) yields []!
A possibly related case:
eqt: [y^2+x^2-1,y^2+(1-sqrt(3))*y+x^2+2]
algsys(eqt,[x,y]) => good solutions
solve(eqt,[x,y]) => []
observed in
Maxima 5.21.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
Setting algebraic to true is *not* a workaround.
Maxima is unable to even solve a triangular form of these equations; of course,
the triangular form may have spurious solutions. This is a high priority bug.
(%i1) algebraic : true$
(%i2) load(to_poly_solver)$
(%i3) eqs: [y^2+x^2-(400-400/(2/q+1))^2 = 0,(-y-400/(2/q+1)+400)^2+x^2-640000/(2/q+1)^2 = 0]$
(%i4) eqs : subst(q = sqrt(3),eqs)$
(%i5) eqs : radcan(ratnumer(eqs));
(%o5) [y^2+x^2+2560000*sqrt(3)-4480000=0,y^2+(1600*sqrt(3)-3200)*y+x^2+5120000*sqrt(3)-8960000=0]
(%i6) eqs : elim(eqs,[y,x]);
(%o6) [[],[4*sqrt(3)*y^2-7*y^2+4000*3^(3/2)*y-20800*y+8960000*sqrt(3)-15520000,y^2+x^2+2560000*sqrt(3)-4480000]]
(%i7) eqs : second(eqs);
(%o7) [4*sqrt(3)*y^2-7*y^2+4000*3^(3/2)*y-20800*y+8960000*sqrt(3)-15520000,y^2+x^2+2560000*sqrt(3)-4480000]
(%i8) solve(eqs,[x,y]);
(%o8) []
(%i9) solve(first(eqs),y);
(%o9) [y=400*sqrt(3)-800]
Just plain solve(eqs) and solve(eqt) work fine.
For what it's worth for debuggers:
Oddly, the problem is not present when the equations are written in a more general form like this one:
But as soon as we insert the numerical value for K, the solutions disappear:
System info:
Maxima 5.36.1
SBCL 1.2.7
Win 8.1 64-bit
Some more IMO interesting info for debuggers:
1) The bug does not occur with the following set of equations:
2) but it does occur with this set of equations:
In the latter case, following things happen:
See the attached screenshot.
Cheers
Last edit: sslavi 2015-06-19
The original issue is fixed by commit [2986fc]. I will leave this open as some of the cases in the previous post aren't resolved.
See [bugs:#3208] for details.
Related
Bugs:
#3208Commit: [2986fc]
Commits [2986fc] and [640ca7] has improved this significantly. Most of the problems above can now be solved. Some problems are too general for algsys, as it needs to know the sign and ordering of some quantities to correctly simplify them.
I will add some of the test cases above to the maxima testsuite in rtest_algsys.mac. They broke some of my "improvements' in interesting ways.
Related
Commit: [2986fc]
Commit: [640ca7]