#2038 Elementary Algsys/Solve bug

open
nobody
7
2015-06-19
2010-07-24
No

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]) => []

Related

Bugs: #3208

Discussion

  • Stavros Macrakis

    observed in
    Maxima 5.21.1 http://maxima.sourceforge.net
    using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)

     
  • Barton Willis

    Barton Willis - 2010-07-24

    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]

     
  • Stavros Macrakis

    Just plain solve(eqs) and solve(eqt) work fine.

     
  • sslavi

    sslavi - 2015-06-19

    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:

    (%i1) eq: [y^2+x^2-1,y^2+k*y+x^2+a]$
    solve(eq,[x,y]);
    (%o1) [[x=-sqrt(k^2-a^2-2*a-1)/k,y=-(a+1)/k],[x=sqrt(k^2-a^2-2*a-1)/k,y=-(a+1)/k]]

    But as soon as we insert the numerical value for K, the solutions disappear:

    (%i2) k:1-sqrt(3)$
    solve(eq,[x,y]);
    (%o2) []

    System info:
    Maxima 5.36.1
    SBCL 1.2.7
    Win 8.1 64-bit

     
  • sslavi

    sslavi - 2015-06-19

    Some more IMO interesting info for debuggers:
    1) The bug does not occur with the following set of equations:

    y^2+x^2-a=0
    y^2+x^2+k*x+b=0

    2) but it does occur with this set of equations:

    y^2+x^2-a=0
    y^2+x^2+k*y+b=0

    In the latter case, following things happen:

    1) When k is substituted with a numerical value of the form sqrt(number), the problem does not occur and a set of numerical solutions are found.

    2) When k is substituted with a symbolic expression of the form sqrt(C), the problem does not occur and a set of symbolic solutions are found.

    3) When k is substituted with a numerical value of the form number+sqrt(number) Maxima returns a void set.

    4) When k is substituted with a symbolic expression of the form B+sqrt(C) Maxima hangs.

    See the attached screenshot.

    Cheers

     
    Last edit: sslavi 2015-06-19

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks