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.
M047 · Energy averages
When does the virial theorem actually hold? Only for bound motion, and only after a long time. Over any finite stretch, twice the average kinetic energy differs from the average radial-force term by a boundary term: the change in position times momentum, divided by the elapsed time. That gap is real physics, not numerical error. A bound orbit keeps it finite, so it fades as time grows; an escaping one need not.
Follow bound and escaping orbits in power-law and logarithmic potentials. Compare the running averages of kinetic energy and of the radial-force term, keep the boundary term that a finite time window leaves, and check the relation again from raw sensor readings.
Physics tutorial
BackgroundIn this Lab the force always points along the radius, and the chosen source sets how its strength changes with distance.
Why it mattersLink what you see in the scene to the computed trajectory and to sensor readings taken separately.
Start with the essentials
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 misconceptionAn ideal model like this automatically describes a real planet or a relaxed star cluster.
Better mental modelThe source is fixed in advance, the test particle does not pull back on it, and the effects left out are listed.
Try Kepler ellipse, Harmonic well, Quartic confinement and Logarithmic potential.
What to observe: When the force law changes, the running averages change with it.Compare Short observation with a longer duration, and drag the selected time.
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.Acquire the computed trajectory, look at the raw estimates, then halve the integration step.
What to observe: Resampling and sensor noise affect the raw estimate, separately from the numerical average taken at every step.