On 9/1/07, Nikos Apostolakis <[EMAIL PROTECTED]> wrote:
>
> Hello group,
>
> how can we pass global variables to the maxima process that sage is
> using? For example in maxima I can do the following
>
> (%i25) tlimswitch : true;
> (%o25) true
> (%i26) limit(sqrt(x^2 + x +1) + x, x, minf);
> 1
> (%o26) - -
> 2
>
> to calculate a limit that without this switch, maxima has hard time
> calculating. Is it posible to do this in sage? I tried
>
> maxima('tlimswitch : true')
> maxima.eval('tlimswitch : true')
>
> but neither worked.
>
> BTW, it may be a good idea to have this switch on by default in
> sage.
Unfortunately, in maxima 5.13 (which is included in SAGE-2.8.3), maxima
insists on interacting when doing that limit even with timeswitch:true,
and completely ignores assumptions on the variable which should
preclude interaction:
[EMAIL PROTECTED]:~$ sage -maxima
Maxima 5.13.0 http://maxima.sourceforge.net
Using Lisp CLISP 2.41 (2006-10-13)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
This is a development version of Maxima. The function bug_report()
provides bug reporting information.
(%i1) timeswitch:true;
(%o1) true
(%i2) limit(sqrt(x^2 + x +1) + x, x, minf);
Is x positive or negative?
positive
;
1
(%o2) - -
2
(%i3) assume(x>0);
(%o3) [x > 0]
(%i4) limit(sqrt(x^2 + x +1) + x, x, minf);
Is x positive or negative?
positive
;
1
(%o4) - -
2
(%i5)
-------------
Back to your question, doing
maxima.eval('timeswitch:true')
does set that variable in that maxima session:
sage: maxima.eval('timeswitch:true')
'true'
sage: maxima.eval('assume(x>0)')
'[x>0]'
sage: maxima.eval('limit(sqrt(x^2 + x +1) + x, x, minf)')
Traceback (most recent call last):
...
ValueError: Computation failed since Maxima requested additional
constraints (use assume):
Is x positive or negative?
-------
Note that the SAGE calculus package uses a different private copy
of maxima, which you can get at as follows:
sage: import sage.calculus.calculus
sage: sage.calculus.calculus.maxima
Maxima
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---