CLUMPY  Version 2011.09_corr2
profiles.h File Reference

Profile $\rho(r)$ $[M_\odot\,\,kpc^{-3}]$ and related functions (applicable for halos, sub-halos...) More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double rho_ZHAO (double &r, double par[5])
double rho_EINASTO (double &r, double par[3])
double rho_EINASTO_N (double &r, double par[3])
string get_name_prof (double par_prof[4])
double get_rsat (double par[6])
double get_rvir (double par[6], double const &rho_vir)
void rho (double &r, double par[6], double &res)
void rho2 (double &r, double par[6], double &res)
void r2rho (double &r, double par[6], double &res)
void r2rho2 (double &r, double par[6], double &res)
void rho_mix (double &r, double par[21], double &res)
void rho2_mix (double &r, double par[21], double &res)
void r2rho_mix (double &r, double par[21], double &res)
void r2rho2_mix (double &r, double par[21], double &res)
double factor_r_2_to_rscale (double par_prof[4])
double r_2_to_rscale (double const &r_2, double par_prof[4])
double rscale_to_r_2 (double const &rs, double par_prof[4])
void set_par0_given_mref (double par[6], double const &r_ref, double const &m_ref, double const &eps)
void set_par0_given_rhoref (double par[6], double &r_ref, double const &rho_ref)

Detailed Description

Profile $\rho(r)$ $[M_\odot\,\,kpc^{-3}]$ and related functions (applicable for halos, sub-halos...)

     I. Dark Matter profiles and useful definitions
     II. Popular profiles and their parameters
     II. Implementation in the code and functions based on $\rho(r)$
     III. Plots of $\rho(r)$, $dM/dr$, and $d{\cal L}/dr$

________________________________________


I. Dark Matter profiles

A DM profile is fully characterised by a normalisation $\rho_s$, a scale radius $r_s$, the physical size of the DM halo (usually taken to be $R_{vir}$, the virial radius), and several shape parameters. Note that an important quantity is $r_{-2}$, the radius for which the slope is $-2$, i.e.

\[ \left| d(r^2 \rho(r))/dr\right|_{r=r_{-2}} = 0\,, \]

which can be related to $r_s$ for any given profile (see below).

We implemented different families of such profiles in CLUMPY, assuming spherical symmetry.

  • Zhao's $(\alpha,\beta,\gamma)$ profile (kZHAO in CLUMPY)
    Many DM profiles used in the literature can be written in terms of a three parameter $(\alpha,\beta,\gamma)$ family (Hernquist 1990 and Zhao 1996):

    \begin{eqnarray*} \rho^{\rm ZHAO}(r)=\frac{\rho_s}{(r/r_s)^\gamma \cdot [1+(r/r_s)^\alpha]^{(\beta-\gamma)/\alpha}}\;. \end{eqnarray*}

    • $\rho_s$ - normalisation $[M_\odot\,\,kpc^{-3}]$. Beware, that with the above definition, $\rho(r_s) = 2^{(\gamma-\beta)/\alpha}\cdot \rho_s$
    • $r_s$ - scale radius $[kpc]$
    • $\alpha$ - transition slope
    • $\beta$ - outer slope
    • $\gamma$ - inner slope
    For this profile, we have $ r_{-2} = r_s \cdot \left[ \frac{(\beta-2)}{(2-\gamma)} \right]^{-\frac{1}{\alpha}}$.

  • Einasto's logarithmic inner-slope profiles
    In the last decade, it has been realised that the inner slope of the DM halo should decrease as $r$ decreases, which has given rise to several logarithmic inner-slope parameterisations, generally based on the Einasto profile which follows

    \[ \rho(r)\propto \exp\left(-Ar^\alpha\right)\;, \]

    and was first used by Einasto to describe the mass and light distributions in galaxies. Note that it is formally identical to Sersic's law which is traditionally applied to projected (surface) density profiles rather that space density profiles. In the literature, two main expressions of the Einasto density profile of DM halos have been formulated, which may lead to some confusion.
    • Standard Einasto (kEINASTO in CLUMPY)
      It is used for instance in Navarro et al. (2004) and Springel et al. (2008), where

      \[ \rho^{\rm EINASTO}(r)=\rho_{-2} \exp\left\{-\frac{2}{\alpha}\left[\left(\frac{r}{r_{-2}}\right)^\alpha -1\right]\right\}\;, \]

      and both team find that the shape parameter $\alpha=0.17$ allows a good description of the density profile of DM halos. Springel et al. (2008) also finds that $\alpha=0.68$ describes well the spatial distribution of sub-halos $d{\cal P}/dV$. For this profile, we have
      • $\rho_{-2}$ - normalisation $[M_\odot\,\,kpc^{-3}]$. With the above definition, we have $\rho(r_{-2}) = \rho_{-2}$
      • $r_{-2}$ - radius $[kpc]$ for which the slope is $-2$
      • $\alpha$ - shape parameter

    • Einasto 's $r^{1/n}$ (kEINASTO_N in CLUMPY)
      Merritt et al. (2006) implemented a so-called Einasto's $r^{1/n}$ that differs slightly from the original definition

      \[ \rho^{\rm EINASTO\_N}(r) = \rho_e \cdot \exp\left\{-d_n \cdot \left[ \left(\frac{r}{r_e}\right)^{1/n} - 1 \right]\right\}\,. \]

      The quantity $d_n$ is adjusted such as the total mass of an Einasto profile is given by Eqs. (20) and (22) of Merritt et al. 2006). For $n$ an integer, which is mandatory in CLUMPY, $ M_{tot} \sim 2\pi n r_e^3 \rho_e e^{d_n} d_n^{-3n} (3n-1)!$. The profile $n=6$ has been shown to provide good fits to N-body simulations, and $d_n=3n-1/3+0.0079$ (if $ n\ge\sim 0.5 $).
      • $\rho_{e}$ - normalisation $[M_\odot\,\,kpc^{-3}]$. With the above definition, we have $\rho(r_{e}) = \rho_{e}$
      • $r_{e}$ - radius $[kpc]$ which contains half the mass of the halo
      • $n$ - shape parameter (required to be an integer in CLUMPY)
      For this profile, we have $r_{-2} = r_e \cdot \left( \frac{2 n}{d_n}\right)^n $ (Graham et al. 2006).


