Stellar Nursery
Stellar Nursery is a browser-based solver that builds a static model of a self-gravitating object from a total mass and a composition, and classifies the result. This page describes the equations it integrates, the approximations it makes, and the respects in which it deliberately departs from real stars. The treatment is at the level of a problem set in stellar structure and evolution, which is the level at which the solver is built.
1 · Overview
The solver produces a zero-age, one-dimensional, hydrostatic model. It takes a total mass and a uniform composition and integrates the structure equations outward from the centre. It then finds the central density and temperature at which the model has the requested mass and radiates exactly the energy its nuclear burning supplies, and assigns a classification to the result.
Scope
- It is not a stellar evolution code. There is no time coordinate, and nothing ages, contracts, expands, mixes or loses mass. Codes such as MESA solve a sequence of models linked in time; this solver computes a single model, which is always the zero-age one.
- Outcomes are not precomputed. There is no table of outcomes keyed on mass. The classification at the top of the results panel is assigned after the integration, from the numbers it produced. At Z = 0.99, for example, the result is not a predefined "black hole" entry but whatever a ball of metal of that mass turns out to be.
- It is not an atmosphere model. The integration stops where the pressure falls to zero. There is no photosphere, opacity table or model atmosphere, and Teff is inferred from L and R rather than integrated.
- It is not relativistic. The solver uses Newtonian hydrostatic equilibrium. It can determine that a configuration is unstable to collapse and where its horizon would lie, but it cannot follow a collapse or model its outcome.
- Precision is limited. Results are accurate to roughly a factor of two. The Sun is reproduced to within a few percent because one opacity constant was set to achieve this; everything else follows from the physics with no further tuning, and is therefore exactly as accurate as that physics.
2 · Inputs and normalisation
Total mass M is set on a logarithmic slider from 10-3 to 108 M☉, or entered directly in the text box. The unit can be solar masses or Jupiter masses, and the line below the box shows the same mass in the other unit. The range extends far beyond any real star because the collapse checks described in §5 begin to apply there. Models above a few times 104 M☉ are included to show where the solution fails, and do not represent physical objects.
Mass fractions X, Y and Z give the proportions of hydrogen, helium and all heavier elements. They can be set by slider or entered directly. The three always sum to exactly 1: changing one rescales the other two in proportion. Composition is uniform, with a single mixture throughout the object; there are no shells, no burning-modified core and no time slider, because the model has no time coordinate.
Composition enters the physics through three mean molecular weights:
The first is the standard expression. The ion weight is usually derived as , which implicitly assumes that metal ions contribute nothing. That assumption holds at Z = 0.02 but fails at Z = 0.99, where it would leave the gas with no ion pressure, so a Z/16 term is added for metals at a mean mass number <A> ≈ 16.
The presets are composition shortcuts only: solar (0.70 / 0.28 / 0.02), primordial (0.75 / 0.25 / 0), metal-poor, metal-rich, helium star (Y = 0.98), C/O (all metals), and almost pure metals (Z = 0.99). They set the sliders and do not otherwise affect the solver.
3 · Equations
Structure
Mass continuity and hydrostatic equilibrium are integrated outward in radius:
Instead of carrying P and inverting the equation of state at every step, the code carries ρ directly and applies the chain rule. This removes the root-finding step from the inner loop, and allows a full solve to complete in tens of milliseconds:
Equation of state
The equation of state includes ideal gas, radiation and electron degeneracy:
The degenerate branch is the full Chandrasekhar expression. It is valid continuously from the non-relativistic to the relativistic regime, and gives reasonable white-dwarf radii without special treatment. The electron pressure is the smooth maximum (a4 + b4)1/4 of the ideal and degenerate branches. This is an approximation that overestimates the pressure by at most 21/4 ≈ 19% at the crossover, and is used because it keeps P(ρ) smooth and monotonic, as the integrator requires.
Thermal stratification
The energy transport equation is not solved. Instead, temperature is tied to density by an effective polytrope, following Eddington's standard model:
This is the largest simplification in the program; its consequences are described in §8. The adiabatic gradient reported in the diagnostics is Chandrasekhar's expression for a mixture of gas and radiation, , which ranges from 0.4 for pure gas to 0.25 for pure radiation.
Opacity
Opacity is the sum of electron scattering and Kramers' law, with the standard coefficients converted to SI units:
The bound-free guillotine factor g/t is uncertain by about a factor of ten in the literature. It is fixed here at 0.033, the only number in the program tuned to a target rather than derived: it is the value that places a 1 M☉ model of solar composition on the Sun. The mass scaling, the composition scaling and the main sequence as a whole follow from the equations once that constant is set.
Nuclear burning
There is no reaction network. Four single-line rates, each a power law multiplied by a Gamow exponential, are evaluated from the local ρ, T and composition. They are used only to determine whether the centre is hot enough to burn and through which channel.
The reported channel is the largest of the four rates at the centre. The carbon rate is the least accurate expression in the program: its exponential has approximately the correct shape, and its coefficient was chosen to place ignition near T ≈ 6–8 × 108 K. It should be read as an indicator of ignition rather than as a rate.
4 · Shooting method
The model has two central unknowns, ρc and Tc, and therefore requires two conditions. Integration begins just outside the singular centre, at the radius enclosing 10-9 of the target mass, where the series corrections are of order r² and negligible. It proceeds outward with a fourth-order Runge–Kutta (RK4) scheme and an adaptive step of a few percent of the local scale length. The surface is defined as the point where the density falls to ρ = 10-8 ρc, and the radius there is taken as R.
Condition 1: mass
The first condition is m(R) = M. At fixed Tc, the mass decreases as ρc rises while thermal pressure dominates, and increases again once degeneracy dominates. M(ρc) therefore has a minimum, and there may be two roots. The choice between them is physical rather than numerical: the gas-supported root corresponds to a star, and the degenerate root to a brown dwarf or white dwarf. The solver reports which branch it is on, and rejects gas-branch solutions that turn out to be strongly degenerate.
Condition 2: thermal equilibrium
The second condition is that nuclear burning supplies exactly the energy the interior radiates. Integrating the radiative diffusion equation from the centre to a deep reference point gives the luminosity the structure can carry:
The solver finds the Tc at which Lnuc = Ldiff. This condition places a star on the zero-age main sequence. It is numerically well behaved because the two sides depend on temperature very differently: burning rates scale as T4 to T18, and transport roughly as T4. The residual is therefore steep and monotonic, which also makes the result insensitive to the factor-of-two uncertainty in the opacity; an error of a factor of four in Ldiff shifts Tc by about 20%.
Both conditions are solved by bracketed bisection with false-position acceleration, one nested inside the other. Bisection cannot diverge, which is important because the inputs may be physically unreasonable.
Non-burning objects
When nothing burns there is no thermal-equilibrium condition, and the second condition must come from elsewhere. The central temperature of a non-burning object is set by its contraction history: it heats as it contracts, and stops contracting when degeneracy takes over its support. The solver takes the smaller of the virial estimate kTc ≈ ½ μ mH GM/R and the highest Tc at which a hydrostatic solution of that mass exists. The latter corresponds to the peak of contraction, and is found by raising Tc until the mass minimum exceeds M and no solution remains.
Non-convergence
If the shooting method cannot close (no ρc gives the required mass, no Tc balances the energy, or the integration never reaches a surface), the program reports NO HYDROSTATIC SOLUTION and stops. This is a valid result: it means that the equations, with those inputs, do not describe a static self-gravitating object. It does not indicate a black hole. Nothing in the program computes collapse, and that term never appears on the results panel as a consequence of non-convergence.
In practice this branch is difficult to reach within the slider's range. In a sweep of the full input domain, almost every combination produced some hydrostatic solution. A static ball of gas is therefore easy to construct; what varies is whether it is a star.
5 · Classification
Classification is based only on the solved model and cannot produce an outcome the integrator did not. The tests are applied in the following order, and the first that matches determines the result:
- → BLACK HOLE — INSIDE ITS OWN HORIZON. The structure is smaller than its own Schwarzschild radius, and so is not a valid structure.
- → COLLAPSES TO A BLACK HOLE — GR INSTABILITY. See below.
- L > LEdd → NO EQUILIBRIUM — RADIATION DRIVEN. The luminosity exceeds 4πcGM/κes, so radiation pressure overcomes gravity in the envelope and the static solution cannot be maintained.
- Burning pp or CNO, X ≥ 0.1 → main-sequence analogue, with an MK spectral type and a hydrogen-burning lifetime.
- Burning pp or CNO, X < 0.1 → hydrogen burning, hydrogen poor. The burning and lifetime are computed normally, but no MK type is assigned, as the object does not lie on any main sequence.
- Burning 3α → helium burner, with no MK type and no hydrogen-burning lifetime.
- Burning carbon → carbon burner, marked as using the least accurate rate in the program.
- M < 0.0124 M☉ (~13 MJ) → planetary-mass object. Below the deuterium limit, nothing burns.
- Not burning, X ≥ 0.1 → brown dwarf. The object contains hydrogen but never ignited it, because degeneracy halted contraction first.
- Not burning, degenerate, M < MCh(μ_e) → white-dwarf-like. "Degenerate" means that degenerate electrons supply more than 40% of the central pressure; the criterion concerns pressure, not η alone.
- Not burning, X + Y < 0.05 → metal ball, with no fuel and no spectral type.
- Any other object that supports itself without burning → cold hydrostatic object.
Collapse criteria
Newtonian hydrostatics can support any mass at a sufficiently high temperature, as there is no Newtonian mass limit. A solver based only on dP/dr = −Gmρ/r² therefore never reports collapse. Three checks are applied to the solution to detect conditions the integrator cannot identify on its own.
Γ1 ranges from 5/3 for a gas-supported star to 4/3 for a radiation-supported one. The value 4/3 is the point of marginal stability: a sphere with Γ1 = 4/3 neither resists compression nor rebounds from it. General relativity raises the threshold by an amount proportional to the compactness (Chandrasekhar's coefficient, 1.12 for an n = 3 polytrope), so a star that is both radiation-dominated and compact is unstable to radial collapse. This is the direct-collapse route to a black hole. The object continues to burn normally until the instability sets in, and the results panel shows the last static model before the instability, not the remnant. Following the collapse would require hydrodynamics and general relativity, neither of which is included.
The onset of instability depends on composition. Radiation pressure dominates at lower mass when the mean molecular weight is high, so a ball of metal becomes unstable at a much lower mass than a ball of hydrogen. The solver reports collapse above the following masses:
| C/O, all metals | ~6 × 10³ M☉ |
|---|---|
| helium | ~3 × 10⁴ M☉ |
| primordial H/He | ~6 × 10⁴ M☉ |
| Z = 0.99 + trace H | ~1 × 10⁵ M☉ |
| solar | ~4 × 10⁵ M☉ |
These values are outputs of the solver, not inputs; the program contains no information specific to supermassive stars. The instability always occurs well before the horizon condition. A C/O ball becomes unstable at ~6 × 10³ M☉, while 2GM/Rc² does not reach 1 until around 10⁹ M☉, five orders of magnitude higher. The horizon test is therefore a safeguard that is never triggered within the available range. This ordering is physically correct: real supermassive stars collapse because of the Γ1 instability, not because they become compact.
Neutron stars
The program cannot produce a neutron star, for two independent reasons.
Neutron star formation is dynamical. Neutron stars form in core collapse: a degenerate core grows beyond MCh and collapses on a free-fall timescale, electron capture converts the matter to neutrons, and the infalling material rebounds from matter at nuclear density. Every stage of this process is time-dependent. The solver produces a static model with no time coordinate, and can represent only a configuration, not a process.
The equation of state contains no neutrons. This is the more fundamental limitation, since a neutron star is a hydrostatic object, and a static solver with the appropriate physics could find one. This solver includes ideal ions, ideal and degenerate electrons, and radiation, but no neutron degeneracy pressure, nuclear forces or weak interactions. The densest object it can support is electron-degenerate, and is therefore limited to MCh.
The solver therefore reports the boundary of its validity rather than constructing a neutron star. Above ρc ≈ 10¹⁰ kg/m³, electrons begin to be captured by nuclei and the composition no longer matches the input; the results panel flags this and states that the model no longer applies. When a fuel-free object is given a mass above MCh, the shooting method finds no solution, and the classification states that degeneracy cannot support the object and identifies the regime as core collapse, without predicting the remnant.
In practice the neutronisation flag is never triggered. The densest object the solver supports is a white dwarf near the Chandrasekhar mass, at about 4 × 10⁹ kg/m³, a factor of a few below the threshold. A denser object would have to be a more massive degenerate one, and at that mass carbon ignites. An inert composition such as iron would allow the white-dwarf branch to extend up to MCh and beyond neutronisation, but the burning rates treat every metal as carbon, so no inert composition is available.
The metal-ball classification is almost never reached. Every fuel-free ball the solver could construct within the slider's range was either degenerate enough to be classified as white-dwarf-like (below about 0.89 M☉ at Z = 1) or contracted to a temperature high enough to ignite carbon (above it). The transition is sharp, and arises from the physics rather than from any imposed threshold.
6 · Spectral type, burn temperature and lifetime
MK spectral type
A spectral type is assigned only to main-sequence analogues, by binning Teff. No colours, spectra or lines are computed:
| O | ≥ 30000 | F | 6000 – 7500 |
|---|---|---|---|
| B | 10000 – 30000 | G | 5200 – 6000 |
| A | 7500 – 10000 | K | 3700 – 5200 |
| M | below 3700 |
Every object is assigned luminosity class V, because every model is zero-age by construction. The program cannot produce giants, since a giant is a later stage of a star's evolution and the model has no time coordinate.
Burn temperature
The reported burn temperature is Tc, the central temperature of the converged model. The channel shown beside it is the largest of the four rates at the centre. Both are taken directly from the solution.
Hydrogen-burning lifetime
The lifetime is the ratio of fuel to burning rate, calibrated so that the Sun gives about 10 Gyr. It assumes that L and the composition remain exactly as in the model, which is not true of any real star: luminosity rises as the core composition changes, so real main-sequence lifetimes are shorter. The value is an estimate accurate to a factor of a few. No lifetime is shown for models that are not burning hydrogen, for which the formula has no meaning.
Minimum hydrogen-burning mass
This is the only case in which a value from outside the integration determines which branch is reported. The solver can find a thermal-equilibrium solution for a 0.05 M☉ object, and such a state does satisfy the equations, but contraction cannot reach it, because degeneracy halts the object first. Determining this from first principles would require a brown-dwarf equation of state, which the program does not have, so the standard value is used, scaled with hydrogen content:
A lower hydrogen fraction raises the required mass, and a very metal-poor composition raises it slightly further. Below Mmin the cold structure is reported instead, and the object is classified as a brown dwarf. The 13 MJ deuterium limit is applied in the same way, as a classification boundary rather than as a physical calculation.
7 · Examples
The values below were produced by the solver, not taken from a reference table.
1 M☉, solar
MAIN-SEQUENCE ANALOGUE — G V
R = 0.922 R☉ · L = 0.708 L☉ · T_eff = 5515 K
T_c = 1.31×10⁷ K · ρ_c = 9.54×10⁴ kg/m³
channel pp · t_H = 14.1 Gyr · β = 0.9996
The calibration case. The radius is within 8% of the zero-age Sun, Teff is about 5% low, the central conditions are within 10% of a full solar model, and the lifetime is somewhat above 10 Gyr. Only the opacity constant was tuned; all other values follow from the physics.
0.03 M☉, solar
BROWN DWARF — NO HYDROGEN BURNING
R = 0.152 R☉ · L, T_eff undefined
T_c = 1.07×10⁶ K · ρ_c = 7.25×10⁴ kg/m³
degenerate P fraction 0.65 · η = 4.4
Contraction stops at about one million kelvin. Degeneracy takes over the support well before the pp chain becomes significant, and the object never ignites. No luminosity or Teff is reported, because such an object radiates only residual heat and the model includes no cooling. The disk is drawn as a dark body.
1 M☉, Z = 0.99, tiny X
HYDROGEN BURNING, HYDROGEN POOR
R = 1.31 R☉ · L = 43.8 L☉ · T_eff = 12950 K
T_c = 2.55×10⁷ K · μ = 1.97 · no MK class
t_H = 1.6 Myr
This model is not a metal ball. Although X = 0.005 is only a trace, the CNO rate scales with both X and the catalyst abundance, which is very high at Z = 0.99. The trace hydrogen therefore burns rapidly and is exhausted in under two million years. The result is a short-lived burning phase rather than a star, and is assigned no spectral type. With no hydrogen at all, the same mass ignites carbon instead; at half the mass, the result is a degenerate metal ball with no burning.
120 M☉, Z = 0.5
MAIN-SEQUENCE ANALOGUE — O V
R = 23.7 R☉ · L = 4.2×10⁵ L☉ · T_eff = 30088 K
β = 0.358 — 64% of the central pressure is radiation
L / L_Edd = 0.069
A strongly radiation-dominated model, in which gas supplies only about a third of the central pressure. It does not fail and does not become a black hole: high Z alone is not a collapse mechanism, and the program has no means of computing one. The luminosity is about 7% of the Eddington value, lower than for a real 120 M☉ star, for the reason given in §8.
0.6 M☉, C/O
WHITE-DWARF-LIKE (DEGENERATE)
R = 0.0150 R☉ · ρ_c = 1.73×10⁹ kg/m³
degenerate P fraction 0.85 · M_Ch = 1.44 M☉
The Chandrasekhar equation of state produces this result without special treatment: a radius of 0.015 R☉ is close to that of a real 0.6 M☉ white dwarf. The model represents the object at the peak of contraction rather than after several gigayears of cooling, a distinction the model cannot make, so its central temperature is much higher than a real white dwarf's.
5 × 10⁴ M☉, C/O
COLLAPSES TO A BLACK HOLE — GR INSTABILITY
R_s = 1.48×10¹¹ m · 2GM/Rc² = 0.0134
Γ₁ = 1.33511, needs > 1.34834 to be stable
β = 0.0106 — radiation carries 98.9%
This model collapses, but not because of its metal content. Radiation supplies 99% of the central pressure, which holds Γ1 just above 4/3, below what general relativity requires at this compactness. The model is still burning carbon at 1.2×10⁹ K, with a luminosity of 2.6×10⁸ L☉, at the point of instability. Below about 6×10³ M☉ the same composition is stable.
1 M☉, helium star
HELIUM BURNING (TRIPLE-ALPHA)
R = 0.210 R☉ · L = 34.8 L☉ · T_eff = 30561 K
T_c = 1.24×10⁸ K · no MK class, no t_H
With no hydrogen available, the model contracts until the triple-alpha process ignites at just over 108 K, producing a compact, hot, blue object. The program contains no special case for helium stars; removing the hydrogen is sufficient.
8 · Limitations
The following simplifications are deliberate. They are listed approximately in order of their effect on the results.
- Energy transport is not solved. Temperature is tied to density by a fixed polytrope rather than
by radiative diffusion and convection. This is the largest source of error, with two main consequences:
- Low-mass stars are poorly reproduced. Below about 0.4 M☉, real stars are fully convective, and their radii are set by the adiabat and the photosphere. Under n = 3 stratification a 0.2 M☉ model is about three times too large and far too faint, giving a Teff near 800 K instead of 3200 K. The results panel displays a note in this regime, and results for M dwarfs are unreliable.
- Massive stars are too cool and too large. At around 30 M☉ the radius is about 40% too large and the luminosity is off by a factor of a few, which amounts to about one spectral class. Their cores are convective, but the model treats them as radiative.
- There is no atmosphere. The integration stops where the pressure falls to zero, and there is no photosphere or τ = 2/3 surface. Teff is calculated afterwards from . The outermost points of the T(r) plot are therefore not physically meaningful: that part of the curve reflects the polytrope reaching zero density, not a real temperature structure, and the model's Teff does not appear on it.
- Opacity follows Kramers' law. A power law replaces an opacity table, with one uncertain constant tuned to the Sun. It omits H− opacity, molecular opacity, conduction and all opacity bumps. It diverges at low temperature, where real Rosseland mean opacities saturate, which accounts for much of the error at low mass.
- Composition is uniform. Real stars develop a composition gradient as soon as burning begins, and the core value of μ drives most main-sequence evolution. Here the composition is the same throughout and does not change, which is exactly true at zero age and untrue at any later time.
- Energy generation is approximate. There are four rates, with no network, screening corrections or branching. Metals are treated as carbon for burning and as CNO catalysts at Z/2 for the cycle. The carbon rate has a plausible shape and ignition temperature, and should be read as an on/off indicator.
- Electron pressure uses a smooth maximum. The ideal and degenerate pressures are combined as (a⁴ + b⁴)1/4 instead of by a Fermi–Dirac integral. This is correct in both limits but about 19% too high at the crossover, which is the regime of brown dwarfs.
- ∇ad ignores ionisation. The gas-and-radiation formula is used everywhere. In real partial-ionisation zones ∇ad falls to about 0.1, which is a major reason simple models cannot produce a reasonable photosphere, and one reason this model does not attempt to.
- Gravity is Newtonian. The collapse tests in §5 are relativistic corrections applied to a Newtonian solution. They are adequate to determine whether a configuration is stable, but not to describe one that is not. Where 2GM/Rc² exceeds about 0.1, the reported radius and temperature are reliable at best to an order of magnitude, and the results panel states this.
- Neutrons are not included. There is no neutron degeneracy pressure, no nuclear force and no electron capture. The equation of state ceases to describe matter at around 10¹⁰ kg/m³, and the program flags this rather than extrapolating.
- Rotation, magnetic fields, mass loss, binarity and time are absent, rather than approximated.
9 · Symbols
Mtotal mass, the input [kg, displayed in M☉ or M_J]m(r)mass enclosed inside radius r [kg]Rradius where the pressure runs out [m]ρ, ρ_cdensity, central density [kg/m³]P, P_cpressure, central pressure [Pa]T, T_ctemperature, central temperature [K]T_effeffective temperature from L = 4πR²σT_eff⁴ [K]Lluminosity, = total nuclear output in equilibrium [W]L_diffluminosity the interior can carry by radiative diffusion [W]L_EddEddington luminosity, 4πcGM/κ_es [W]εnuclear energy generation rate [W/kg]κopacity [m²/kg]X, Y, Zmass fractions of H, He, metals; renormalised to sum to 1μ, μ_e, μ_Imean molecular weight: all particles, per electron, per ionβgas fraction of pressure, (P_ion + P_e)/P; 1 − β is radiationηdegeneracy parameter, E_F/kTxrelativity parameter, p_F/m_e cneffective polytropic index: 3 burning, 3/2 cold∇_adadiabatic gradient, dlnT/dlnPq(r)fraction of the nuclear luminosity generated inside rM_ChChandrasekhar mass, 1.44 M☉ × (2/μ_e)²R_sSchwarzschild radius, 2GM/c² [m]2GM/Rc²compactness; 1 means the object is at its own horizonΓ₁first adiabatic exponent; 4/3 is marginal stabilityt_Hhydrogen-burning lifetime at fixed L and fixed mix [yr]a, σradiation constant, Stefan–Boltzmann constant