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)
评论列表
文章目录