HPC Tier Module

Lane-Emden Stellar Structure Solver

Integrate the Lane-Emden polytrope with RK4, validated against the exact n=0, 1, 5 solutions.

See it run - a worked example, 100% in this browser tab

The problem

Studying polytropic stellar structure usually means setting up an ODE integrator from scratch and hand-checking the singular origin and the surface zero - easy places to introduce a quiet error.

The local-first solution

This solver integrates the dimensionless Lane-Emden equation with RK4 in your browser, starts off the singular origin with the exact even Taylor series, locates the first zero and mass weight, and validates against the closed-form n=0, 1, 5 solutions. Deterministic f64 math, nothing uploaded.

What it does

RK4 integration of the Lane-Emden first-order system for a given polytropic index n
Exact origin Taylor series start to remove the singular 0/0 at xi=0
First-zero surface detection xi_1 and the dimensionless mass weight -xi_1^2 theta'
Validation against the exact n=0 (sqrt 6), n=1 (pi), and n=5 (no finite zero) solutions
Cited cross-check tables (Chandrasekhar 1939, Horedt 2004) for non-integrable indices
GeoNum drift probe flagging conditioning loss near the origin and the surface

Honest scope

EXACT: the Lane-Emden ODE, the origin Taylor series, RK4 (O(h^4) truncation), and the closed-form n=0/1/5 references; the reported xi_1 and mass weight are the f64 RK4 values with their error versus the analytic answer shown. Tabulated (xi_1, mass) pairs for n=1.5, 3, etc. are cited confirm-by-source values, never invented. NOT modeled: rotation, magnetic fields, GR (TOV) corrections, or multi-zone polytropes. A teaching/verification tool, not stellar-evolution advice.

Authorities cited

Integrate a polytrope with proof

Run the solve in your browser with nothing uploaded, then save the profile and validation errors to a Sandbox workspace or attach them to a Worklog case.

GDBS by VaultSync Solutions Inc. - Verifiable Computation. gdbs.getvaultsync.com