Cluster hydrostatic mass estimator (source code)

= Cluster hydrostatic mass estimator
{title2=$M(<r)=-\dfrac{k_BTr}{\mu m_pG}\dfrac{d\log(\rho_gT)}{d\log r}$}

For spherical thermal <hydrostatic equilibrium>, $dP/dr=-\rho_gGM(<r)/r^2$. Inserting the <ideal gas law> $P=\rho_gk_BT/(\mu m_p)$ with constant mean molecular weight gives the displayed estimator. The density $\rho_g$ is gas density, while $M$ includes every gravitating component. A varying $\mu$ adds $-d\log\mu/d\log r$ inside the logarithmic bracket. Nonthermal pressure requires differentiating the total supporting pressure rather than thermal pressure alone.