Chapter 38
Virial Theorem and Dynamic Equilibrium
Gravitational and Orbital Coherence
Author: Mark Anthony Higgins
© Mark Anthony Higgins 11 October 2025
Revised Date: 23 February 2026
flow "Virial Theorem and Dynamic Equilibrium" v1.0
# ---------- PURPOSE ----------
# Expresses the Virial Theorem as the equilibrium of kinetic and potential curvature energy.
# Connects motion (2⟨T⟩) and boundary stress (⟨U⟩) through coherent feedback.
# Includes coherence index (IB) for measuring how perfectly a system maintains dynamic equilibrium.
# When IB = 1 → ideal virial equilibrium (2⟨T⟩ + ⟨U⟩ = 0);
# when IB < 1 → imbalance (collapse, expansion, oscillation).
# ---------- PARAMETERS ----------
params:
units: "SI"
IB: 0.0..1.0 = 1.0 # boundary coherence index (1 = perfect virial equilibrium)
N: positive # number of particles (or equivalent system count)
m: positive # mass of each particle [kg]
G: positive = 6.67430e-11 # gravitational constant [m^3/kg/s^2]
R: positive # system characteristic radius [m]
loss_coeff: 0.0 # optional damping or energy leak [s^-1]
dt: 0.0? # timestep for updates [s]
include_gravity: true
include_external_pressure: false
P_ext: real? # optional external confining pressure [Pa]
# ---------- STATE ----------
state System:
T_avg: real # average kinetic energy [J]
U_avg: real # average potential energy [J]
E_tot: real # total energy [J]
W: real # virial term (2⟨T⟩ + ⟨U⟩)
P_V: real # pressure-volume term [J]
R_dot: real # rate of radius change [m/s]
stability_factor: real # ratio of kinetic/potential balance
# ---------- INVARIANTS ----------
invariants:
# Characteristic kinetic energy (mean per particle)
System.T_avg = (3/2) * params.N * params.IB * (params.m * (params.R_dot^2 or 1e-9))
# Gravitational potential energy (negative binding)
if params.include_gravity:
System.U_avg = - (3/5) * params.IB * params.G * (params.N * params.m)^2 / params.R
else:
System.U_avg = - params.IB * (params.N * params.m)^2 / (2 * params.R)
# Optional external pressure confinement
if params.include_external_pressure and params.P_ext is defined:
System.P_V = 3 * params.P_ext * (4/3) * pi * params.R^3
else:
System.P_V = 0
# Virial equilibrium condition (core theorem)
# 2⟨T⟩ + ⟨U⟩ + P_V = 0 for ideal equilibrium
System.W = 2 * System.T_avg + System.U_avg + System.P_V
# Stability factor: ratio of kinetic to potential energy
System.stability_factor = abs(2*System.T_avg / System.U_avg)
# Total energy
System.E_tot = System.T_avg + System.U_avg
# ---------- TRANSFORMS ----------
transforms:
# Coherence loss (if IB < 1 or damping present)
energy_decay:
if params.loss_coeff > 0:
System.T_avg *= (1 - params.loss_coeff * params.dt)
System.U_avg *= (1 - params.loss_coeff * params.dt)
params.IB = max(params.IB - params.loss_coeff * params.dt, 0)
# Radius feedback (collapse or expansion)
radial_feedback:
if System.W < 0:
params.R_dot = -abs(System.W) / (params.N * params.m)
elif System.W > 0:
params.R_dot = +abs(System.W) / (params.N * params.m)
else:
params.R_dot = 0
# Restore equilibrium slowly (feedback correction)
restore_equilibrium:
correction = -0.01 * System.W
System.T_avg += correction / 2
System.U_avg += correction
System.W = 2*System.T_avg + System.U_avg + System.P_V
# ---------- MONITORS ----------
monitors:
virial_balance:
if params.IB == 1:
assert abs(System.W) < 1e-9
energy_signs:
assert System.T_avg >= 0
assert System.U_avg <= 0
stability_indicator:
if System.stability_factor > 1.1:
comment: "Kinetic dominance — possible expansion or oscillation."
elif System.stability_factor < 0.9:
comment: "Potential dominance — collapse tendency."
else:
comment: "Stable virial equilibrium."
# ---------- SCENES ----------
scenes:
ideal_cluster:
given params:
IB: 1.0
N: 1e5
m: 2e30
R: 1e16
expect:
System.W ≈ 0
comment: "Self-gravitating cluster at perfect virial equilibrium."
collapsing_cluster:
given params:
IB: 0.9
N: 1e5
m: 2e30
R: 1e16
expect:
System.W < 0
System.R_dot < 0
comment: "Insufficient kinetic support — collapse begins."
expanding_gas:
given params:
IB: 0.95
N: 1e6
m: 1.67e-27
R: 1.0
include_gravity: false
include_external_pressure: true
P_ext: 0
expect:
System.W > 0
System.R_dot > 0
comment: "Positive virial term — system expands."
oscillating_star:
given params:
IB: 0.97
N: 1.0e57
m: 1.67e-27
R: 7e8
include_gravity: true
dt: 0.5
loss_coeff: 1e-3
enable:
- energy_decay
- radial_feedback
- restore_equilibrium
expect:
System.W oscillates about zero
comment: "Dynamic virial equilibrium — pulsating star model."
# ---------- NOTES ----------
notes:
- **Virial theorem:** \( 2\langle T\rangle + \langle U\rangle + P_V = 0 \) for systems in equilibrium.
- **Gravitational binding:** \( U = -\tfrac{3}{5}\frac{GM^2}{R} \) for a uniform sphere.
- **Total energy:** \( E = T + U = -T = \tfrac{U}{2} \).
- **Stability factor:** \( S = 2\langle T\rangle / |\langle U\rangle| \);
- \(S > 1\): expanding; \(S < 1\): collapsing; \(S = 1\): stable.
- **Boundary coherence (IB):** measures how perfectly energy feedback maintains virial balance.
- **Feedback law:** \( \frac{dI_B}{dt} = -\lambda(1 - I_B) \).
- **Interpretation:** Dynamic equilibrium is a *conversation between kinetic and potential curvature*.
Gravity pulls inward, motion pushes outward — coherence is the memory that keeps them balanced.
- **Applications:** stellar clusters, galaxies, molecular clouds, plasmas, and any self-bound dynamic system.
- **Losses:** lower IB simulates radiative loss, viscosity, or energy leakage through boundaries.
The virial theorem is the quiet contract that keeps self-bound systems together: motion balances curvature.
A system in dynamic equilibrium satisfies
$$ 2\langle T\rangle + \langle U\rangle + P V = 0. $$
meaning kinetic agitation (pressure of motion) exactly counters inward potential curvature (binding).
In this flow, the coherence index tracks how perfectly that balance is maintained.
Virial balance (with external confinement):
$$ 2\langle T\rangle + \langle U\rangle + P V = 0. $$
Gravitational binding (uniform sphere guide):
$$ U \simeq -\frac{3}{5}\,\frac{G M^2}{R}. $$
Total energy in equilibrium:
$$ E = T + U = -T = \frac{1}{2}U. $$
Stability factor (diagnostic):
$$ S \equiv \frac{|\langle U\rangle|}{2\langle T\rangle}. $$
S>1 → expansion tendency, → collapse, → virial stability.
Treat the system as a boundary that stores curvature memory.
Kinetic energy is the distributed side (agitation pressure), potential energy the structured side (binding curvature).
The virial condition is their phase alignment: when motion and binding remain in step, the radius stabilises.
Loss of coherence reduces the effectiveness of binding feedback, shifting away from 1 and driving global radius change.
$$ W(t) \equiv 2\langle T\rangle + \langle U\rangle + P V \;\to\; 0. $$
A simple phenomenology for leakage:
$$ \dot{E} = -\lambda\,|E|, \qquad \frac{dI_B}{dt} = -\lambda\,(1 - I_B). $$
captures slow drift off the virial surface (cooling stars, radiative clusters, viscous plasmas).
An ambient pressure contributes work , tightening equilibrium for embedded clouds or pressurised plasmas.
This term stabilises systems that would otherwise expand (e.g., molecular clouds in the ISM).
$$ S = \frac{2T}{|U|}. $$
Track . Its sign and decay rate reveal the feedback timescale.
Monitor . Falling with W<0 flags coherence loss–driven collapse; with flags unbound evaporation.
The virial theorem is dynamic equilibrium written as a sentence:
motion remembers curvature; curvature restrains motion.
At , that memory is perfect and the system rests on the virial surface.
When coherence slips, the balance tilts — collapse, expansion, or pulsation follow until feedback recaptures the curve or energy is lost.
In this view, the virial theorem is not just a sum rule; it is the heartbeat of self-bound structure.