#13773: maxima solve output parser insufficient
-------------------------+--------------------------------------------------
   Reporter:  vbraun     |             Owner:  burcin  
       Type:  defect     |            Status:  new     
   Priority:  major      |         Milestone:  sage-5.6
  Component:  symbolics  |          Keywords:          
Work issues:             |   Report Upstream:  N/A     
  Reviewers:             |           Authors:          
  Merged in:             |      Dependencies:          
   Stopgaps:             |  
-------------------------+--------------------------------------------------
 As reported in https://groups.google.com/d/topic/sage-
 support/gNPCG3Zbfjg/discussion
 {{{
 sage: var('r theta psi x y z')
 (r, theta, psi, x, y, z)
 sage: (r,theta,psi,x,y,z)
 (r, theta, psi, x, y, z)
 sage: e1 = r == +sqrt(x^2+y^2+z^2)
 sage: e2 = theta == arccos(z/sqrt(x^2+y^2+z^2))
 sage: e3 = psi == arctan(y/x)
 sage: solve([e1,e2,e3],x,y,z)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /home/vbraun/opt/sage-5.5.rc0/devel/sage-main/<ipython console> in
 <module>()

 /home/vbraun/opt/sage-5.5.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)
     751             s = []
     752
 --> 753     sol_list = string_to_list_of_solutions(repr(s))
     754
     755     # Relaxed form suggested by Mike Hansen (#8553):

 /home/vbraun/opt/sage-5.5.rc0/local/lib/python2.7/site-
 packages/sage/symbolic/relation.pyc in string_to_list_of_solutions(s)
     455     from sage.structure.sequence import Sequence
     456     from sage.calculus.calculus import
 symbolic_expression_from_maxima_string
 --> 457     v = symbolic_expression_from_maxima_string(s, equals_sub=True)
     458     return Sequence(v, universe=Objects(), cr_str=True)
     459

 /home/vbraun/opt/sage-5.5.rc0/local/lib/python2.7/site-
 packages/sage/calculus/calculus.pyc in
 symbolic_expression_from_maxima_string(x, equals_sub, maxima)
    1789         return symbolic_expression_from_string(s, syms,
 accept_sequence=True)
    1790     except SyntaxError:
 -> 1791         raise TypeError, "unable to make sense of Maxima
 expression '%s' in Sage"%s
    1792     finally:
    1793         is_simplified = False

 TypeError: unable to make sense of Maxima expression
 
'[If(and(-pi/2<parg(-r),-pi/2<parg(r),parg(-r)<==pi/2,parg(r)<==pi/2,-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==-tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==-r*cos(theta)],union()),If(and(-pi/2<parg(-r),-pi/2<parg(r),parg(-r)<==pi/2,parg(r)<==pi/2,r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==-r*cos(theta)],union()),If(and(-pi/2<parg(r),parg(r)<==pi/2,-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==-r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==-tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==r*cos(theta)],union()),If(and(-pi/2<parg(r),parg(r)<==pi/2,r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))!=0,sqrt(r^2*(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1))+r^2*cos(theta)^2+tan(psi)^2*r^2*(1-cos(theta))*(cos(theta)+1)/(tan(psi)^2+1))!=0),[x==r*sqrt(1/(tan(psi)^2+1)-cos(theta)^2/(tan(psi)^2+1)),y==tan(psi)*r*sqrt(1-cos(theta))*sqrt(cos(theta)+1)/sqrt(tan(psi)^2+1),z==r*cos(theta)],union())]'
 in Sage
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13773>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to