Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect limit with ratio of complex exponentials #21756

Closed
oscarbenjamin opened this issue Jul 17, 2021 · 1 comment · Fixed by #21775
Closed

Incorrect limit with ratio of complex exponentials #21756

oscarbenjamin opened this issue Jul 17, 2021 · 1 comment · Fixed by #21775
Labels

Comments

@oscarbenjamin
Copy link
Contributor

From SO:
https://stackoverflow.com/questions/68406242/managing-cases-of-an-expression-containing-positive-integers?noredirect=1#comment120914902_68406242

These limits all give 0 but the correct value is 5:

In [1]: term = (1 - exp(-2*I*pi*z))/(1 - exp(-2*I*pi*z/5))

In [2]: term
Out[2]: 
     -2πz 
1 -          
──────────────
     -2πz 
     ─────────
         5    
1 -          

In [3]: term.limit(z, 0)
Out[3]: 0

In [4]: term.subs(z, 1e-6).n()
Out[4]: 4.99999999997631 - 1.25663706143261e-5

In [5]: re(term).limit(z, 0)
Out[5]: 0

In [6]: abs(term).limit(z, 0)
Out[6]: 0
skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 18, 2021
0sidharth added a commit to 0sidharth/sympy that referenced this issue Jul 25, 2021
0sidharth added a commit to 0sidharth/sympy that referenced this issue Jul 25, 2021
@0sidharth
Copy link
Member

I forgot to add it to the description, but #21775 closes this issue, a test has also been added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants