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
- Chandrasekhar, S. (1939). An Introduction to the Study of Stellar Structure, Ch. IV. Univ. of Chicago Press (Dover reprint 1958). - The Lane-Emden equation (IV.1), origin series (IV.10), closed forms for n = 0, 1, 5 (IV.2), and the (xi_1, -xi_1^2 theta') table (Table 4).
- Lane, J. H. (1870). On the Theoretical Temperature of the Sun. American Journal of Science 50, 57-74. - Original formulation of the polytropic gas-sphere equation.
- Emden, R. (1907). Gaskugeln. B. G. Teubner, Leipzig. - Systematic study of polytropic gas spheres (the "Emden functions").
- Horedt, G. P. (2004). Polytropes: Applications in Astrophysics and Related Fields. Astrophysics and Space Science Library 306, Kluwer. - eqn 2.1.2 (Lane-Emden), Table 2.5.1 tabulated (xi_1, -xi_1^2 theta') to high precision.
- Kippenhahn, R., Weigert, A., Weiss, A. (2012). Stellar Structure and Evolution, 2nd ed., Ch. 19 (Polytropic Stellar Models). Springer. DOI 10.1007/978-3-642-30304-3.
- Press, W. H. et al. (2007). Numerical Recipes, 3rd ed., Sec. 17.1 - classical fourth-order Runge-Kutta (RK4), local truncation error O(h^5) / global O(h^4).
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.