Chapter 5 · Section 5
The Initial Mass Function
The BPT law
BPT Part 2.9 states the Initial Mass Function: dN/dM = ξ₀·(M/M☉)^(−α), "how many stars are born at each mass: a few heavy ones, a great many light ones", where ξ₀ is "how much gas the region turned into stars" and the slope α is 2.35 above about 0.5 M☉ (Salpeter 1955) and 1.3 from 0.08 to 0.5 M☉ (Kroupa 2001). "Counted by number, about three stars in four are red dwarfs, about one in eight is Sun-like or heavier, and about one in six hundred is massive enough to end as a black hole." BPT Part 2.10 takes its mean birth mass, "near 0.42 Suns (Kroupa, 2001)", into the law of Protons in a Star, and BPT Part 6.10 (Stellar Null Well Fraction) integrates it: 76 % of stars red dwarfs and 1.3–1.8 × 10⁻³ ending as wells, with the heaviest stars M⇑ ≈ 150 M☉.
For the first stars, BPT Part 2.9 (Generations and Feedback) says Population III "formed from metal-free gas that could barely cool, so its stars were massive, tens to hundreds of Suns". BPT Part 3.12's game reading makes it a rule: "A cloud with fewer metals than the critical metallicity makes stars of ten to three hundred Suns."
The established physics
- Kroupa (2001): slopes 0.3 (0.01–0.08 M☉), 1.3 (0.08–0.5), 2.3 (above 0.5).
- Salpeter (1955): slope 2.35.
- Population III: metal-free gas cools through H₂ to about 200 K and makes stars of tens to hundreds of Suns (Bromm & Larson 2004; Hirano et al. 2014); the critical metallicity (Bromm et al. 2001).
The game's math
Ordinary gas (cloud metals Z ≥ Z_crit, Z_CRIT heat.js:36). imfTable(150) stars.js:62 builds three power-law segments from IMF_SEGS stars.js:61, [0.013, 0.08] slope 0.3, [0.08, 0.5] slope 1.3, [0.5, 150] slope 2.3, joined continuously at the breaks (k ← k·lo^(a − a_prev)), each with weight w = k·(hi^(1−a) − lo^(1−a))/(1 − a).
Metal-free gas (Z < Z_crit). popIIITable() stars.js:76: one segment, [10, 300], slope 2.35.
sampleIMF(u, metalFree) stars.js:78: x = u·total; pick the segment where x falls; invert its power law:
m = [ lo^(1−a) + f·(hi^(1−a) − lo^(1−a)) ]^(1/(1−a)), f = x / w
The uniform u comes from draw(seed, n) stars.js:92, a hash of the body's seed and the running count of stars formed, so a replay draws the same masses.
MEAN_MASS stars.js:130 is the midpoint-rule mean of 4,000 draws (u = (i + 0.5)/4000) for each table. Computed here from the code's own formulas (not measured in a run): 0.390 Suns for ordinary gas and 27.1 Suns for metal-free gas.
Computed the same way, the share of drawn ordinary stars by class: brown dwarfs 33.5 %, M 51.1 %, K 7.0 %, G 3.4 %, F 2.4 %, A 2.1 %, B 0.32 %, O 0.084 %, III 0.002 %. Of the hydrogen-burning stars, 77 % are red dwarfs and 0.13 % are 25 Suns or more, against BPT Part 6.10's 76 % and 1.3–1.8 × 10⁻³: the game's draw agrees with the book's integral.
In the game
The function is what gives the sky its proportions. Of every hundred points of starlight in an ordinary population about half are small dim red dwarfs, a third are faint brown dwarfs, and only one or two are the large blue-white points of A stars and heavier; the HUD's class counts show the same steep fall from M to O.
The first generation looks different. While a cloud is below the critical metallicity its stars are drawn from 10 to 300 Suns, so the first stars a universe lights are all large blue-white B, O and Population III points, and its first supernovae follow at once: the mean metal-free star, 27 Suns, lives under a fiftieth of a Tempo, and even the lightest, 10 Suns, about two Tempos on desktop (Part 5.6). Once supernovae have returned metals to a cloud (Part 5.10), its next stars are drawn from the Kroupa function and the small red points appear. A tap in a galaxy shows which gas it is: "metals none yet" while its gas is under a hundredth of the Sun's metals, otherwise "metals X of the Sun's" (app.js:2994).
The scale model
Exact: no scale model. Every drawn star's mass is drawn from the whole function; lots (Part 5.8) share one draw.
Where the game and the theory differ
- The book's mean birth mass of 0.42 Suns (BPT Part 2.10) and the code's 0.390 differ because the code's lower end is 0.013 Suns, not 0.01 or 0.08, and its sampler includes brown dwarfs. The law's 925 uses 0.42; the Sun's size uses 0.39 (Part 5.3).
- The code's comment says the first Kroupa slope runs from 0.01 M☉ (stars.js:58);
IMF_SEGSstarts at 0.013 (stars.js:61).
Fixed numbers
| Number | Where | What it is | Kind |
|---|---|---|---|
| 0.013 | IMF_SEGS stars.js:61 |
Lowest birth mass | PHYSICS (deuterium-burning limit, BPT Part 2.9) |
| 0.08, 0.5 | IMF_SEGS stars.js:61 |
Kroupa break masses | PHYSICS (Kroupa 2001) |
| 0.3, 1.3, 2.3 | IMF_SEGS stars.js:61 |
Kroupa slopes | PHYSICS (Kroupa 2001) |
| 150 | IMF stars.js:77 |
Highest birth mass, ordinary gas | PHYSICS (BPT Part 6.10, M⇑ ≈ 150 M☉) |
| 10, 300 | popIIITable() stars.js:76 |
Range of metal-free birth masses | PHYSICS (Bromm & Larson 2004; Hirano et al. 2014) |
| 2.35 | popIIITable() stars.js:76 |
Metal-free slope | PHYSICS (Salpeter 1955; named as the one choice) |
| 1 | stars.js:88 | Fallback mass | METHOD |
| 4000, 0.5 | MEAN_MASS stars.js:130 |
Midpoint draws for the mean | METHOD |
| 0x9e3779b9, 2654435761, 40503, 15, 7, 14, 61, 4294967296 | draw() stars.js:93–95 |
Hash for reproducible draws | METHOD |