integrate_king_profile

cosmic.sample.cmc.king.integrate_king_profile(w0, tidal_boundary=1e-06)[source]

Integrate a King Profile of a given w_0 until the density (or phi/sigma^2) drops below tidal_boundary limit (1e-8 times the central density by default)

Let’s define some things: The King potential is often expressed in terms of w = psi / sigma^2 (psi is phi0 - phi, so just positive potential) (note that sigma is the central velocity dispersion with an infinitely deep potential, and close otherwise)

in the center, w_0 = psi_0 / sigma^2 (the free parameter of the King profile)

The core radius is defined (King 1966) as r_c = sqrt(9 * sigma^2 / (4 pi G rho_0))

If we define new scaled quantities

r_tilda = r/r_c rho_tilda = rho/rho_o

We can rewrite Poisson’s equation, (1/r^2) d/dr (r^2 dphi/dr) = 4 pi G rho as:

d^2(r_tilda w)/dr_tilda^2 = 9 r_tilda rho_tilda

After that, all we need is initial conditions: w(0) = w_0 w’(0) = 0

returns (radii, rho, phi, M_enclosed)