A few useful definitions of functions related to $\rho(r)$

Note that the expressions above are valid for the spherical-halo case only.

________________________________________


II. Popular profiles and their parameters

Dark matter simulations usually provide $\rho_{\rm tot} (r)$ (from the total density of DM measured in shells) and $d{\cal P}/dV$, the spatial distribution of sub-clumps within a clump. The above families of profiles can be used to describe both the total DM density of a clump and their spatial distribution. Remember however that they will come with different values of their structural parameters $r_s$, $\rho_s$, etc.

In CLUMPY, we generically call $r_s$ the scale radius appearing in the different profiles. However, depending on the chosen parameterisation, it can mean $r_s$, $r_{-2}$ or $r_e$ (see profiles.h). It is up to the user to check that the values for $r_s$ he/she uses in the input parameter file are "realistic". In the same spirit, there are three shape parameters denoted $\alpha$, $\beta$, and $\gamma$, although only $\alpha$ is used for kEINASTO and kEINASTO_N (for which $\alpha$ corresponds to $n$). The table below provides several shape parameters proposed in the literature. They also gives some "reasonable" values as found from simulations for the scale parameter for the Galaxy (or Galactic-type halos). Use with caution!

$\alpha$ $\beta$ $\gamma$ Refs $r^{Gal.~Tot}_s$ $r^{Gal.~dP/dV}_s$
Iso 2. 2. 0. - 4 kpc $^\dagger$ 28 kpc $^\dagger$
NFW 1. 3. 1. Navarro, Frenk & White (1997) 21.7 kpc $^\ddagger$ -
Moore 1.5 3. 1.5 Moore et al. (1998) 34.5 kpc $^\ddagger$ -
DMS04 1. 3. 1.2 Diemand, Moore & Stadel (2004) 32.6 $^\ddagger$ -
EINASTO_N 6 - - Merritt et al. (2006) $\sim$ 250 kpc -
EINASTO 0.17 - - Navarro et al. (2004), Springel et al. (2008) 21.7 kpc -
EINASTO 0.68 - - Springel et al. (2008) - 199 kpc

$^\dagger$ From Lavalle et al. (2008).
$^\ddagger$ From Tab. II of Fornengo, Pieri & Scopel (2004).

________________________________________


III. Implementation in the code and functions based on $\rho(r)$

For all applications and functions in other parts of the code (e.g., in clumps.h, jdsph.h), the profile families are never called directly. In practice, we use functions that can switch to the desired quantity: this switch is set by picking a value of the global enum gENUM_PROFILE constants, which is associated to the string name gNAMES_PROFILE[gENUM_PROFILE] (see params.h).

Beware that this "scale" radius means different things depending on what profile is considered: $r_s$ for standard configurations, $r_{-2}$ for EINASTO, and $r_{e}$ for EINASTO_N. A list of "reasonable" values of $r_s$ taken from the above papers can be found above. In any case, the function set_par0_given_rhoref() will ensure that the proper normalisation par[0] is calculated, according to the specified "scale" radius.

