1. Motivation: a star as a boundary-value problem

Of the Sun we see the photosphere: its luminosity W, its radius m and, from planetary dynamics, its mass kg (IAU 2015 nominal values). None of this tells us directly what the temperature is at the center, what the density is, or how energy is transported. Nevertheless, since Eddington (1926) we have known that four ordinary differential equations, together with an equation of state, an opacity and an energy-generation rate, suffice to build a model of the entire interior. The resulting standard solar model predicts neutrino fluxes and sound speeds that helioseismology and neutrino detectors have verified to a precision of order 1 %.
This lesson derives the four equations and the boundary conditions and, before solving anything, shows how far dimensional analysis reaches: the central temperature of the Sun is estimated with a 12 % error without integrating a single equation.
2. Assumptions and variables

We shall assume a spherical star (with no appreciable rotation or magnetic field), isolated and in a quasi-static state: the quantities change on timescales very long compared with the dynamical timescale (§7). The variables are functions of the distance from the center :
| Symbol | Quantity | SI unit |
|---|---|---|
| mass contained within the sphere of radius | kg | |
| density | kg m⁻³ | |
| total pressure (gas + radiation) | Pa | |
| temperature | K | |
| luminosity crossing the sphere of radius | W | |
| nuclear energy released per unit mass and time | W kg⁻¹ | |
| mean opacity (cross section per unit mass) | m² kg⁻¹ |
3. The four equations

3.1 Mass continuity
The mass of a spherical shell of thickness is :
3.2 Hydrostatic equilibrium
Consider a cylinder of fluid with base and height at distance from the center. Acting on it are the pressure on the base, , outward; the pressure on the top, , inward; and gravity. By Newton’s theorem for spherical distributions, only the interior mass contributes, with acceleration . Newton’s second law for the mass element is
In equilibrium () we obtain the equation of hydrostatic equilibrium:
The pressure decreases outward; the pressure gradient supports each layer against the weight of the matter above it. If (2) ceases to hold, the star responds on the dynamical timescale (§7), which for the Sun is half an hour: this is why a “normal” star is always in hydrostatic equilibrium to enormous precision.
3.3 Energy conservation
Let be the energy released by nuclear reactions per unit mass and time, and the energy carried away by neutrinos (which escape without interacting). The shell receives through its inner face and emits through the outer one; if in addition its specific entropy changes, it absorbs or releases heat per unit mass. The first law gives
In thermal equilibrium () the luminosity grows exactly with the nuclear energy generated: . The entropy term is essential in phases of contraction or expansion (pre-main sequence, giants) and is sometimes called the “gravitational luminosity”.
3.4 Energy transport
Energy flows from the inside outward because there is a temperature gradient. There are three mechanisms:
- Radiation. Photons diffuse through an opaque medium. In lesson 2 it is derived that the flux is , with J m⁻³ K⁻⁴ the radiation constant and the Stefan–Boltzmann constant. Since ,
- Convection. When the required radiative gradient is too steep, the gas becomes unstable (Schwarzschild criterion, lesson 2) and macroscopic bubbles transport the heat. In the deep interior the actual gradient stays very close to the adiabatic one: with the adiabatic exponent ( for an ideal monatomic gas).
- Conduction. Negligible in normal stars; it dominates in degenerate matter (white dwarfs, lesson 4), where it is incorporated into (4a) as an effective conductive opacity.
It is convenient to write both cases with the logarithmic gradient :
The expression for is obtained by dividing (4a) by (2) (exercise 1).
3.5 Closure relations
Equations (1)–(4) contain five unknown functions () and three “material functions” that depend on the chemical composition (mass fractions of hydrogen , helium and metals ):
For an ideal gas plus radiation,
where is the Boltzmann constant, the atomic mass unit and the mean molecular weight (mean mass per particle in units of ). For the solar surface mixture , , , .
4. Boundary conditions

The system (1)–(4) is of fourth order, so four conditions are needed. They are not all at the same point: it is a two-point boundary-value problem.
At the center ():
Both follow from regularity: the mass and luminosity enclosed within a sphere of zero radius are zero. From (1) and (3) it follows that near the center and , and from (2) that : the pressure and temperature have a flat maximum at the center, .
At the surface (): the simplest approximation is the “zero surface”,
which is excellent for the interior because the surface pressure and temperature are negligible compared with the central ones (). A finer model imposes photospheric conditions: in the layer of optical depth the temperature is the effective temperature, with , and the pressure is obtained by integrating (2) with downward from : with .
Vogt–Russell theorem. Once the mass and the composition are fixed, the system (1)–(4) with (6)–(7) determines (in general uniquely) , and the entire internal structure. It is not a rigorous mathematical theorem (there exist counterexamples with multiple solutions), but it explains why the main sequence is a one-parameter family: each mass fixes a point of the H–R diagram.
5. Lagrangian form: mass as the independent variable

