(note, I am not on the sage list or gms list, so this probably won't
make it there unless someone forwards it)

SymPy's limit primarily uses the Gruntz algorithm, which is fairly
capable. I'm not an expert on it, so others will be able to comment in
more detail, but as far as I know, it's mostly reliant on the ability
to compute series expansions, which SymPy has built up quite a bit.
Computing series expansions and limits with this algorithm was one of
the first things SymPy was able to do when Ondrej created it back in
2005 (IIRC), so it's fairly developed. I believe the algorithm has
some difficulties with expressions with trigonometric functions (but
again, others should comment on that).

What algorithms does Maxima implement? Does Sage generally only use
one backend or can it also use fallback mechanisms. SymPy should
generally raise NotImplementedError (or maybe another error if there
is a bug) if it can't compute a limit.

Aaron Meurer


On Sun, Nov 22, 2015 at 6:42 PM, William Stein <wst...@gmail.com> wrote:
> This definitely looks like a bug.  In the meantime, a workaround is to
> use sympy:
>
> sage: var('m a0')
> (m, a0)
> sage: x=2/5*((3/4)^m - 1)*(a0 - 1000000) + 1/5*(3*(3/4)^m + 2)*a0;x
> 2/5*((3/4)^m - 1)*(a0 - 1000000) + 1/5*(3*(3/4)^m + 2)*a0
> sage: limit(x, m=oo)
> [BAD]
> sage: limit(x, m=oo, algorithm='sympy')
> 4000000
>
> I wonder -- to what extent should we be using maxima by default still
> for limits, instead of sympy...?  At some point, presumably sympy will
> be uniformly better than maxima?
>
> Public worksheet:
>
> https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2015-11-22-163829-limit.sagews
>
> On Sun, Nov 22, 2015 at 2:00 PM, David Joyner <wdjoy...@gmail.com> wrote:
>> Forwarded to the correct list
>>
>> ---------- Forwarded message ----------
>> From: G. M.-S. <lists....@gmail.com>
>> Date: Sun, Nov 22, 2015 at 4:34 PM
>> Subject: [sage-release] Bug in limit?
>> To: sage-rele...@googlegroups.com
>>
>>
>>
>> Hello.
>>
>> This is my first post, please be indulgent.
>>
>> Is the following a bug?
>>
>> Thanks in advance.
>>
>> Guillermo Moreno-Socías
>>
>> ┌────────────────────────────────────────────────────────────────────┐
>> │ SageMath Version 6.9, Release Date: 2015-10-10                     │
>> │ Type "notebook()" for the browser-based notebook interface.        │
>> │ Type "help()" for help.                                            │
>> └────────────────────────────────────────────────────────────────────┘
>> sage: var('m a0')
>> (m, a0)
>> sage: x=2/5*((3/4)^m - 1)*(a0 - 1000000) + 1/5*(3*(3/4)^m + 2)*a0;x
>> 2/5*((3/4)^m - 1)*(a0 - 1000000) + 1/5*(3*(3/4)^m + 2)*a0
>> sage: limit(x,m=oo)
>>
>> ;;;
>> ;;; Detected access to protected memory, also kwown as 'bus or
>> segmentation fault'.
>> ;;; Jumping to the outermost toplevel prompt
>> ;;;
>>
>> (Note that if x is expanded then the limit is correctly calculated.)
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "sage-release" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to sage-release+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-rele...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-release.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-support@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> William (http://wstein.org)
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CACLE5GAujsLOsoVfxQ2qxiydnYYRJsaEX_r9Efiw2LhUZC3V%3Dw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to