HPC Tier Module

Lane-Emden Stellar Structure Solver

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

Worked example: n = 0 (uniform density, exact sqrt6)
Inputs
Polytropic index n0
RK4 step size h (in xi)0.001
Max xi to integrate to5
Result

n = 0 polytrope: surface at xi_1 = 2.449490, mass weight -xi_1^2 theta'(xi_1) = 4.897032 (closed-form xi_1 = 2.449490, error 1.11e-7). GeoNum conditioning verdict VALID (worst drift 7.08/2048) - a conditioning signal, not extra precision; the f64 xi_1 is what RK4 computed.

Polytropic index n0
First zero xi_1 (surface)2.449490
Mass weight -xi_1^2 theta'(xi_1)4.897032
theta'(xi_1) at surface-0.816172
Reference xi_1 (closed form)2.449490
Reference mass weight4.898979
|xi_1 error vs reference|1.106e-7
|mass-weight error vs reference|1.948e-3
RK4 step h0.001
Steps integrated2450
Max GeoNum drift (shades)7.08 / 2048
Trust verdictVALID

Computed by Lane-Emden Stellar Structure Solver v1.0.0, the same plugin code the GDBS app runs, when this page was built. To run it on your own figures, open it in GDBS HPC.

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

Get an email when tools like this one change

Leave your email and we will tell you when we add or update Numerics & Tools tools like this one, at most once a month.

We email you once to confirm. After that, unsubscribe from any issue in one click. Your address goes to VaultSync only (privacy).

Related tools

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