profiles.density.EinastoDensityProfile.compute_circular_velocity#

EinastoDensityProfile.compute_circular_velocity(r: unyt_array | unyt_quantity, units: str | Unit | None = None, G: unyt_quantity | None = None, **kwargs) unyt_array | unyt_quantity#

Compute the circular velocity at radius \(r\).

For a test particle in circular orbit, the gravitational force provides the necessary centripetal acceleration. The circular velocity is given by:

\[v_c(r) = \sqrt{ \frac{G M(r)}{r} },\]

where \(M(r)\) is the enclosed mass at radius \(r\).

Parameters:
  • r (unyt_quantity or unyt_array) – Radius or array of radii at which to compute the circular velocity (must carry length units).

  • units (str or Unit, optional) – Desired output units for the circular velocity. By default, uses the internal units determined by G and the profile parameters.

  • G (unyt_quantity, optional) – Gravitational constant to use. Defaults to gravitational_constant.

  • kwargs (dict) – Additional keyword arguments passed to compute_enclosed_mass().

Returns:

v_c – Circular velocity at each input radius, with appropriate units.

Return type:

unyt_quantity or unyt_array

Example

import numpy as np
from pisces.profiles.density import (
    NFWDensityProfile,
)

profile = NFWDensityProfile(rho_0=1.0, r_s=10.0)

r = np.linspace(0.1, 100.0, 50)  # kpc
v_circ = profile.compute_circular_velocity(
    r, units="km/s"
)

print(v_circ)