# Stellar interiors: reproduce the saved models

这些材料让你检查实际保存的恒星内部，重算合成测量的条件年龄。它们不是 MESA 安装包，也不会在浏览器中求解恒星演化。解压 `stellar-evolution-science.zip` 后，进入 `stellar-evolution-science/`；所有命令都在此目录执行。运行时不需要网络。

These materials inspect actual saved stellar interiors and reproduce an age interval for a synthetic measurement. They do not install MESA or solve a new evolutionary track. Unpack the archive and run the following commands from `stellar-evolution-science/`. No network is used by these commands.

## Reproduce

Reference environment: Python 3.12.12, NumPy 2.4.4. Matplotlib 3.10.8 is needed only to regenerate PNG figures. Python's standard library handles XZ, ZIP, hashes and tests. NumPy is the only numerical dependency.

```sh
python verify_package.py
python -W error scripts/astronomy/ac25/run_reference.py
python -W error scripts/astronomy/ac25/run_extended_reference.py
python -W error scripts/astronomy/ac25/test_reference.py
python -W error scripts/astronomy/ac25/test_extended_reference.py
python -W error scripts/astronomy/ac25/generate_app_reference.py --view-data docs/astronomy/ac25/native-atlas.json --out app-reference-replayed.json
```

The first command verifies every listed member's exact bytes and SHA-256 before analysis. Each reference also verifies original scientific inputs. The two test commands run nine tests each. The final command independently reads raw MESA tables and compares all twelve view states and thirty-two known-native-model/observation/prior combinations. The expected output is `docs/astronomy/ac25/app-reference-results.json`. Reference reports contain file paths; a new extraction root changes those paths without changing the scientific values.

Optional figures and view regeneration:

```sh
python scripts/astronomy/ac25/make_figures.py
python scripts/astronomy/ac25/make_extended_figures.py
python scripts/astronomy/ac25/generate_native_atlas.py --out regenerated-view
```

Both `regenerated-view/native-atlas.json` and the shipped scientific view data are generated from exact licensed inputs. They contain data only. Website Engine and app TypeScript are excluded from this package.

## Twelve interiors, six histories, separate clocks

- Four rotating hydrogen-burning cases: initial 10 or 12 solar masses, Solar (`Z=0.014`) or SMC (`Z=0.002607577069088594`) mixture; Keszthelyi, Zenodo **7069766**. The mixtures also change helium and individual element ratios. All four selected profiles are native mid-main-sequence outputs, including default model **236** for 10 solar masses/Solar mixture. The initial rotation ratio is 0.5; NOMAG means no magnetic prescription, not zero rotation. The actual source inlists override stale header composition defaults.
- Five independent helium-burning interiors: native models 1, 84, 162, 205, 263, initial 4 solar masses and `Z=0.02`; Thoul & Chidester, Zenodo **7082536**. This calculation imports an already helium-burning model and resets its clock. It ends at terminal core helium burning.
- Three independent white-dwarf interiors: native models 100, 250, 287, actual current mass about **0.7856 solar masses**; Kumar & Townsley, Zenodo **17765239**. The imported white dwarf has its own reset clock. Header defaults of initial mass 1 and `Z=0.02` do not identify its progenitor. The failed imported model 1 remains in the source/reference evidence and is excluded from the atlas.

这十二张剖面没有被拼成一颗恒星的谱系。主序、氦燃烧、白矮星分别保留自己的计算来源与时钟。没有连续质量、金属丰度或内部剖面插值。氦燃烧和白矮星病例不做年龄反演。

The atlas does not join these cases into a progenitor-to-remnant history. It does not interpolate mass, composition or internal structure. The scientific view retains all native radial zones at twelve significant digits; the independent reference measures its rounding error. An HR track can contain more saved times than saved interiors. Moving a synthetic measurement changes the conditional age distribution, never the selected native interior's identity.

The earlier 15-solar-mass, `Z=0.02` convergence experiment is a separate teaching source, MESA School Leuven 2025 at commit `ade5bca00e5caae97ac0b6f880f1de7ccead1553`. It is not a mass/metallicity grid or a remnant calculation.

## Quantities and checks

MESA profile rows run surface to centre. `mass` and `radius` use the solar units recorded by the source; logarithmic temperature, density and pressure are base ten in K, g cm^-3 and dyn cm^-2. Reaction columns are linear erg g^-1 s^-1 in profiles; massive-history `pp` and `cno` are log10 solar luminosities. `star_age` is years. The original wind `star_mdot` is negative for loss. The reference converts signs/units explicitly. See both member manifests for source-specific columns and sizes.

The reference matches profile model number, history age and profile index; checks shell mass/species integrals, Stefan–Boltzmann surface coordinates, hydrostatic differences including the recorded rotation factor, hydrogen heating, accepted-step wind loss, and an independently derived uniform-sphere gravitational-energy benchmark. These checks test named relations with stated numerical limits; they do not establish complete stellar energy conservation.

