test_profiles.py 文件源码

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

项目:formulas 作者: jzuhone 项目源码 文件源码
def test_hernquist_density():
    p = hernquist_density_profile()
    a = 200.*ytu.kpc
    M_0 = 1.0e14*ytu.Msun
    p.set_param_values(a=a, M_0=M_0)
    x = r_yt/a
    assert_allclose(p(r_yt).v, (M_0/(2*np.pi*a**3)/(x*(1.+x)**3)).v)
    assert str(p(r_yt).units) == str((M_0/a**3).units)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号