For instance, setting the switch to the value kZHAO, gives gNAMES_PROFILE[kZHAO] = "ZHAO". This applies all the above profiles. Let us now describe all the functions of this file:

  • rho_ZHAO(), rho_EINASTO(), and rho_EINASTO_N()
    Parameters:
    [in]rDistance from the halo centre [kpc]
    [in]par[0]Normalisation: density $[M_\odot\,\,kpc^{-3}]$ or proxy for $d{\cal P}/dV$ $[kpc^{-3}]$
    [in]par[1]Scale radius [kpc]
    [in]par[2]Shape parameter #1
    [in]par[3]Shape parameter #2
    [in]par[4]Shape parameter #3
    Returns:
    $\rho^{\rm XXX}(r)$ $[M_\odot~kpc^{-3}]$, where XXX = ZHAO, EINASTO, or EINASTO_N

  • rho(), rho2(), r2rho(), and r2rho2()
    The format of these functions is fn(double &r, double par[6], double &res), to get functions of $\rho(r)$.
    Parameters:
    [in]rRadial distance from the halo centre [kpc]
    [in]par[0]Normalisation: density $[M_\odot\,\,kpc^{-3}]$ or proxy for $d{\cal P}/dV$ $[kpc^{-3}]$
    [in]par[1]Scale radius [kpc]
    [in]par[2]Shape parameter #1
    [in]par[3]Shape parameter #2
    [in]par[4]Shape parameter #3
    [in]par[5]card_profile (see enum gENUM_PROFILE in params.h)
    [out]res$\rho(r)$, $\rho^2(r)$, $r^2\rho(r)$, or $r^2\rho^2(r)$.

  • rho_mix(), rho2_mix(), r2rho_mix(), and r2rho2_mix()
    The format of these functions is fn(double &r, double par[21], double &res), such that they can be passed to the integrator for a more general profile (e.g., $\rho_{sm}(r) = \rho_{tot}(r) - \rho_{cl}(r))$
    Parameters:
    [in]rRadial distance from the halo centre [kpc]
    [in]par[0]$\rho_1(r)$ normalisation: density $[M_\odot\,\,kpc^{-3}]$ or proxy for $d{\cal P}/dV$ $[kpc^{-3}]$
    [in]par[1]$\rho_1(r)$ scale radius [kpc]
    [in]par[2]$\rho_1(r)$ shape parameter #1
    [in]par[3]$\rho_1(r)$ shape parameter #2
    [in]par[4]$\rho_1(r)$ shape parameter #3
    [in]par[5]$\rho_1(r)$ card_profile (see enum gENUM_PROFILE in params.h)
    [in]par[6]UNUSED
    [in]par[7]UNUSED
    [in]par[8]UNUSED
    [in]par[9]UNUSED
    [in]par[10]switch_rho - selects which combination of $\rho_1$ and $\rho_2$ to use
    • if 0, $ \rho(r) \equiv \rho_1(r)$,
    • if 1, $ \rho(r) \equiv \rho_1(r)-\rho_2(r)$,
    • if 2, $ \rho(r) \equiv \rho_1(r)\cdot\rho_2(r)$.
    [in]par[11]$\rho_2(r)$ normalisation: density $[M_\odot\,\,kpc^{-3}]$ or proxy for $d{\cal P}/dV$ $[kpc^{-3}]$
    [in]par[12]$\rho_2(r)$ scale radius [kpc]
    [in]par[13]$\rho_2(r)$ shape parameter #1
    [in]par[14]$\rho_2(r)$ shape parameter #2
    [in]par[15]$\rho_2(r)$ shape parameter #3
    [in]par[16]$\rho_2(r)$ card_profile (see enum gENUM_PROFILE in params.h)
    [in]par[17]UNUSED
    [in]par[18]UNUSED
    [in]par[19]UNUSED
    [in]par[20]UNUSED
    [out]res$\rho(r)$, $\rho^2(r)$, $r^2\rho(r)$, or $r^2\rho^2(r)$.

  • get_name_prof() returns a string of the profile name/parameters to be used in displays
    Parameters:
    [in]par_prof[0]Shape parameter #1
    [in]par_prof[1]Shape parameter #2
    [in]par_prof[2]Shape parameter #3
    [in]par_prof[3]card_profile (see enum gENUM_PROFILE in params.h)

  • get_rsat()
    Parameters:
    [in]par[0]Normalisation: density $[M_\odot\,\,kpc^{-3}]$ or proxy for $d{\cal P}/dV$ $[kpc^{-3}]$
    [in]par[1]Scale radius [kpc]
    [in]par[2]Shape parameter #1
    [in]par[3]Shape parameter #2
    [in]par[4]Shape parameter #3
    [in]par[5]card_profile (see enum gENUM_PROFILE in params.h)
    Returns:
    Saturation radius $r_{sat}$ [kpc] for which $\rho(r<r_{sat})=\rho_{sat}$.

  • get_rvir()
    Parameters:
    [in]par[0]Normalisation: density $[M_\odot\,\,kpc^{-3}]$ or proxy for $d{\cal P}/dV$ $[kpc^{-3}]$
    [in]par[1]Scale radius [kpc]
    [in]par[2]Shape parameter #1
    [in]par[3]Shape parameter #2
    [in]par[4]Shape parameter #3
    [in]par[5]card_profile (see enum gENUM_PROFILE in params.h)
    [in]rho_virDM density we wish to reach at the viral radius $[M_\odot\,\,kpc^{-3}]$
    Returns:
    $r_{vir}$ [kpc] such as to have $\rho(R_{vir})=\rho_{vir}$.

  • factor_r_2_to_rscale()
    Parameters:
    [in]par[0]Shape parameter #1
    [in]par[1]Shape parameter #2
    [in]par[2]Shape parameter #3
    [in]par[3]card_profile (see enum gENUM_PROFILE in params.h)
    Returns:
    $F=r_{-2}/r_s$, the factor to convert $r_{-2}$ to $r_s$ and vice-versa.

  • r_2_to_rscale() and rscale_to_r_2()
    Parameters:
    [in]r_2(rs)Radius $r_{-2}$ from which the slope is -2 (or scale radius $r_s$) [kpc]
    [in]par[0]Shape parameter #1
    [in]par[1]Shape parameter #2
    [in]par[2]Shape parameter #3
    [in]par[3]card_profile (see enum gENUM_PROFILE in params.h)
    Returns:
    Scale radius $r_s$ (or radius $r_{-2}$ from which the slope is -2) [kpc]

  • set_par0_given_mref()
    Parameters:
    [out]par[0]Proper normalisation to ensure $M(r<r_{ref})=m_{ref}$ for this profile
    [in]par[1]Scale radius [kpc]
    [in]par[2]Shape parameter #1
    [in]par[3]Shape parameter #2
    [in]par[4]Shape parameter #3
    [in]par[5]card_profile (see enum gENUM_PROFILE in params.h)
    [in]r_refReference radius [kpc]
    [in]m_refMass within r_ref [ $M_\odot$]
    [in]eps$\epsilon$ - relative precision sought for the integration

  • set_par0_given_rhoref()
    Parameters:
    [out]par[0]Proper normalisation to ensure $\rho(r_{ref})=\rho_{ref}$ for this profile
    [in]par[1]Scale radius [kpc]
    [in]par[2]Shape parameter #1
    [in]par[3]Shape parameter #2
    [in]par[4]Shape parameter #3
    [in]par[5]card_profile (see enum gENUM_PROFILE in params.h)
    [in]r_refReference radius [kpc]
    [in]rho_refDM density value for the reference radius r_ref $[M_\odot\,\,kpc^{-3}]$