Since is monotonically increasing, can be used instead of as the variable. Dividing (2)–(4) by (1):
Three advantages: (i) the domain is fixed in advance (the radius is an unknown of the problem; the domain in is not known until it is solved); (ii) the chemical composition is transported with the mass, not with the radius, so is the natural description in stellar evolution; (iii) the pressure equation no longer contains , which smooths its behavior.
6. Dimensional-analysis estimates versus the standard solar model

Without solving anything, (2) says that drops from to over a distance , with , :
And from (5), neglecting radiation, . For the Sun, with the IAU 2015 nominal values and m³ kg⁻¹ s⁻² (CODATA 2018):
Let us compare with the BP2000 standard solar model (Bahcall, Pinsonneault & Basu 2001, tables 5–6), whose helioseismic and neutrino predictions have been tested against observation:
| Quantity | Dimensional analysis | BP2000 model | Ratio |
|---|---|---|---|
| kg m⁻³ | kg m⁻³ | 108 | |
| Pa | Pa | 21 | |
| K | K | 1.14 |
The temperature comes out surprisingly well (12 % error) while the pressure and density miss by one or two orders of magnitude. The reason is instructive: , and the central concentration () affects numerator and denominator alike. The central temperature of a star is fixed, in order of magnitude, by and nothing else: it is a virial theorem in disguise (§7).
A consistency detail: with the model’s central composition (, , ) equation (5) gives and the ideal-gas temperature K, which agrees with the tabulated value to 0.4 %. The central radiation pressure is Pa, barely 0.07 % of the total: in the Sun radiation does not matter for the equilibrium, although it does for the transport.
The polytrope as a bridge. If the system is closed with (lesson 1), the Lane–Emden equation gives for : kg m⁻³ and Pa, already within a factor of 2 of the full model. Explore it in the simulator: which index best reproduces the central concentration of the Sun?
- ξ₁
- 6.89685
- −ξ₁² θ′(ξ₁)
- 2.01824
- ρ_c / ρ̄
- 54.182
- Sun: ρ_c
- 7.64×10⁴ kg/m³ (0.51 × actual)
- Sun: P_c
- 1.24×10¹⁶ Pa
- Sun: K
- 3.84×10⁹ SI
7. Two rigorous results: the central-pressure bound and the virial theorem

Lower bound on . From (2) and (1), . Integrating from the center to the surface and using :
For the Sun, Pa. It is a weak bound (the true value is 500 times larger) but a rigorous one: it assumes nothing about the equation of state or the transport. With the additional hypothesis that , the mean density interior to , does not increase outward, a better bound is obtained (exercise 3).
Virial theorem. Multiplying (2) by and integrating by parts between and with :
where is the gravitational potential energy. Hence
For an ideal monatomic gas , with the internal energy per unit mass, so that and the total energy is . Two consequences: (i) a star that loses energy heats up (negative heat capacity); (ii) the mean temperature satisfies , whence K for the Sun. This is the justification of the dimensional estimate of §6.
Timescales (all for the Sun, with nominal , , ):
- Dynamical, from (2) without pressure: s ≈ 27 min.
- Thermal or Kelvin–Helmholtz, from (10): s ≈ yr. It is the maximum age the Sun would have if it shone by contraction alone: far too short compared with the geological age, which forced the search for the nuclear source.
- Nuclear, assuming that 10 % of the mass burns hydrogen with efficiency (lesson 3): s ≈ yr.
The hierarchy is what legitimizes the assumptions of §2: on the nuclear timescale, the star is in hydrostatic and (almost always) thermal equilibrium.
8. Numerical analysis: why the system is hard

