13 lines
332 B
Python
13 lines
332 B
Python
import numpy as np
|
|
|
|
M = 5
|
|
a = 5
|
|
|
|
def model_density_distribution(r_bins: np.ndarray):
|
|
"""
|
|
Generate a density distribution for a spherical galaxy model, as per the Hernquist model.
|
|
See https://doi.org/10.1086%2F168845 for more information.
|
|
"""
|
|
rho = M / (2 * np.pi) * a / (r_bins * (r_bins + a)**3)
|
|
return rho
|