def a2t(at, Om0=0.27, Oml0=0.73, h=0.700):
integrand = lambda x: 1./(x*sqrt(Oml0+Om0*x**-3.0))
# current_time,err = si.quad(integrand,0.0,at,epsabs=1e-6,epsrel=1e-6)
current_time = quad(integrand, 1e-4, at)
# spacings = np.logspace(-5,np.log10(at),1e5)
# integrand_arr = integrand(spacings)
# current_time = np.trapz(integrand_arr,dx=np.diff(spacings))
current_time *= 9.779/h
return current_time
评论列表
文章目录