io.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:yt 作者: yt-project 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号