- Two boundary points. Shooting from the center with trial , and from the surface with trial , , matching at a fitting point, is unstable: near the surface and , and neighboring solutions diverge exponentially. This is why modern codes use the Henyey method (Newton–Raphson relaxation over the whole grid at once), which treats the four conditions simultaneously.
- Stiffness. with (pp) or (CNO), and : the scales of variation of and differ by orders of magnitude. Explicit methods (RK4) need tiny steps; implicit ones (Henyey is implicit by construction) do not.
- Singularities at the endpoints. At there are terms of the type; one starts with the series of §4. At the surface and diverges: one integrates in (equations (8)) or uses the gray atmosphere as the boundary condition.
- Error propagation. A relative uncertainty in the opacity changes in the same proportion (equation 4): Bahcall, Serenelli & Basu (2005) showed that an increase of % in the opacity between and K would suffice to reconcile the low-metallicity models with helioseismology. The structure is more sensitive to the opacity than to any other microphysical ingredient.
Problems
1. Logarithmic radiative gradient. Derive from (4a) and (2).
Show solution
. Substituting (4a) in the numerator and (2) in the denominator: . Note that and cancel: depends on the ratio (energy generated per unit interior mass) and on .
2. Central behavior. Show that near the center and that , with the logarithmic gradient at the center.
Show solution
From (1), . In (2): ; integrating, . For , and integrating yields the result. Both profiles are parabolic and flat at the center, which justifies as regularity conditions.
3. Milne’s bound. Assuming that the interior mean density does not increase with (the star is denser toward the center), show that , three times (9), and that equality holds for uniform density.
Show solution
With : . If for all , then . For uniform density is constant and all the inequalities become equalities (compare with the polytrope of lesson 1). For the Sun: Pa.
4. Virial theorem with radiation pressure. Let be constant throughout the star (Eddington’s standard model). Show that , compute the total energy as a function of and , and discuss the limit .
Show solution
For an ideal gas and for radiation . In (10): . With constant , , so and . When (radiation-dominated) : the star is marginally bound, and a small perturbation unbinds it. This is the physical origin of the instability of very massive stars and of the upper mass limit of the main sequence.
5. Mean temperature of the Sun. Using the virial theorem and for a polytrope (lesson 1, exercise 5), compute for the Sun with and , and compare with of BP2000.
Show solution
For , J. With and : K, about 2.2 times smaller than K. This is reasonable: is mass-weighted and half of the Sun’s mass lies outside , where is already much lower than .
6. (Computational) The Sun as an n = 3 polytrope versus the BP2000 model. Integrate equations (1)–(2) closed with (without using Lane–Emden directly) by shooting on : fix so that and and compare , and (with ) with the table of §6. Estimate the truncation error of the integrator by doubling the step.
Show solution
import numpy as np
G, Msun, Rsun, kB, mu_u = 6.6743e-11, 1.989e30, 6.957e8, 1.380649e-23, 1.66053907e-27
def integrar(rho_c, K, h=2e5):
# y = [m, P]; rho = (P/K)^(3/4); RK4 from r0 with the series of §4
r = h; P_c = K*rho_c**(4/3)
y = np.array([4*np.pi/3*rho_c*r**3, P_c - 2*np.pi/3*G*rho_c**2*r**2])
def f(r, y):
rho = (max(y[1], 0)/K)**0.75
return np.array([4*np.pi*r*r*rho, -G*y[0]*rho/r**2])
while y[1] > 0:
k1 = f(r, y); k2 = f(r+h/2, y+h/2*k1); k3 = f(r+h/2, y+h/2*k2); k4 = f(r+h, y+h*k3)
y = y + h/6*(k1+2*k2+2*k3+k4); r += h
return r, y[0] # radius and mass (the last layer overshoots by < h)
# For n = 3, M does not depend on rho_c: M(K) = 4 pi omega_3 (K/pi G)^1.5. We fix K from M = Msun...
K = np.pi*G*(Msun/(4*np.pi*2.01824))**(2/3)
# ... and rho_c from R = Rsun (bisection: R decreases with rho_c)
lo, hi = 1e3, 1e7
for _ in range(40):
rc = np.sqrt(lo*hi); R, M = integrar(rc, K)
lo, hi = (rc, hi) if R > Rsun else (lo, rc)
print(rc, K*rc**(4/3), K*rc**(1/3)*0.61*mu_u/kB) # rho_c, P_c, T_cExpected result: kg m⁻³, Pa, K. Compared with BP2000: density and pressure at half the value, temperature 24 % low. Repeating with and m, changes by (the dominant error is where is detected, first order in , not the RK4), which is corrected by interpolating the root as in lesson 1.
7. Photosphere. From (2) and , show that if is constant in the atmosphere , and justify the condition at . Evaluate for the Sun with m² kg⁻¹ and compare it with .
Show solution
(with , in the thin atmosphere). Integrating from (): . Eddington’s gray atmosphere gives , so at , and there . Sun: m s⁻², Pa, that is, : the “zero surface” condition is excellent for the interior.
✦ Self-assessment
Further reading
- Kippenhahn, Weigert & Weiss (2012), Stellar Structure and Evolution, ch. 1–2 (mechanical equations and virial theorem), 4–5 (energy and transport), 9–10 (boundary conditions and the Vogt–Russell theorem), 11 (Henyey method).
- Carroll & Ostlie (2017), An Introduction to Modern Astrophysics, §10.1–10.5.
- Hansen, Kawaler & Trimble (2004), Stellar Interiors, ch. 1 (dimensional analysis and timescales) and ch. 7 (numerical methods).
- Eddington (1926), The Internal Constitution of the Stars, ch. IV–VI: the origin of the standard model.
- Bahcall, Pinsonneault & Basu (2001), ApJ 555, 990, DOI 10.1086/321493 — BP2000 model, tables 5–6 (central values used here).
- Bahcall, Serenelli & Basu (2005), ApJ 621, L85, DOI 10.1086/428929; (2006), ApJS 165, 400, DOI 10.1086/504043 — sensitivity of the model to opacities and abundances.
🍎 Teacher guide
- Time
- 2 classes of 90 min
- Learning outcome
- By the end, the student derives the four equations of stellar structure and their boundary conditions, proves the central-pressure bound and the virial theorem, and estimates the central conditions of the Sun by dimensional analysis, justifying the agreement and disagreement with the standard model.
- Evidence of learning
- Submission of computational problem (6) with the comparison table against BP2000 and the truncation-error analysis, plus proofs 3 and 4.
Materials
- Python 3 with NumPy (or a spreadsheet for problem 5)
- Tables 5–6 of Bahcall, Pinsonneault & Basu (2001), printed or projected
- Lane–Emden simulator for the discussion of the central concentration
Suggested sequence
Class 1 (90 min). Opening (15 min): what do we know about the Sun from the outside and what do we want to know about the inside? Brainstorming and list of quantities. Development (60 min): derivation of (1)–(3) on the board with the fluid element; presentation of (4) as “Fourier’s law for photons” (the full derivation is left for lesson 2); equation of state and mean molecular weight; boundary conditions and Lagrangian form. Closing (15 min): dimensional analysis of §6 in groups, each group estimates one quantity and the comparison table against BP2000 is built.
Class 2 (90 min). Opening (10 min): discussion of why T꜀ comes out right and P꜀ wrong. Development (55 min): proof of the bound (9) and of the virial theorem; timescales and the historical problem of the age of the Sun (Kelvin versus geology); Lane–Emden simulator to see how the polytropic index controls the central concentration. Closing (25 min): statement of computational problem 6 and mini-quiz; problems 3 and 4 are submitted in writing.
Note on the data. The central values of the Sun are those of the BP2000 model (Bahcall, Pinsonneault & Basu 2001, tables 5 and 6): T꜀ = 15.696×10⁶ K, ρ꜀ = 152.7 g cm⁻³, P꜀ = 2.342×10¹⁷ dyn cm⁻² = 2.342×10¹⁶ Pa, X꜀ = 0.340, Y꜀ = 0.6405, Z꜀ = 0.0198. Later models (BS05, B16) differ from these figures by less than 1 %, below the precision that matters in this lesson.
Common mistakes
- Believing that radiation pressure supports the Sun. Have them compute aT⁴/3 with T꜀ = 1.57×10⁷ K and compare it with P꜀: it is 0.07 %.
- Confusing the luminosity L(r) with the flux or with the locally generated energy. Insist that L(r) is the power crossing the sphere of radius r and that dL/dr is the local generation.
- Thinking that the dimensional estimate of T꜀ is a "coincidence". Connect it with the virial theorem (⟨T⟩ ∝ GMμ/R) and with the fact that the central concentration cancels in P/ρ.
- Using μ = 0.6 at the center of the Sun. There X = 0.34 and Y = 0.64 because of hydrogen burning: μ꜀ = 0.85. It is a good opportunity to explain that the composition is a function of m and of time.
- Treating shooting from the center as a general method. Show with problem 6 that it works for a polytrope because the surface is detected with P = 0, but that with transport and energy generation the problem is a two-point one.