Calculator Form
Example Data Table
| System | Exponent n | Known input | Average kinetic energy <K> | Average potential energy <V> | Total energy E |
|---|---|---|---|---|---|
| Gravitational orbit | -1 | E = -10 | 10 | -20 | -10 |
| Harmonic oscillator | 2 | V = 15 | 15 | 15 | 30 |
| Quartic trap | 4 | K = 12 | 12 | 6 | 18 |
| Linear potential | 1 | E = 9 | 3 | 6 | 9 |
Formula Used
The virial theorem links time averaged kinetic energy and time averaged potential energy for stable systems. It is most useful when the potential is homogeneous and scales like V(r) ∝ rn.
Core relation
2<K> = n<V>
Main energy identities
E = <K> + <V>
<K> = nE / (n + 2), when n ≠ -2.
<V> = 2E / (n + 2), when n ≠ -2.
<K> = n<V> / 2
<V> = 2<K> / n, when n ≠ 0.
Consistency check
This page can also test whether entered averages satisfy the theorem. The residual is R = 2<K> - n<V>. The relative error is |R| / max(|2<K>|, |n<V>|) × 100.
These equations are common in orbital mechanics, atomic models, trapped particles, stellar systems, and many idealized bound states. They help estimate missing energy terms fast. They also help verify simulation outputs and classroom calculations.
How to Use This Calculator
Start by choosing a preset potential or enter a custom exponent. Use n = -1 for gravity or Coulomb attraction. Use n = 2 for a harmonic oscillator. Choose custom when you know the scaling power of the potential.
Next, select the calculator mode. In Solve averages from one known quantity, enter one energy value and let the calculator derive the other average terms. In Check theorem using entered averages, provide both kinetic and potential averages to test whether they obey virial balance.
Pick the known quantity carefully. If you know total energy, the calculator uses the total energy form of the theorem. If you know average kinetic energy or average potential energy, it uses the direct virial ratio. Special cases are handled. For example, n = -2 makes the total energy formula singular, and n = 0 makes the kinetic-only inversion invalid.
Set the decimal places you want. Then press Calculate. The result appears above the form, below the header, exactly where it is easy to review. You also get a Plotly chart that compares the solved energies or shows the residual in theorem-check mode.
Use the export buttons to save the current result as CSV or PDF. That helps when preparing reports, lab notes, homework records, or simulation reviews. The example table below the form gives quick reference values you can compare with your own inputs.
Frequently Asked Questions
1. What does the virial theorem state?
It relates time averaged kinetic and potential energy in a stable system. For a homogeneous potential V(r) ∝ rn, the relation becomes 2<K> = n<V>.
2. Does this calculator work for every potential?
It works best for homogeneous power law potentials or cases approximated by them. Complicated mixed potentials may need a more detailed model or numerical integration.
3. Why is the exponent n important?
The exponent tells how the potential scales with distance. That scaling sets the ratio between averaged kinetic and potential energy in the virial relation.
4. Why is potential energy sometimes negative?
Attractive inverse power systems, such as gravity, often use negative potential energy relative to a reference at infinity. That is normal and physically meaningful.
5. Can total energy be positive?
Yes. Positive total energy can appear in unbound states or driven systems. Negative total energy often suggests a bound configuration in attractive systems.
6. Are these instantaneous energies?
No. The theorem uses averages over time or over an ensemble. Instantaneous values can fluctuate strongly while the averaged relation still holds.
7. What does a failed theorem check mean?
It means the entered averages do not satisfy 2<K> = n<V> within your tolerance. The system may be transient, noisy, mismeasured, or modeled with the wrong exponent.
8. Why would I export the result?
Exports help with homework records, lab documentation, simulation comparisons, sharing calculations, and keeping a saved copy of the computed energy balance.