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
Hi, I am using scipy.integrate.dblquad to integrate the function as shown below. Obviously, it is quite slow. Is there any way to implement the same in quadpy so as to achieve better performance.
import numpy as np
from scipy import integrate
from scipy.special import erf
from scipy.special import j0
import time
q = np.linspace(0.03, 1.0, 1000)
start = time.time()
def f(q, z, t):
return t * 0.5 * (erf((t - z) / 3) - 1) * j0(q * t) * (1 / (np.sqrt(2 * np.pi) * 2)) * np.exp(
-0.5 * ((z - 40) / 2) ** 2)
y = np.empty([len(q)])
for n in range(len(q)):
y[n] = integrate.dblquad(lambda t, z: f(q[n], z, t), 0, 50, lambda z: 10, lambda z: 60)[0]
end = time.time()
print(end - start)
Total time is
212.96751403808594
The text was updated successfully, but these errors were encountered:
Hi, I am using scipy.integrate.dblquad to integrate the function as shown below. Obviously, it is quite slow. Is there any way to implement the same in quadpy so as to achieve better performance.
Total time is
The text was updated successfully, but these errors were encountered: