"William Stein" <[EMAIL PROTECTED]> writes:

> On 9/1/07, Nikos Apostolakis <[EMAIL PROTECTED]> wrote:
>> 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
>


Great! Thanks, that solves my original question.

>
>> 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?
>

I asked in the maxima list and it seems that it's inertia, "the weight
of history" as Rober Dodier put it.  They are considering to set
this switch to 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.
>

That would be nice.  Doing 
"sage.calculus.calculus.maxima.eval('tlimswitch:true')"
is a bit awkward. 

Thanks,
Nikos 


--~--~---------~--~----~------------~-------~--~----~
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