I'm integrating a log-normal function and I'm encountering some unexpected zeros, so why? My code is:
from numpy import pi, log, exp
import scipy.integrate
# My function (a log-normal function)
def Fbloqueo(Xb, wXb, Xbmed):
return (
1 / (wXb * Xb * (2 * pi) ** 0.5) * exp(-1 / 2 * ((log(Xb / Xbmed)) / wXb) ** 2)
)
# some parameters
Xbmed = 20
wXb = 0.010
Xe = 80
# Integration
Magzfc1, _ = scipy.integrate.quad(Fbloqueo, 2, Xe, args=(wXb, Xbmed))
print(Magzfc1)
The result should be 1, but I'm obtaining zero. This behavior occurs many times and this is a problem because I need to multiply by another function to make a fit to find wXb and Xbmed. Does anybody please could help me to understand the problem with the quad function?