def test_nfw_density():
p = NFW_density_profile()
r_s = 100*ytu.kpc
rho_s = 1.0e8*ytu.Msun/ytu.kpc**3
p.set_param_values(r_s=r_s, rho_s=rho_s)
x = r_yt/r_s
assert_allclose(p(r_yt).v, (rho_s/(x*(1.+x)**2)).v)
assert str(p(r_yt).units) == str(rho_s.units)
评论列表
文章目录