For the synthetic inverse problem, initial mass, composition, rotation, mixing and wind prescription are assumed known. Gaussian errors are stipulated at 0.01 dex in log temperature and 0.05 dex in log luminosity. The supported native main-sequence branch has core hydrogen at least 0.01 and finite positive age limits. The reference integrates probability in **physical years**, with proper uniform-age or uniform-log-age priors. It does not distribute probability equally among adaptive time-step rows. There are no real-star observational constraints in this exercise.

## Failures retained

- The earlier 15-solar-mass resolution sequences disagree at their late hydrogen-return behaviour. Finer output is not a validated endpoint.
- A withheld native 11-solar-mass Solar-composition model exposes strong undercoverage when fitted by four neighbouring native cases. In 300 synthetic trials, nominal 68% and 95% intervals contain the truth only **68** and **189** times; all minimum-distance screens still pass. The app therefore permits age inversion only conditional on the selected known native mass/composition model.
- Interpolating the withheld LMC case in linear or log metallicity can bring two surface coordinates closer while changing the age error in a different direction. These simple tests do not validate MIST interpolation or internal-profile interpolation.
- The first imported WD profile has a source-versus-surface discrepancy about **−633** times the surface luminosity. It remains a failed test case. Later snapshots have small instantaneous residuals, yet the late finite global-energy comparison (564–912 Myr on the reset clock) still differs by about **5.75%**. No precise cooling-age calibration or complete-energy badge follows from these data.

失败数值与全部合成试验逐行保留，方便更换假设后重算。程序没有把离散模型差别塞进额外高斯噪声，以便让卡方看起来合格。

## Sources and licenses

`include-manifest.json` lists every packaged member's bytes, SHA-256, license and source path. It excludes itself to avoid a circular hash. The archive is a fixed allowlist; no Engine, app TypeScript, installation, unlicensed NuGrid data, full upstream multi-model archive or exploratory HDF5 dependency is included.

- Keszthelyi, *The effects of surface fossil magnetic fields on massive star evolution IV*, fixed [Zenodo 7069766](https://doi.org/10.5281/zenodo.7069766): original data and author material **CC BY 4.0**, [license](https://creativecommons.org/licenses/by/4.0/). The original `run_star_extras.f90` embeds **Copyright (C) 2010 Bill Paxton**, GNU Library General Public License **version 2 or later**. Its original source bytes/header and `LICENSE-LGPL-2.0.txt` are retained. The record's CC BY statement does not replace that upstream software license. The fixed author `scripts.zip` is retained unchanged as evidence for the relative 0.3% hydrogen threshold; it is not executed by our reference.
- Anne Thoul & Morgan Chidester, *Fun and Games with Convective Boundaries*, fixed [Zenodo 7082536](https://doi.org/10.5281/zenodo.7082536): **CC BY 4.0**.
- Praphull Kumar & Dean Townsley, *Unified gravity mode and Rossby mode Analysis of Accreting White Dwarf Stars*, fixed [Zenodo 17765239](https://doi.org/10.5281/zenodo.17765239): **CC BY 4.0**. Source metadata and work-directory version are retained; the model headers are authoritative for their actual MESA revision.
- Jared Goldberg, MESA School Leuven 2025 Friday necessary practices, hosted by Vincent Vanlaer and contributors at the fixed commit above: **CC BY-SA 4.0**; original full license is included at `docs/astronomy/ac25/research/school25-LICENSE.txt`. Source data are losslessly compressed without numerical modification; our derived convergence figures/results retain CC BY-SA 4.0 attribution.
- Newly written standalone Python and `verify_package.py`: **MIT**, see `LICENSE-code.txt`. This license covers only that new code. Original data/source/publications keep their own terms. Native atlas view data and new native-model figures: **CC BY 4.0**, adaptations with the author attributions above. This README is CC BY 4.0, Sandbox Physics 2026.

Original members are retained losslessly as XZ where stated. Source member hashes always refer to original decompressed bytes; stored-container hashes are separate. New plots, inferred intervals and view serialization are adaptations, never original MESA output labels.

## Reading route

1. Why more fuel can still mean a shorter life — pressure, luminosity and usable core fuel.
2. How pressure holds up a star — radial force balance, mass coordinate and a solved uniform sphere.
3. How heat crosses a star — radiative diffusion and buoyant parcels.
4. Read a stellar track by following the fuel — hydrogen/wind accounting, independent helium and WD cases.
5. Reproduce the native MESA output and conditional age — this package's calculations.
6. Where stellar-model uncertainty enters — convective boundaries, metallicity-dependent winds, interpolation and late energy tests.

Full bilingual lessons: [Stellar evolution](https://sandboxphysics.com/stories/stellar-evolution/).
