Hi!
On 27 Okt., 21:49, Mikie <[email protected]> wrote:
> ... I have tried maxima.'integrate(x,x) and
> many other combinations but they all produce a syntax error. How do I
> do it in Sage?
The fact that you tried this shows that you need to convince yourself
that Sage's underlying language is Python.
' has a special meaning in Python: It is one string delimiter. Hence,
if you start typing
maxima.'inte
then Python expects that you started a string after the dot, but you
don't finish it. Error. So, maxima.'integrate(x,x) can impossibly
work.
But ' is not the only string delimiter. There is ", which must not be
mixed with '. In a string delimited with ", you can use ' as a normal
character, and vice versa. This is why William's example session
works.
By the way, here is a different example session. It is a bit nasty,
since it uses Python's getattr and some background knowledge of how
the __getattr__ method of the pexpect interfaces in Sage work:
sage: x=sage.calculus.calculus.maxima('x') # define x in the
calculus version of the maxima interface
sage: f = getattr(x,"'integrate")(x) # the nasty bit
sage: g = SR(f) # continue as in William's example
sage: g
integrate(x, x)
sage: sage_eval(str(g),globals())
x^2/2
Cheers,
Simon
--~--~---------~--~----~------------~-------~--~----~
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
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---