---
title: "Adding stellar, gas and halo gravity"
description: "Add signed radial forces before taking a circular speed, derive NFW and cored halo masses, and distinguish the ideal thin disk from native thick-disk inputs."
canonical_url: "https://sandboxphysics.com/stories/galaxy-rotation-curves/adding-starlight-gas-and-a-halo/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/galaxy-rotation-curves/adding-starlight-gas-and-a-halo/"
last_modified: "2026-11-05"
---

[Galaxy rotation curves and mass models](https://sandboxphysics.com/stories/galaxy-rotation-curves/)

Galaxy rotation curves · L2

# Adding stellar, gas and halo gravity

Sandbox Physics · 2026-11-05

A mass decomposition adds the radial gravitational force from each component. Adding the heights of their speed curves gives the wrong answer, because circular acceleration depends on speed squared.

## Before you begin

Read “Why a disk and a sphere pull differently”. You need roots, exponentials and logarithms. The halo integrals are developed below; standard special functions supply the numerical thin-disk expression.

## Several gravitating components act on one tracer

Let $g_g,g_d,g_h$ be the signed inward accelerations from gas, a stellar disk and a spherical halo at radius $R$. Newtonian gravity superposes these accelerations. Multiplying each by the same radius gives contributions with units of speed squared.

Component tables often express those forces as equivalent circular speeds. They describe the speed supported by a component’s gravity, not three independent streams whose velocities should be added. A native stellar column is calculated first at unit stellar mass-to-light ratio and then scaled by the chosen ratio.

Write the numerical disk mass-to-light ratio in solar units as $\Upsilon_d$, the signed gas equivalent speed as $V_g$, and the unit-ratio stellar column as $V_d$. The fixed object used here has no bulge. Its native gas term already includes the helium factor $1.33$, so we do not apply that factor again.

$$
v_c^2=V_g|V_g|+\Upsilon_d V_d|V_d|+v_h^2,\qquad v_h^2=\frac{G M_h(<R)}R
$$

The absolute-value product preserves the native force sign. The sum must be positive before it supports a real circular speed.

Reading: Lelli, McGaugh & Schombert (2016), SPARC, AJ152,157 · Independent saved-observation rotation-curve calculation

## An outward gas force has a negative contribution

Gas concentrated outside a test radius can pull a disk-plane particle outwards. The native table marks an outward contribution with a negative equivalent speed. Squaring every column unconditionally would reverse that force.

For a worked example, take $V_g=-20\,\mathrm{km\,s^{-1}}$, $V_d=80\,\mathrm{km\,s^{-1}}$, $\Upsilon_d=0.5$ and $v_h=100\,\mathrm{km\,s^{-1}}$. Their signed contributions are $-400$, $3200$ and $10000$, all in $(\mathrm{km\,s^{-1}})^2$. The sum is $12800$, giving $v_c=113.137\,\mathrm{km\,s^{-1}}$.

Turning the gas term positive would instead give $116.619\,\mathrm{km\,s^{-1}}$. If the signed sum is zero or negative, the prescribed field does not support this kind of circular solution at that radius. Taking an absolute value of the total would invent a different force.

For the stellar component alone, increasing $\Upsilon_d$ from $0.25$ to $1$ quadruples the force and doubles its equivalent speed. The total-speed multiplier still follows the combined gas, stellar and halo terms.

Reading: Lelli, McGaugh & Schombert (2016), SPARC, AJ152,157 · Independent saved-observation rotation-curve calculation

## Integrate the NFW cusp before interpreting its speed

The NFW family has a density scale $\rho_s$ and radius scale $r_s$. Define $x=R/r_s$. Its inner density rises approximately in inverse proportion to radius; this central rise is called a cusp. The scale density is not a finite central density.

Changing to dimensionless radius in the shell integral leaves $\int_0^x t/(1+t)^2\,dt$. Split the numerator as $t=(1+t)-1$, integrate the logarithmic and inverse terms, then evaluate the endpoints. This produces the mass below.

$$
\rho_{\rm NFW}(R)=\frac{\rho_s}{x(1+x)^2},\qquad M_{\rm NFW}(<R)=4\pi\rho_s r_s^3\left[\ln(1+x)-\frac{x}{1+x}\right]
$$

Density in $\mathrm{M}_\odot\,\mathrm{kpc}^{-3}$ and scale radius in $\mathrm{kpc}$ give mass in $\mathrm{M}_\odot$. Here $\ln$ denotes the natural logarithm.

Reading: Navarro, Frenk & White (1997), fixed astro-ph/9611107v1 · Independent saved-observation rotation-curve calculation

## Cusp and core approach the centre differently

Near the centre, $\rho(R)\simeq\rho_s r_s/R$. A thin shell contributes $4\pi R^2\rho(R)\,dR\propto R\,dR$, so integrating outward gives mass proportional to $R^2$. The exact NFW mass bracket correspondingly approaches $x^2/2$. Enclosed mass therefore grows as $R^2$, and dividing by radius to obtain speed squared gives $v_h\propto R^{1/2}$. A density cusp does not require a divergent circular speed. The smaller central sphere contains less mass.

A second family has finite central density $\rho_0$. Set $x=R/r_c$. Its shell integral contains $\int_0^x t^2/(1+t^2)\,dt$. Writing the integrand as $1-1/(1+t^2)$ gives $x-\arctan x$. Here $\arctan x$ is the angle in radians whose tangent is $x$; its derivative is $1/(1+x^2)$.

Near the centre this bracket approaches $x^3/3$, so enclosed mass grows as $R^3$ and speed as $R$. These distinct slopes offer a possible observational difference. Resolving it also requires the stellar contribution, angular resolution and noncircular motions to be understood.

$$
\rho_{\rm core}(R)=\frac{\rho_0}{1+x^2},\qquad M_{\rm core}(<R)=4\pi\rho_0r_c^3(x-\arctan x)
$$

This is the pseudo-isothermal cored sphere. Neither it nor the untruncated NFW law supplies a measured finite total mass here. The displayed outer radius is a chosen analysis window.

Reading: Navarro, Frenk & White (1997), fixed astro-ph/9611107v1 · Independent saved-observation rotation-curve calculation

## The exponential disk keeps its disk geometry

The ideal thin disk has $\Sigma(R)=M_d e^{-R/R_d}/(2\pi R_d^2)$. Integrating its axisymmetric ring potential gives a convenient special-function expression. $I_n$ and $K_n$ are modified Bessel functions, standard functions that arise in cylindrical problems. The scientific code evaluates them with its numerical library.

An independent check takes a different route: integrate the Newtonian potential of actual circular rings, then differentiate with two radial steps. It compares the results over declared finite radii instead of evaluating the Bessel formula twice and calling the second evaluation a reference.

Native SPARC stellar columns preserve their original finite vertical thickness and radial structure. Reading and scaling those columns adopts that native component model. Using a thin exponential disk explains and tests a separate ideal geometry.

$$
v_d^2(R)=\frac{2GM_d}{R_d}y^2\left[I_0(y)K_0(y)-I_1(y)K_1(y)\right],\qquad y=\frac{R}{2R_d}
$$

This expression applies to the declared razor-thin exponential disk. Its far field approaches the finite-total-mass point-source limit; its inner shape contains a logarithmic term.

Reading: Independent saved-observation rotation-curve calculation · Lelli, McGaugh & Schombert (2016), SPARC, AJ152,157

## Subtracting nearby floating-point numbers can lose the result

For very small $x$, direct evaluation of $x-\arctan x$ subtracts two nearly equal floating-point numbers. Significant digits can disappear. The code instead uses the equivalent convergent series $x^3/3-x^5/5+x^7/7-\cdots$, then checks it against positive-density integration.

This is a numerical-precision issue within the same physical core model. The failed direct-subtraction examples remain in the scientific output, with the original independent tolerance. Stable arithmetic is a prerequisite for asking what the observations say about the density profile.

Reading: Independent saved-observation rotation-curve calculation

## Exercises and explained answers

1. At one radius take a native gas term of $-10\,\mathrm{km\,s^{-1}}$, stellar unit-ratio speed $50\,\mathrm{km\,s^{-1}}$, $\Upsilon_d=1$ and halo speed $40\,\mathrm{km\,s^{-1}}$. Find the total circular speed.

   Read the explanation

   The signed sum is $-100+2500+1600=4000\,(\mathrm{km\,s^{-1}})^2$, giving about $63.25\,\mathrm{km\,s^{-1}}$. The outward gas force reduces the required net inward contribution.

2. If both halo families have circular speed tending to zero at the centre, how can their central behaviour differ?

   Read the explanation

   The rate of approach differs: $v_h\propto R^{1/2}$ for this NFW cusp and $v_h\propto R$ for a finite-density core. Measuring the slope requires handling the stellar disk, spatial resolution and noncircular motions.

3. Why is equality between the thin-disk Bessel formula and a native stellar column not an acceptance requirement?

   Read the explanation

   They describe different thicknesses and radial mass distributions. Test the ideal thin disk against an independent calculation of that same disk. Interpret the native column with its own geometry and unit mass-to-light convention. Forcing agreement would replace the physical object.

## Try the prediction

### [Compare the stellar disk and conditional halo](https://sandboxphysics.com/labs/galaxy-rotation-curves/)

1. Pause the test orbits and change only mass-to-light ratio. Predict and compare the square-root scaling of the stellar equivalent speed.
2. Compare the cusp and core presets, moving the probe to examine component and total speeds at saved radii.
3. Use the component curves to explain why their heights cannot simply be added.

[Previous: Why a disk and a sphere pull differently](https://sandboxphysics.com/stories/galaxy-rotation-curves/why-a-disk-is-not-a-sphere/) [Next: When distance and inclination move a whole curve](https://sandboxphysics.com/stories/galaxy-rotation-curves/moving-a-whole-rotation-curve/)

## Sources and calculation scope

1. [Lelli, McGaugh & Schombert (2016), SPARC, AJ152,157](https://astroweb.cwru.edu/SPARC/)

   Official fixed Table1 and Rotmod\_LTG.zip; named NGC2403 member only. The master paper sections3.1–3.3/5.1–5.3 and original Table2 notes establish signed gas, unit stellar mass-to-light, finite thickness and error meaning. Fresh source acquisition is separate from cached replay. Original rows and measured-derived plots stay local.

2. [Navarro, Frenk & White (1997), fixed astro-ph/9611107v1](https://arxiv.org/abs/astro-ph/9611107v1)

   Fixed original density law and numerical-resolution context; sections3.2–3.3 and original equations2–3 inspected. This course integrates a stated spherical density mathematically; it does not rerun a cosmological simulation or certify arbitrary physical extrapolation.

3. [Independent saved-observation rotation-curve calculation](https://sandboxphysics.com/stories/galaxy-rotation-curves/materials/galaxy-rotation-science-v1.zip)

   Own MIT Python produces synthetic observations, actual six-start fits, profiles, commonD/i scenarios, positive-density/ring-potential/Jacobian references and SVGs. Optional exact named-source acquisition and73-row conversion/fits were actually run. Default is offline; ZIP contains no App Engine, original SPARC rows, paper or measured-derived graph.
