Attractive radial potentials
The logarithmic potential is a separate choice, and the energy zero of the power-law potentials is not shifted to match it. The test mass is one kilogram.
When does the virial theorem actually hold? If the particle’s position and momentum stay bounded and its energy averages exist, the virial relation holds in the long-time limit. At finite times an endpoint term sets the gap: it is zero on a circular orbit or over a complete period, and can persist or decay on an escaping orbit.
Follow bound and escaping orbits. Compare running energy averages with the finite-time boundary term to see when the virial relation settles.
BackgroundA particle on a bound orbit speeds up near the centre and slows farther out. Its kinetic and potential energies keep changing while their time averages can settle.
Why it mattersCompare a short stretch of an orbit with many revolutions, then launch a particle fast enough to escape.
The logarithmic potential is a separate choice, and the energy zero of the power-law potentials is not shifted to match it. The test mass is one kilogram.
The signs follow from a radius that points outward and a force that points inward.
Over a short interval the physical boundary term can be large, and the identity still holds accurately.
The familiar long-time energy relation follows only when the boundary term goes to zero.
The orbit lies in the horizontal plane. Errors in energy and angular momentum are reported separately from the virial residual.
Typical misconceptionAny gap in the average-energy relation is an integration error.
Better mental modelEven exact motion leaves an endpoint term over a finite interval. Subtract that term before judging numerical error. The fixed radial source models a test particle, not a self-gravitating star cluster.
Try Kepler ellipse, Harmonic well, Quartic confinement and Logarithmic potential. Drag the violet launch arrow to change its radial and tangential components.
What to observe: Both mean kinetic and mean potential energy change when the force law or launch changes.Choose Short observation, increase Observation window and drag Selected time or the gold particle.
What to observe: The gap between the averages tracks the physical boundary term. What remains after subtracting it measures numerical error.Raise the Kepler launch speed above escape speed and watch the boundary term.
What to observe: An escaping particle breaks the assumption of bounded motion, and observing for longer need not restore the relation.Expand Scales, resolution and sensors, acquire the trajectory and inspect Raw records and numerical checks. Halve the integration step and acquire again.
What to observe: Resampling and sensor noise affect the raw estimate, separately from the numerical average taken at every step.