#2558 to_poly_solve hangs

None
open
nobody
5
2013-07-17
2013-03-04
Jean-Yves
No

Hi,

When doing "to_poly_solve(6*cos(2*x+1)*(sin(2*x+1))^2,x)" Maxima hangs. Build_info is: build_info("5.28.0-2","2012-08-27 23:16:48","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8").

Best regards,

Jean-Yves

Discussion

  • Robert Dodier
    Robert Dodier
    2013-05-24

    • labels: --> Lisp Core - Solving equations
     
  • Robert Dodier
    Robert Dodier
    2013-05-24

    Not observed in recent Maxima versions. Here's what I get:

    (%i1) e : 6*cos(2*x+1)*(sin(2*x+1))^2 $
    (%i2) load (to_poly_solve);
    Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
    WARNING: DEFUN/DEFMACRO: redefining macro OPAPPLY in /usr/share/maxima/5.30.0/share/fourier_elim/fourier_elim.lisp, was defined in
             /usr/share/maxima/5.30.0/share/to_poly_solve/to_poly.lisp
    WARNING: DEFUN/DEFMACRO: redefining macro OPCONS in /usr/share/maxima/5.30.0/share/fourier_elim/fourier_elim.lisp, was defined in
             /home/robert/tmp/rpmbuild/BUILD/maxima-5.30.0/src/binary-clisp/nummod.fas
    (%o2)   /usr/share/maxima/5.30.0/share/to_poly_solve/to_poly_solve.mac
    (%i3) display2d : false $  
    (%i4) to_poly_solve (e, x);
    (%o4) %union([x = (2*%pi*%z1+%pi-2)/4],
                 [x = -(%i*(log((cos(1)^4/((sin(1)^2-cos(1)^2)^2
                                          +4*cos(1)^2*sin(1)^2)
                                 -sin(1)^4/((sin(1)^2-cos(1)^2)^2
                                           +4*cos(1)^2*sin(1)^2))
                                 ^2
                                 +(-2*cos(1)*sin(1)^3
                                  /((sin(1)^2-cos(1)^2)^2+4*cos(1)^2*sin(1)^2)
                                  -2*cos(1)^3*sin(1)
                                   /((sin(1)^2-cos(1)^2)^2+4*cos(1)^2*sin(1)^2))
                                  ^2)
                           /2
                           +%i*(atan((-2*cos(1)*sin(1)^3
                                      /((sin(1)^2-cos(1)^2)^2+4*cos(1)^2*sin(1)^2)
                                      -2*cos(1)^3*sin(1)
                                       /((sin(1)^2-cos(1)^2)^2
                                        +4*cos(1)^2*sin(1)^2))
                                      /(-sin(1)^2*(sin(1)^2-cos(1)^2)
                                       /((sin(1)^2-cos(1)^2)^2
                                        +4*cos(1)^2*sin(1)^2)
                                       -cos(1)^2*(sin(1)^2-cos(1)^2)
                                        /((sin(1)^2-cos(1)^2)^2
                                         +4*cos(1)^2*sin(1)^2)))
                               -%pi))
                    -2*%pi*%z8)
                    /4])
    (%i5) expand (float (%));
    (%o5) %union([x = 1.570796326794897*%z1+.2853981633974483],
                 [x = 1.570796326794897*%z8-2.775557561562891E-17*%i-0.5])
    (%i6) subst (x=(2*%pi*%z1+%pi-2)/4, e);
    (%o6) 6*cos((2*%pi*%z1+%pi-2)/2+1)*sin((2*%pi*%z1+%pi-2)/2+1)^2
    (%i7) expand (%);
    (%o7) 0
    (%i8) subst (x = %pi/2 * %z8 - 1/2, e);
    (%o8) 6*cos(2*(%pi*%z8/2-1/2)+1)*sin(2*(%pi*%z8/2-1/2)+1)^2
    (%i9) expand (%);
    (%o9) 0
    

    Maxima version: "5.30.0"
    Maxima build date: "2013-04-02 12:22:12"
    Host type: "i486-pc-linux-gnu"
    Lisp implementation type: "CLISP"
    Lisp implementation version: "2.49 (2010-07-07) (built 3517450627) (memory 3573919336)"

     
  • Jean-Yves
    Jean-Yves
    2013-07-17

    I confirm it is working fine with Maxima 5.30.0 (sorry for the delay: it took me some time to find an up to date Windows version). By the way, Maxima is a great tool! Thanks a lot for bringing it to the community! I installed it on a small web site (www.lovemaths.fr) aimed at doing automatic studies of functions (to ease students' life).

    Best regards,

    Jean-Yves