Stellar Evolution and HR Diagram Console
Live Hertzsprung-Russell diagram with broken-power-law mass-luminosity relations, parametric evolutionary track propagation from zero-age main sequence through subgiant, red giant branch, asymptotic giant branch, and white dwarf cooling or supernova endpoint. Polytropic interior structure via Lane-Emden ODE integrated by RK4. Salpeter and Kroupa initial mass function sampled cluster populations with synthetic isochrones. Catalog of sixteen well-known stars across the diagram.
Overview
The Hertzsprung-Russell diagram is the single most important plot in stellar astrophysics. It places every star on a two-dimensional grid of luminosity versus surface temperature and reveals at a glance their internal structure, age, mass, and evolutionary state. Stars are not scattered randomly. They cluster into bands, branches, and clumps that map directly onto the physics of nuclear burning, gravitational contraction, and degenerate matter.
STAR-01 implements the standard pedagogical pipeline: place real catalog stars on the HR diagram, draw the zero-age main sequence and white dwarf cooling tracks as references, propagate evolutionary tracks for selected masses through every burning phase, integrate polytropic interior structure via Lane-Emden, and sample synthetic clusters from a Salpeter or Kroupa initial mass function to recover isochrones at any age.
All numerical work runs in Float64. Mass-luminosity relations follow broken-power-law fits calibrated to PARSEC tracks. Polytropic structure uses the Lane-Emden equation integrated by classical RK4. Cluster sampling draws from analytic IMFs via inverse transform.
Quick Start
Guided Workflows
Workflow A :: The Sun's Future
Track the Sun from birth to white dwarf endpoint. The complete lifecycle takes about 13 billion years.
Workflow B :: Sirius B and the Discovery of White Dwarfs
Sirius B is the prototype white dwarf. Its position on the HR diagram revealed an entirely new class of stellar object.
Workflow C :: Cluster Isochrones
The shape of a star cluster on the HR diagram is its age in disguise.
Tab Guide
HR Diagram
Plots all 16 catalog stars with the ZAMS reference line and a dim white-dwarf cooling sequence. Click a star to select it. The y-axis is logarithmic luminosity in solar units; the x-axis is logarithmic effective temperature with hot stars on the LEFT (the standard reversed convention).
Tracks
Plots a single star's full evolutionary path from ZAMS through the endpoint for the selected initial mass. The age slider walks the current position along the track. Stage label and luminosity, temperature, radius, and lifetime values update live.
Structure
Solves the Lane-Emden equation by RK4 for the chosen polytropic index n. Plots dimensionless density, pressure, and temperature profiles versus radius. Reports xi_1 (surface), central density, central temperature, and the gravitational binding energy.
Cluster
Samples N stars from the chosen IMF (Salpeter or Kroupa), evolves each to the cluster age, and plots all on the HR diagram. The shape collapses onto a synthetic isochrone with a clear main-sequence turnoff.
Stack / Method
Stack tab probes runtime capabilities and reports memory. Method tab gives the underlying mathematical formulation.
Controls Reference
| Control | Tab | Action |
|---|---|---|
| Star click | HR Diagram | Select catalog star, show details. |
| Mass slider | Tracks | Initial stellar mass in Msun. Range 0.3 to 40. |
| Age slider | Tracks | Current age in Gyr. Auto-clipped to track endpoint. |
| n slider | Structure | Polytropic index. Range 0.5 to 4.5. Use 1.5 for convective, 3 for radiative. |
| SOLVE LANE-EMDEN | Structure | Re-integrate ODE with RK4 at chosen n. |
| Total mass slider | Cluster | Cluster total stellar mass. |
| Cluster age slider | Cluster | Age applied to all sampled stars. |
| IMF toggle | Cluster | Salpeter (single power law) or Kroupa (broken power law). |
| SAMPLE | Cluster | Resample stars from IMF and replot. |
Reading the Plots
HR Diagram
Hot stars on the LEFT (high log Teff). Luminous stars on TOP. The cyan curve is the ZAMS where stars start their hydrogen burning lifetime. Most catalog stars sit on or near it. Aldebaran and Arcturus deviate upward and rightward into the red giant branch. Sirius B and Procyon B drop off the bottom into the white dwarf region. Betelgeuse and Rigel sit at the top, in the supergiant zone.
Evolutionary Tracks
The track moves from lower-right (cool, faint pre-MS) to the ZAMS, then drifts slightly upward and rightward during MS, jumps rightward during the Hertzsprung gap, climbs the red giant branch, then back to the bluer horizontal branch (for low-mass), then up the AGB, and finally crashes leftward to the hot post-AGB before dropping to the white dwarf cooling sequence.
Lane-Emden Profiles
Density, pressure, and temperature drop monotonically from the centre to the surface. Larger n means steeper drop near the surface and more centrally concentrated mass. n = 0 is constant density. n = 5 has infinite radius. Real stars sit around n = 1.5 (low-mass MS, fully convective) or n = 3 (Sun, mostly radiative).
Cluster Isochrone
Sampled stars form a recognisable isochrone: a main sequence below the turnoff, a subgiant branch crossing the Hertzsprung gap, and a red giant branch climbing upward. The position of the turnoff is the cluster age in disguise.
Troubleshooting
- Cluster does not show a clear isochrone
- Total mass is too small. With fewer than about 100 sampled stars the isochrone shape is dominated by Poisson noise. Increase total mass and resample.
- Track slider does not progress beyond a certain age
- The track ends at the stellar lifetime. For a 10 Msun star this is about 26 million years; for the Sun it is about 13 billion years. The slider clips to the endpoint.
- Lane-Emden fails to converge
- Polytropic index n must be between 0 and 5 strictly for finite radius. The console clips to a safe range; values close to 5 produce extremely extended profiles.
- Sirius B looks anomalously hot
- Correct. Young white dwarfs have effective temperatures of 25000 K or higher despite their tiny radii. They cool over billions of years toward 3000 K.
- Stack shows WebGPU FALLBACK
- Browser does not advertise WebGPU yet, or COOP/COEP headers are not set. CPU path is fully functional and produces identical results.
Scientific References
- Hertzsprung 1911 - Ueber die Verwendung photographischer effektiver Wellenlangen zur Bestimmung von Farbenaequivalenten. Original colour-luminosity diagram.
- Russell 1914 - Relations Between the Spectra and Other Characteristics of the Stars. Popular Astronomy 22 275. The American independent discovery of the diagram.
- Chandrasekhar 1939 - An Introduction to the Study of Stellar Structure. University of Chicago Press. Foundational treatment of polytropes and Lane-Emden.
- Kippenhahn, Weigert, Weiss 2012 - Stellar Structure and Evolution. Springer. Standard graduate textbook.
- Salpeter 1955 - The Luminosity Function and Stellar Evolution. ApJ 121 161. Original initial mass function.
- Kroupa 2001 - On the variation of the initial mass function. MNRAS 322 231. Multi-segment IMF.
- Bressan et al. 2012 - PARSEC: stellar tracks and isochrones with the PAdova and TRieste Stellar Evolution Code. MNRAS 427 127.
- Choi et al. 2016 - MIST. ApJ 823 102. Modern isochrone library.
- Lane 1870 / Emden 1907 - Original derivation of the polytropic equation governing self-gravitating gas spheres.
Glossary
| HR Diagram | Plot of luminosity (or absolute magnitude) versus effective temperature (or colour) for stars. |
| ZAMS | Zero-age main sequence. Locus where stars first ignite stable hydrogen burning. |
| TAMS | Terminal age main sequence. End of core hydrogen burning. |
| RGB | Red giant branch. Hydrogen shell burning around an inert helium core. |
| HB | Horizontal branch. Stable core helium burning after the helium flash. |
| AGB | Asymptotic giant branch. Double-shell burning phase before envelope ejection. |
| WD | White dwarf. Degenerate stellar remnant of low- and intermediate-mass stars. |
| Polytrope | Self-gravitating gas with equation of state P = K rho^(1+1/n). |
| Lane-Emden equation | Dimensionless ODE governing polytropic stellar structure. |
| IMF | Initial mass function. Distribution of stellar masses at birth. |
| Salpeter slope | Power law dN/dM proportional to M^-2.35 for M above about 0.5 Msun. |
| Isochrone | Locus of stars with the same age and metallicity but different masses. |
| L_sun | Solar luminosity, 3.828e26 W (IAU 2015). |
| Teff | Effective temperature. Temperature of a blackbody with the same total flux as the star. |
All numerical results carry a provenance hash recording the integrator, mass-luminosity relation, IMF, and parameter set used. Persisted to IndexedDB for cross-session reproducibility.
- Solar reference: L_sun = 3.828e26 W, R_sun = 6.957e8 m, M_sun = 1.989e30 kg, Teff_sun = 5778 K (IAU 2015 nominal)
- Mass-luminosity: broken power law, calibrated to PARSEC tracks
- Tracks: parametric splines through ZAMS, TAMS, SGB, RGB, HB, AGB, WD/NS
- Lane-Emden: classical RK4 with adjustable step
- IMF: Salpeter (alpha=2.35) or Kroupa (alpha=1.3 below 0.5 Msun, 2.3 above)
Mass-Luminosity Relation
Main sequence luminosity follows a broken power law in mass. The console uses
L = 0.23 M^2.3for M below 0.43 MsunL = M^4for M between 0.43 and 2.0 MsunL = 1.4 M^3.5for M between 2.0 and 55 Msun- Eddington-limited slope above 55 Msun
Radius follows a separate broken power law calibrated to PARSEC. Effective temperature is then derived from the Stefan-Boltzmann relation L = 4 pi R^2 sigma Teff^4.
Main Sequence Lifetime
Main sequence duration scales approximately as tau_MS = 10 Gyr * (M/Msun)^-2.5. The Sun therefore lives about 10 Gyr; a 10 Msun star lives about 30 million years; an O-type 40 Msun star lives only a few million years.
Evolutionary Tracks
For each initial mass the console interpolates between key (age, log L, log Teff) anchor points spanning ZAMS, mid-MS, TAMS, subgiant branch, RGB base, RGB tip, helium burning (HB or He flash for low mass; blue and red supergiant phases for high mass), AGB, and the endpoint. Endpoints are white dwarf cooling for M below 8 Msun and core-collapse supernova followed by neutron star or black hole for higher mass.
Lane-Emden Equation
The dimensionless equation for polytropic structure is
(1/xi^2) d/dxi (xi^2 dtheta/dxi) + theta^n = 0
with boundary conditions theta(0) = 1 and dtheta/dxi(0) = 0. The console expands this as a coupled first-order system dtheta/dxi = u, du/dxi = -2u/xi - theta^n, integrates with classical RK4 from xi=0 (using a series expansion for the first few steps to avoid the singularity), and stops when theta reaches zero. The first zero gives the dimensionless surface xi_1. From this the console computes the central-to-mean density ratio, the gravitational binding energy coefficient, and the dimensionless mass.
Initial Mass Function
The console samples from two IMFs via inverse transform:
- Salpeter 1955:
dN/dM proportional to M^-2.35for M between 0.1 and 100 Msun. - Kroupa 2001: broken power law with slope 1.3 between 0.08 and 0.5 Msun and slope 2.3 between 0.5 and 100 Msun.
Cluster Synthesis
For total mass M_tot, draw masses from the IMF until the cumulative mass exceeds M_tot. Each star is then evolved to the cluster age using its initial mass and the parametric track. Stars whose total lifetime falls below the cluster age are placed at their endpoint state (white dwarf cooled for the difference, neutron star, or black hole). The HR diagram of the resulting population is the cluster isochrone.
Compute Pipeline
State and intermediate buffers (Lane-Emden integration trajectory, cluster star list, evolutionary track samples) are held in Float64Array views. Where the runtime advertises SharedArrayBuffer the buffers are allocated over shared memory for zero-copy hand-off to potential workers.