#6642: problem with solve (from the tutorial)
------------------------+---------------------------------------------------
Reporter: jhpalmieri | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.1
Component: symbolics | Keywords:
Reviewer: | Author:
Merged: |
------------------------+---------------------------------------------------
From [http://groups.google.com/group/sage-
devel/browse_thread/thread/85929d86accdf94d sage-devel]:
{{{
sage: theta = var('theta')
sage: solve(cos(theta)==sin(theta))
}}}
should produce
{{{
[sin(theta) == cos(theta)]
}}}
but instead it produces
{{{
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/palmieri/.sage/temp/Macintosh.local/69786/_Users_palmieri__sage_init_sage_0.py
in <module>()
/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)
478 """
479 try:
--> 480 return f.solve(*args,**kwds)
481 except AttributeError:
482 from sage.symbolic.ring import is_SymbolicVariable
/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression.solve
(sage/symbolic/expression.cpp:21764)()
TypeError: solve() takes at least 1 positional argument (0 given)
}}}
Providing a second argument 'theta' gives another error:
{{{
sage: solve(cos(theta)==sin(theta), theta)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/palmieri/.sage/temp/Macintosh.local/69786/_Users_palmieri__sage_init_sage_0.py
in <module>()
/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)
478 """
479 try:
--> 480 return f.solve(*args,**kwds)
481 except AttributeError:
482 from sage.symbolic.ring import is_SymbolicVariable
/Applications/sage/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression.solve
(sage/symbolic/expression.cpp:22291)()
/Applications/sage/local/lib/python2.6/site-
packages/sage/interfaces/expect.pyc in __call__(self, *args, **kwds)
1380
1381 def __call__(self, *args, **kwds):
-> 1382 return self._obj.parent().function_call(self._name,
[self._obj] + list(args), kwds)
1383
1384 def help(self):
/Applications/sage/local/lib/python2.6/site-
packages/sage/interfaces/expect.pyc in function_call(self, function, args,
kwds)
1288 [s.name() for s in args],
1289 ['%s=%s'%(key,value.name())
for key, value in kwds.items()])
-> 1290 return self.new(s)
1291
1292 def _function_call_string(self, function, args, kwds):
/Applications/sage/local/lib/python2.6/site-
packages/sage/interfaces/expect.pyc in new(self, code)
1084
1085 def new(self, code):
-> 1086 return self(code)
1087
1088
###################################################################
/Applications/sage/local/lib/python2.6/site-
packages/sage/interfaces/expect.pyc in __call__(self, x, name)
1019
1020 if isinstance(x, basestring):
-> 1021 return cls(self, x, name=name)
1022 try:
1023 return self._coerce_from_special_method(x)
/Applications/sage/local/lib/python2.6/site-
packages/sage/interfaces/expect.pyc in __init__(self, parent, value,
is_name, name)
1423 except (TypeError, KeyboardInterrupt, RuntimeError,
ValueError), x:
1424 self._session_number = -1
-> 1425 raise TypeError, x
1426 self._session_number = parent._session_number
1427
TypeError: Error executing code in Maxima
CODE:
sage4 : to_poly_solve(sage0,sage3)$
Maxima ERROR:
Nonalgebraic argument given to 'topoly'
#0: to_poly_solve(e=cos(theta) = sin(theta),vars=theta)(topoly_solver.mac
line 10)
}}}
The first version of this -- {{{solve(cos(theta)==sin(theta))}}} -- is in
the tutorial, and so presumably used to work.
See #6572 for a related ticket which, among other things, tells doctesting
to skip this test in the tutorial. If the underlying problem is solved,
the test in the tutorial should be restored, and of course a test should
be put into the main Sage code illustrating that it now works.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6642>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---