Lesson 7 of 15

Hydrostatic Equilibrium

Hydrostatic Equilibrium

A star is not collapsing — it is in a delicate balance between gravity pulling inward and pressure pushing outward. This balance is called hydrostatic equilibrium.

The Equation

At every point inside a star, the pressure gradient must exactly counteract gravity:

dPdr=ρg=GM(r)ρr2\frac{dP}{dr} = -\rho g = -\frac{G M(r) \rho}{r^2}

where M(r)M(r) is the mass enclosed within radius rr.

Central Pressure Estimate

Using the virial theorem approximation, the central pressure of a star scales as:

PcGM24πR4P_c \approx \frac{G M^2}{4\pi R^4}

For the Sun, this gives Pc9×1013P_c \approx 9 \times 10^{13} Pa — about a billion atmospheres.

Free-Fall (Dynamical) Timescale

If pressure support were suddenly removed, a star would collapse under its own gravity on the free-fall timescale:

tff=3π32Gρt_{\rm ff} = \sqrt{\frac{3\pi}{32 G \rho}}

where ρ\rho is the mean density. For the Sun, tff1769t_{\rm ff} \approx 1769 s — about 30 minutes.

Mean Density

ρˉ=M43πR3\bar{\rho} = \frac{M}{\frac{4}{3}\pi R^3}

The Sun's mean density is about 1410 kg/m³ — slightly denser than water.

Your Task

Implement three functions. Use G=6.674×1011G = 6.674 \times 10^{-11} m³ kg⁻¹ s⁻², defined inside each function.

  • central_pressure_Pa(M_kg, R_m) — virial estimate of central pressure in Pa
  • freefall_timescale_s(rho_kg_m3) — free-fall collapse timescale in seconds
  • mean_density_kg_m3(M_kg, R_m) — mean density of a spherical body in kg/m³
Python runtime loading...
Loading...
Click "Run" to execute your code.