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

Fails to NIntegrate where removable singularities are present #72

Open
archisman-panigrahi opened this issue Nov 17, 2021 · 3 comments
Open

Comments

@archisman-panigrahi
Copy link

archisman-panigrahi commented Nov 17, 2021

I am trying to NIntegrate the function Sin[x]/x between -1 and 1. It has a removable singularity at x = 0. However, mathics shows General::ovfl: Overflow occurred in computation.
However, the numerical integral works when I try to integrate from -0.5 to 1 (i.e., when the absolute value of the limits are not equal).
I am using the AUR package in Manjaro.

$ mathics

Mathics 4.0.0
on CPython 3.9.7 (default, Aug 31 2021, 13:28:12) 
using SymPy 1.9, mpmath 1.2.1, numpy 1.21.2, cython 0.29.24

Copyright (C) 2011-2021 The Mathics Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by evaluating Quit[] or by pressing CONTROL-D.

In[1]:= NIntegrate[Sin[x]/x,{x,-1,1}]
General::ovfl: Overflow occurred in computation.
Out[1]= Overflow[]

In[2]:= NIntegrate[Sin[x]/x,{x,-0.5,1}]
Out[2]= 1.43919

In[3]:= NIntegrate[Sin[x]/x,{x,-Infinity,Infinity}]
General::ovfl: Overflow occurred in computation.
Out[3]= Overflow[]

@archisman-panigrahi archisman-panigrahi changed the title Fails to NIntegrate and Integrate where removable singularities are present Fails to NIntegrate where removable singularities are present Nov 17, 2021
@TiagoCavalcante
Copy link
Contributor

TiagoCavalcante commented Nov 29, 2021

@apandada1 NIntegrate[Sin[x]/x, {x, -1.000000001, 1.}] strangely works, which makes me think this is SymPy related (the ovfl message is only raised twice, on an OverflowError and on a SymPy error).

@TiagoCavalcante
Copy link
Contributor

@apandada1 I think this is related to mathics/Mathics #1501, maybe installing scipy (if it isn't installed) solves your problem.

@archisman-panigrahi
Copy link
Author

scipy is already installed.

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

No branches or pull requests

2 participants