I have the following integral:
$\int_{1}^{Xd} \dfrac{(X^{z_i}-1)}{[X^2 \sum_{l=1}^{N}c_l(X^{z_l}-1)]^{1/2}}dX = \int_{1}^{Xd} h(X) dX$
where:
Xd is a real that can be either negative, positive or even 1.
$z_i$ is a integer (positive or negative)
$z_l$ also a integer ($z_i$ will be in the vector that contain all the $z_l$ of length N)
$c_l$ is a vector of positive real
You can observe that there is a singularity at the limit value 1. Where I got division of 0/0.
I am using Spyder idle (so python + libraries) and I have tried with:
import scipy.integrate as integrate
partB = integrate.quad(self.integrand_fun_Borkovec_1983_eqn_11, 1, Xd, arg = (zi,zl_vec, cl_vec))
def integrand_fun_Borkovec_1983_eqn_11 (self, x, zi,z_vec, cb):
a = (x**zi)-1
b= 0
for i in range(0, len(z_vec)):
b = b + cb[i]*((x**z_vec[i])-1)
b = x*x*b
return a/b
for the following values of Xd = 0.07544956110914136, zi = 1, zl_vec = [1,1,-1,-1] and cl_vec = [1.02882947e-07, 8.43609299e-05, 8.43566150e-05, 9.71978375e-08]
I get the following result in part B: (166085.34873353728, 6428.115530877825). The value 6428.115530877825 is an estimation of the error, as you can seen the estimated error is pretty high.
I have read in the paper that I am using Borkovec(1983) the following:
Expand the integrand to second order in X-1 for values of X near 1
What would mean (If I am not wrong):
$h(x) \approx h(X-1)+h'(X-1)+(1/2)h''(X-1)$
Hence, I will need to calculate h'(X-1) and h''(X-1). I wonder if there is an easier way to solve this singularity. I have tried using the points argument of the quad function, but the estimated error is still high.
partB = integrate.quad(self.integrand_fun_Borkovec_1983_eqn_11, 1, Xd, arg = (zi,zl_vec, cl_vec), points=[0.95, 1])
Thank you