Virial Theorem Calculator
Enter kinetic energy, potential energy and the force exponent to compute the virial theorem 2K+nU=0, total energy and K/U ratio. Gravity K=100, U=-200, n=1 → E=-100.
Input Data
Results
At a glance:The Virial theorem (Clausius, 1870) states that for a bound mechanical system the time-averaged kinetic energy ⟨K⟩ and potential energy ⟨U⟩ satisfy 2⟨K⟩=⟨r·∇U⟩. For a power-law potential U=Arⁿ (with sign), r·∇U=nU, so 2K=nU. For an attractive potential U∝-1/rⁿ (n>0, e.g. gravity n=1, Coulomb n=1), 2K=nU (U<0), i.e. 2K-|nU|=0. Total energy E=K+U. Gravity: 2K+U=0, E=K+U=-K=U/2 (negative → bound). Harmonic potential U=½kx² (n=2, positive): 2K=2U, E=K+U=constant (oscillation). Rigid body U=constant (n=0): 2K=0 (not applicable). Classic example: Earth around the Sun K=2.65e33 J, U=-5.30e33 J, n=1 → 2K+U=0, E=-2.65e33 J=U/2. Applications: (1) celestial mechanics — galaxy mass estimates, dark-matter evidence; (2) statistical mechanics — ideal gas 2K=3kT (n=0, no potential); (3) quantum mechanics — holds for the Hamiltonian operator; (4) fluids — Rayleigh's theorem; (5) cosmology — large-scale structure.
Formula
Virial theorem: 2⟨K⟩ = n·⟨U⟩ (U∝rⁿ, with sign)
Total energy: E = K + U
Gravity (n=1): 2K + U = 0, E = -K = U/2
Harmonic (n=2): 2K + 2U = 0, E = constant
K/U ratio = -n/2
$$2\langle K\rangle = n\langle U\rangle, \quad E = K+U, \quad \text{gravity}: 2K+U=0, \; E=-K=\frac{U}{2}$$How to Use
- Enter kinetic energy K (J) and potential energy U (J, negative for attraction).
- Enter the force exponent n (gravity 1, Coulomb 1, harmonic 2).
- The tool returns E=K+U, the virial check 2K+nU and the K/U ratio.
Case Studies
Earth-Sun orbit
K=2.65e33 J, U=-5.30e33 J, n=1.
2K+U = 5.30e33 − 5.30e33 = 0 (virial satisfied).
E=-2.65e33 J = U/2, a bound (negative-energy) orbit.
Quantum harmonic oscillator
Harmonic potential n=2, so 2K=2U → K=U.
Each contributes half the total energy E.
This holds for every stationary state of the oscillator.
FAQ
What does the virial theorem say?
For a system in equilibrium, 2⟨K⟩=n⟨U⟩ where the potential is U∝rⁿ. For gravitational/Coulomb attraction (n=1), 2K+U=0, so E=K+U=-K (bound when E<0).
Why is it useful?
It lets you relate observable kinetic energies (e.g. stellar velocities) to masses and potentials without solving full dynamics — the basis of galaxy mass and dark-matter estimates.
Does it apply to quantum systems?
Yes. The theorem holds for the quantum Hamiltonian as an expectation-value relation, e.g. the hydrogen atom and the harmonic oscillator satisfy the same 2K=nU balance.
What is the force exponent n?
For U∝-1/rⁿ, n=1 for gravity and Coulomb, n=2 for a harmonic (spring) potential, n=0 for a constant potential. It sets the K/U ratio (-n/2).
Related Tools
References
Content review: Calculatorism Science Team. Results are for reference only; please refer to the relevant authorities for the official figures.