Home / Science / Astronomy and space / Galactic and extragalactic astronomy / Galaxy rotation curve fitterTool #69

Galaxy rotation curve fitter: bulge, disc and dark matter halo (NFW or isothermal)

Paste a galaxy's rotation curve and fit a bulge, an exponential disc and a dark halo: masses with uncertainties, how much of the galaxy is dark matter, and the halo's total mass.

Keep it one tap away for everyday use.

Bookmark Galaxy rotation curve fitter?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Speeds
  2. Fit model
  3. Dark matter
Nothing is uploadedWorks offline once open

Rotation curve

A rotation curve alone cannot tell the disc and the halo apart very well: a heavier disc with a lighter halo often fits as well as the reverse. If you know the disc's scale length from photometry, enter it; it makes the fit much firmer. Missing errors count as 5 km/s.

What it does

Stars and gas in a spiral galaxy orbit its centre. How fast they go at each radius, the rotation curve, measures how much mass lies inside that radius. If galaxies were made only of the stars we see, speeds would fall off beyond the bright disc, like the planets round the Sun. Instead they stay flat far out. That is the classic evidence for dark matter.

This tool fits a three-part mass model to a measured rotation curve. The parts are a central bulge (a Hernquist profile), a thin exponential disc (Freeman’s solution) and a dark halo, either the cuspy NFW profile predicted by cold dark matter simulations or a cored pseudo-isothermal sphere. It gives each part’s mass and size with uncertainties, plots each part’s own contribution, and reports the share of dark matter inside the last measured point. It also gives the radius where the halo starts to outweigh the stars and, for NFW, the halo’s total mass M₂₀₀ and concentration.

How to use it

  1. Paste the curve: radius in kiloparsecs, circular speed in km/s and, if you have them, the error of each speed. Columns can be separated by tabs, commas or spaces. Load the example fills in a simulated Milky Way-like galaxy.
  2. Choose the dark halo shape. Tick No bulge for late-type or dwarf galaxies.
  3. If photometry gives you the disc’s scale length, type it in. It breaks most of the disc–halo trade-off.
  4. Read the fit, check the residuals for any pattern, and download the model curves as a CSV or the page as a PNG, PDF or Word file.

How it is worked out

Each part adds in quadrature: v² = v²(bulge) + v²(disc) + v²(halo).

  • Hernquist bulge: v² = G M r / (r + a)².
  • Exponential disc of mass M and scale length Rd: v² = 4πGΣ₀Rdy²[I₀(y)K₀(y) − I₁(y)K₁(y)], with y = R/2Rd, using modified Bessel functions.
  • NFW halo: v² = 4πGρsrs³[ln(1 + x) − x/(1 + x)]/r, with x = r/rs.
  • Pseudo-isothermal halo: v² = 4πGρ₀rc²[1 − (rc/r) arctan(r/rc)].

The fit minimises χ² over the logarithms of the parameters with a simplex search from several starting points. Uncertainties come from the curvature of χ². G is 4.30091 × 10⁻⁶ kpc (km/s)² per solar mass.

Worked example

The example galaxy was simulated with a 1.0 × 10¹⁰ M☉ bulge, a 5.0 × 10¹⁰ M☉ disc with a 3.0 kpc scale length, and an NFW halo. Thirty speeds run from 1 to 30 kpc with 4 to 7 km/s noise. With everything free, the fit finds a disc of (5.3 ± 2.7) × 10¹⁰ M☉ with a scale length of 2.95 ± 0.56 kpc. Dark matter is 80 % of the 3.1 × 10¹¹ M☉ inside 30 kpc, just as in the simulation, and the halo outweighs the stars beyond about 11 kpc. Fixing the scale length at 3.0 kpc shrinks the disc’s uncertainty from ±2.7 to ±1.0 × 10¹⁰ M☉. The NFW halo extends to r₂₀₀ ≈ 220 kpc and holds about 1.2 × 10¹² M☉ in all, with concentration 11. A cored isothermal halo fits these data just as well, so these data alone cannot tell a cusp from a core.

Frequently asked questions

Why are the uncertainties so large? A heavier disc and a lighter halo can trace almost the same curve: the disc–halo degeneracy. Photometry, or the “maximum disc” assumption, is needed to pin it down.

Where do I get data? The SPARC database of 175 galaxies, papers on individual galaxies, or your own long-slit or 21 cm observations.

What about gas? Neutral hydrogen adds its own disc. Here it is absorbed into the stellar disc, which raises the disc mass slightly.

Does it work offline? Yes. The fit runs in your browser, and your data never leave your device.

Where the numbers come from

  • Models: Hernquist bulge, Freeman (1970) disc, NFW and pseudo-isothermal halos.
  • Example data: simulated by fibub.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-08.

Change log for Galaxy rotation curve fitter

  1. Show where each science tool's numbers come from, with a removal-request link Details on GitHub
  2. Open a file on every science paste box, with stated limits Details on GitHub
  3. Add hydrogen line analyser, planet data explorer, sunspot counter and image stacker (#73–#76) Details on GitHub
  4. Add rotation curve fitter, spectral line identifier, transit fitter and star FWHM checker (#69–#72) Details on GitHub

Every change to fibub

Related tools

Cosmology calculator #41 Type a redshift and get the age of the universe then, the lookback time, comoving, angular diameter and luminosity distances, kpc per arcsecond and the distance modulus, for Planck 2018, WMAP or your own cosmology. Uncertainty propagation calculator #25 Type your formula and your measurements with their uncertainties, or paste repeated readings. Get the result with its uncertainty, which input matters most, and a Monte Carlo check. Redshift calculator #55 Convert between redshift, velocity in the relativistic, optical and radio conventions, and observed wavelength or frequency of any common spectral line, with the cosmological recession velocity. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. Radial velocity orbit fitter #64 Paste a star's radial velocities and fit a Keplerian orbit: period, semi-amplitude, eccentricity, periastron, systemic velocity with uncertainties, the mass function and the companion's minimum mass. Hydrogen line analyser #73 Paste a 21 cm hydrogen spectrum from a backyard radio telescope and get LSR velocities, the terminal velocity, kinematic distances, column density and the Milky Way's rotation curve. Spectral line identifier #70 Paste a spectrum or a list of wavelengths and match each line to hydrogen, helium, metals, nebular lines, lamps, light pollution or the atmosphere, and find the redshift where several lines agree.