I have looked for an answer to this problem, but no questions address the issue of underflow occurrence during the calculation of integrals. I am especially interested in the dblquad function, contained in the NumPy module, in Python.
The problem, essentially is the following: I am trying to calculate a definite double integral, of a rather complicated function:
from math import *
import numpy as np
import scipy.special as special
import scipy.integrate as integrate
#Specific values as example for certain parameters of the general problem
#A(v,z) is merely a function that appears in the integrand
#This function is defined in terms of an integral of the modified Bessel function of the 2nd kind. It also appears in the integrand
i=integrate.quad(lambda xi: special.kv(5/3.,xi),x,np.inf)
#This is the integrand
#Calculation of the integral
i=integrate.dblquad(lambda x,z: integrand(v,z,x),lowerlimit,H,lambda z:0.,lambda z:np.inf)
print 'integral = %.2E'%integral(vi)
The terminal output of the above is
integral = 0.00E+00
I know this cannot be true. I do know that the integral must have a finite, non-zero value.
I am not a programmer, and I have not dealt with this issue before. I cannot figure out a way to surpass this problem. If anyone has had experience with similar issues, your help would be much appreciated.