⭐ Stellar Interior Structure

Solve the stellar structure equations (mass, pressure, luminosity, temperature gradients) for polytrope models n=0,1,3. Lane-Emden equation θ″ + (2/ξ)θ′ + θⁿ = 0 governs density profile.

SpaceInteractive
Radial profiles of stellar interior structure · Change view to explore different quantities

How it Works

This simulation numerically integrates the Lane-Emden equation using a 4th-order Runge-Kutta solver. The polytropic model assumes a simple equation of state P = Kρ^(1+1/n), which allows the four stellar structure equations to be reduced to a single dimensionless ODE.

Starting from the center with θ(0)=1, θ′(0)=0, the solver marches outward in ξ until θ → 0 (the stellar surface). The physical variables (density, pressure, temperature, enclosed mass) are then scaled using the chosen central density and stellar mass.

Lane-Emden ODE: θ″ + (2/ξ)θ′ + θⁿ = 0 Density: ρ(ξ) = ρ_c · θⁿ(ξ) Pressure: P(ξ) = K · ρ_c^(1+1/n) · θ^(n+1)(ξ) Mass enclosed: M(ξ) = 4π · r_n³ · ρ_c · (−ξ²θ′)

Frequently Asked Questions

What is the Lane-Emden equation?

The Lane-Emden equation θ″ + (2/ξ)θ′ + θⁿ = 0 describes the density profile of a self-gravitating polytropic gas sphere, where ξ is the dimensionless radius and n is the polytropic index.

What does the polytropic index n represent?

The polytropic index n relates pressure and density via P ∝ ρ^(1+1/n). n=0 is an incompressible star, n=1 approximates neutron stars, n=3 (Eddington's standard model) approximates radiation-pressure dominated massive stars.

What is hydrostatic equilibrium in a star?

Hydrostatic equilibrium means the inward gravitational force exactly balances the outward pressure gradient: dP/dr = -G·M(r)·ρ/r². This condition prevents the star from collapsing or expanding.

How is mass enclosed computed in stellar models?

The mass enclosed within radius r is found by integrating: dM/dr = 4π·r²·ρ(r). For a polytrope this becomes M(ξ) = 4π·ρ_c·r_n³·(-ξ²·θ′) evaluated at each shell.

What is the central density of a polytrope?

The central density ρ_c is a free parameter set by the total mass of the star. The density profile follows ρ(ξ) = ρ_c·θⁿ(ξ), falling to zero at the surface ξ₁ where θ(ξ₁) = 0.

How does luminosity vary inside a star?

Luminosity increases outward as energy is generated by nuclear burning. dL/dr = 4π·r²·ρ·ε where ε is the energy generation rate per unit mass (typically ε ∝ ρT⁴ for the pp-chain).

What determines the temperature gradient inside a star?

In radiative zones: dT/dr = -(3κρ·L)/(64πσT³r²). In convective zones the temperature gradient follows the adiabatic lapse rate. The transition depends on the Schwarzschild stability criterion.

What is the Eddington standard model?

The Eddington standard model uses a polytrope with index n=3, which corresponds to a star where radiation pressure is significant. It correctly predicts mass-luminosity relations for massive main sequence stars.

Why do stars have layered structures?

Different physical processes dominate at different radii: nuclear burning in the core, radiative energy transport in intermediate zones, and convective envelopes at the surface where opacity is high. Each region has distinct density and temperature profiles.

How accurate are polytrope models for real stars?

Polytropes are simplified models. The n=3 polytrope gives a reasonable approximation for the Sun's density profile. Modern stellar models use detailed opacity tables, nuclear reaction networks, and mixing length theory for convection.

About this simulation

This tool builds a star from the inside out by numerically solving the Lane-Emden equation θ″ + (2/ξ)θ′ + θⁿ = 0 with a 4th-order Runge-Kutta integrator. Instead of tracking mass, pressure, and temperature separately, the polytropic assumption P = Kρ^(1+1/n) collapses all four stellar structure equations into this single dimensionless ODE, which is marched outward from the center (θ=1) until the dimensionless density θ hits zero at the stellar surface ξ₁.

🔬 What it shows

A radial profile chart of density, pressure, temperature, or luminosity across the star's interior, computed from the Lane-Emden solution and rescaled using your chosen central density and stellar mass.

🎮 How to use

Pick a polytropic index n (0, 1, or 3) from the dropdown, then drag the central density ρ_c and star mass M/M☉ sliders. Switch the View selector between density, pressure, temperature, and luminosity, or hit Reset to rebuild the profile from scratch.

💡 Did you know?

The n=3 "Eddington standard model" isn't arbitrary — it emerges naturally when radiation pressure dominates, which is why it gives a surprisingly good approximation of the Sun's own density profile.

Frequently asked questions

Why does the simulation use a dimensionless equation instead of real units?

The Lane-Emden equation trades radius r and density ρ for dimensionless ξ and θ, which removes the star's specific mass and central density from the physics. Once θ(ξ) is solved once per polytropic index, the same solution can be rescaled instantly for any mass or central density slider you pick — that's why moving the sliders updates the chart without re-running the ODE solver.

What does changing the polytropic index n actually change in the model?

n sets the exponent in the equation of state P ∝ ρ^(1+1/n), which changes how "stiff" the gas is against compression. n=0 gives a uniform-density incompressible sphere, n=1 approximates a neutron star, and n=3 (Eddington's model) approximates a radiation-pressure-dominated massive star — you can see the density profile become more centrally concentrated as n increases.

Why does raising the central density slider change the surface temperature and pressure readouts?

The stat panel's T_c and P_c are derived from ρ_c and the total mass via the scaling relations rn, R, Pc and Tc computed in rebuild(). Because pressure and temperature depend on ρ_c through G·M²/R⁴-type terms, even a modest change in central density shifts the whole physical scale of the model, not just the core.

Why does the star's radius shrink when I increase ρ_c?

For a fixed mass, packing that mass into a denser core means less volume is needed to contain it, so the derived radius R = ξ₁·rn shrinks. This mirrors real degenerate stars like white dwarfs, where higher density is associated with a smaller physical radius for the same mass.

Is the luminosity view physically exact?

No — the simulation approximates the luminosity profile using the same θ^(n+1) shape as pressure, as a simplified stand-in for the true energy-generation integral dL/dr = 4π·r²·ρ·ε. A full stellar model would need a separate nuclear energy generation law and opacity table to get L(r) exactly right.