A static, spherically symmetric star in general relativity obeys the Tolman–Oppenheimer–Volkoff equation instead of Newtonian hydrostatic balance:
dP/dr = -G(ρ+P/c²)(m+4πr³P/c²)
───────────────────────────
r(r - 2Gm/c²)
dm/dr = 4πr² ρ
Matter is closed with a polytropic equation of state P = K ρΓ (a simplified stand-in for the true nuclear equation of state). Starting from a chosen central density ρc, the two equations are integrated outward with 4th-order Runge–Kutta until the pressure reaches zero — that radius and enclosed mass are the star's R and M. This 2D view integrates the identical TOV system as the 3D version and draws the star as a density cross-section instead of a rendered sphere.
- ρc slider — denser core → more mass, but only up to a point.
- Γ, K sliders — a stiffer equation of state (higher Γ) resists compression more, supporting a larger maximum mass at a larger radius.
- Sweep ρc — animates the central density from low to high so you can watch the cross-section, mass and radius change live as the star climbs the M–R curve toward, and past, its turnover.
- The M–R curve is traced by repeating the integration for many central densities. It always turns over: past the peak, dM/dρc < 0 and the configuration is dynamically unstable and would collapse — this peak is the TOV maximum-mass limit, the neutron-star analogue of the Chandrasekhar limit. Real neutron stars are believed to top out around 2–2.3 M☉, which is exactly why heavier merger remnants promptly collapse to black holes.
- Compactness 2GM/(Rc²) compares the star's radius to its Schwarzschild radius; a neutron star typically reaches 30–50% of that ratio, far closer to a black hole than any ordinary star.