You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a highly oscillatory function that I'd like to integrate on an interval. The function has been omitted as it's quite complicated, but it's a single variable vectorized function.
Running
import quadpy
import mpmath as mp
from scipy.integrate import quad
print("Scipy:")
print(quad(i,0,6,limit=5000,complex_func=True))
print("Mpmath:")
print(mp.fp.quad(i,np.linspace(0,6,1500), error=True))
print("Quadpy:")
print(quadpy.quad(i,0,6, limit=5000))
Scipy and mpmath agree with each other quite well, but I have pretty much no idea how to make quadpy work. I'm not even sure if it's a bug, it may well be that both scipy and mpmath are wrong. All I know is that on every subinterval they agree, while quadpy doesn't seem to be consistent with itself between different schemes.
I've tried quadpy.c1.integrate_adaptive(i,(0,6),minimum_interval_length=6/100000) and combinations of various schemes and degrees. I know that Gauss-Legendre quadrature is used for this function, so I've spent most of my time with that but to no avail.
All of the above holds if I reduce the endpoint of the interval to 6/100 or 6/1000, where the function is much less oscillatory.
I realize this isn't reproducible without the original function, but I was hoping there are some options that I'm missing.
The text was updated successfully, but these errors were encountered:
I have a highly oscillatory function that I'd like to integrate on an interval. The function has been omitted as it's quite complicated, but it's a single variable vectorized function.
Running
returns
Scipy and mpmath agree with each other quite well, but I have pretty much no idea how to make quadpy work. I'm not even sure if it's a bug, it may well be that both scipy and mpmath are wrong. All I know is that on every subinterval they agree, while quadpy doesn't seem to be consistent with itself between different schemes.
I've tried
quadpy.c1.integrate_adaptive(i,(0,6),minimum_interval_length=6/100000)
and combinations of various schemes and degrees. I know that Gauss-Legendre quadrature is used for this function, so I've spent most of my time with that but to no avail.All of the above holds if I reduce the endpoint of the interval to 6/100 or 6/1000, where the function is much less oscillatory.
I realize this isn't reproducible without the original function, but I was hoping there are some options that I'm missing.
The text was updated successfully, but these errors were encountered: