Problems 11-13
Problem 2.11
Consider a potential of the form
Density
The density can be directly calculated from Poisson's equation.
Mass
The mass can also be directly calculated from the potential
Total mass is \(M_p\) as \(r\to\infty\), so the \(r_{1/2}\) can be found by solving
Define \(x = (r_{1/2}/a)^p\), so that the equation becomes
Threfore
Problem 2.12
Instead of calculating the projected mass using \(\Sigma(R) = 2\int_0^\infty dz\, \rho(\sqrt{R^2 + z^2})\) I will use the Abel form
with
Defining \(x = R/a\) and \(y = r/a\), this becomes
and the projected mass
The effective radius requires to find \(x_e\) such that \(m_p(x_e) = 1/2\). Also, the half-mass radius in 3D is given by \(y_{1/2} = (2^{1/(3 - \gamma)} - 1)^{-1}\).
Before I go into the details of the numerical implementation, I will plot the effective radius as a function of \(\gamma\).
from galactic_dynamics_bovy.chapter02.effective_radius_gamma import plot_effective_radius_gamma
plot_effective_radius_gamma()

Figure 2.12: Effective radius as a function of \(\gamma\). For large \(\gamma\) the mass becomes more centrally concentrated, which makes numerically convergence a bit more challenging. Line \(R_e/r_{1/2} = 3/4\) added for reference.
Now, the numerical considerations
- I pre-compute \(s(x)\) on a grid in \(x\) for a given \(\gamma\) using
scipy.integrate.quadto evaluate the integral in equation (2.12.1). Same as \(m_p(x)\). - The values are interpolated using
scipy.interpolate.interp1d. If a value outside the grid is requested, I directly use equations (2.12.1) and (2.12.2) to compute the values. - Instead of optimizing for \(x_e\) such that \(m_p(x_e) = 1/2\), I just evalute the interpolation \(x = x(m_p)\)
- All these interpolations and numerical integrations deal with numerical divergences at small \(x\), unfortunately large values of \(\gamma\) make this more challenging, as the density becomes more centrally concentrated. I use logarithmic grids and careful handling of small values to mitigate this, however numerical noise remains for large \(\gamma\).
Problem 2.13
Density profile
Define
In hydrostatic equilibrium
From here
Now, applying Poisson's equation
(Density profile is a solution to the Helmholtz equation!) The general solution is
To ensure regular solutions at \(r=0\), we set \(B=0\). Setting \(\rho_0 = \lim_{r\to 0}\rho(r) = Ak\), we have
Boundary radius
The boundary radius \(R\) is defined as the radius where \(\rho(R) = 0\),
Circular velocity
The circular velocity is given by

Figure 2.13: Circular velocity profile of the Fermi gas model with \(R=15\, \mathrm{kpc}\) and \(M=10^{11}\, \mathrm{M}_\odot\).
Script to generate figure:
from galactic_dynamics_bovy.chapter02.fermi_gas_vcirc import plot_fermi_gas_vcirc
plot_fermi_gas_vcirc()
Note that for \(r > R\) the circular velocity is simply \(v_c^2 = GM/r\).