________________________________________


IV. Plots of $\rho(r)$, $dM/dr$, and $d{\cal L}/dr$

The following figures display a comparison of the various profiles in central regions. The saturation density is reached for some of them (1 $GeV\,\,cm^{-3} = 2.63 \cdot 10^7~M_{\odot}\,\,kpc^{-3}$)

  1. DM smooth profile squared $\rho^2(r)$ (normalised to $\rho_0 = 0.3~GeV\,\,cm^{-3}$ at $r=8 kpc$)
    rho2.jpg
  2. Function $dM/dr \propto r^2\rho(r)\quad \Rightarrow\quad $ mass $M =4\pi\int r^2 \rho(r) dr$
    r2rho.jpg
  3. Function $d{\cal L}/dr \propto r^2\rho^2(r) \quad \Rightarrow\quad $ intrinsic luminosity ${\cal L} = 4\pi\int r^2 \rho(r)^2 dr$)
    r2rho2.jpg
Remarks:
To calculate the mass $M$ and luminosity ${\cal L}$ of a clump, the function shown in the last two previous plots need to be integrated. We split the integration in several parts to speed-up the calculation:

\[ I \equiv \int_0^{R_{vir}} f(r)\;dr = I_1 + I_2 + I3 = \int_0^{r=r_{sat}} f(r)\;dr + \int_{r_{sat}}^{r=0.01r_s} f(r)\;dr + \int_{r=0.01r_s}^{R_{vir}} f(r)\;dr \]

The first part $I_1$ is integrated with the linear step simpson_lin_adapt(), and the second and third parts $I_2$ and $I_3$ are integrated with the adaptive logarithmic step simpson_log_adapt(), as described in integr.h.

Definition in file profiles.h.

 All Classes Files Functions Variables Enumerations Enumerator Defines