A star's internal layout is set almost entirely by its mass, through empirical mass-luminosity and mass-radius relations calibrated on real main-sequence stars:
L/L☉ ≈ 0.23·(M/M☉)^2.3 M < 0.43 M☉
L/L☉ ≈ (M/M☉)^4 0.43 – 2 M☉
L/L☉ ≈ 1.4·(M/M☉)^3.5 2 – 55 M☉
L/L☉ ≈ 32000·(M/M☉) M > 55 M☉
R/R☉ ≈ (M/M☉)^0.8 (M ≤ 1 M☉) R/R☉ ≈ (M/M☉)^0.57 (M > 1 M☉)
T_eff = 5778 K · (L/R²)^(1/4) [Stefan–Boltzmann]
Core temperature and pressure follow from the virial theorem's scaling for a self-gravitating ideal gas, T_c ∝ M/R and P_c ∝ GM²/R⁴, calibrated to the Sun's known core values (T_c☉ ≈ 15.7 MK, P_c☉ ≈ 2.65×10¹⁶ Pa).
Which energy-transport mechanism operates where depends on mass too — this is the actual physical reason stars are layered:
- M < 0.35 M☉ — fully convective. The whole star is opaque enough, and cool enough, that convection carries energy from the fusing core all the way to the surface (real M dwarfs, this is why they don't build a helium core the way the Sun does).
- 0.35 – 1.3 M☉ — radiative core, convective envelope (the Sun's own layout). The pp-chain core is hot but not steep enough to drive convection; energy random-walks outward as photons until the gas cools and becomes opaque enough near the surface to convect instead.
- M > 1.3 M☉ — convective core, radiative envelope. The CNO cycle dominates and its energy output is so steeply temperature-dependent that the core convects to keep up, while the tenuous, hot envelope stays radiative all the way out.
The lower force-balance chart plots the two sides of hydrostatic equilibrium, dP/dr = −GM(r)ρ(r)/r², against radius: the inward pull of gravity and the outward push of the pressure gradient. A star in equilibrium keeps these matched at every radius — drag the mass slider and watch both curves rescale together, always meeting, never crossing.