On 9/1/07, Nikos Apostolakis <[EMAIL PROTECTED]> wrote:
> > 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,
>                                                          ^^^^^^^^^^^
>
> This is a typo.  The name of the variable is "tlimswitch" and
> according to the documentation when it's true, "it causes the
> limit package to use Taylor series when possible."  Maxima can
> calculate many more limits that way.  For example:

Thanks for pointing that out.
> However:
>
> In [3]: maxima.eval('tlimswitch:true')
> Out[3]: 'true'
>
> In [35]: limit( sqrt(x^2+x+1)+x, x = -oo)
> [...] Error maxima asks questions
>
> From what I understand this is not the expected behavior.

No, this is exactly the expected behavior.    If you want to affect
the instance of Maxima that is used for calculus computations in SAGE,
you have to pass a command to that one, as indicated below:

sage: import sage.calculus.calculus
sage: sage.calculus.calculus.maxima.eval('tlimswitch:true')
'true'
sage: limit( (tan(sin(x)) - sin(tan(x)))/x^7, x=0)
1/30


> A workaround could be to pass 'tlimit' to maxima instead of
> 'limit'.  According to maxima documentation "tlimit" returns the
> result of limit with 'tlimswitch' set to true.
>
> BTW, how can I see (from the sage command line) the code for limit?
> When I give "limit?" I get
>
> def limit(f, dir=None, **argv):
> "[...]"
>     if not isinstance(f, SymbolicExpression):
>         f = SR(f)
>     return f.limit(dir=dir, **argv)
>
> But where can I see the definition of f.limit?

Type f.limit? and f.limit??:

sage: f =  (tan(sin(x)) - sin(tan(x)))/x^7
sage: f.limit?
<docs>
sage: f.limit??
<source code>

I'm interested in changing SAGE to use tlimswitch:true by default.
However, before I do that, I would like to know why Maxima sets
tlimswitch to false by default?  Does tlimswitch:true give incorrect
results in lots of interesting cases?  Or is it slower?   Or is it just inertia
that causes maxima to not have tlimswitch:true by default?

In all cases I'm certainly OK with add an option to the SAGE limit command
that uses tlimit instead of limit.

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
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/
-~----------~----~----~----~------~----~------~--~---

Reply via email to