Simulation

Gravitational PE on a Hill · SimulatorPE Depends on Reference Height

Energy & WorkPotential energy

Drag a ball up and down a curved hill; the PE bar reads from the chosen reference height, showing that gravitational potential energy is always relative.

Published: July 3, 2026

Objective

Verify that gravitational PE = m·g·(h − h_ref) is defined relative to a chosen reference height, not an absolute value. Roll a frictionless ball over a cosine-bell hill and observe PE and KE trading off while their sum (total mechanical energy) stays constant. Confirm that raising the reference level shifts PE toward negative values without changing the ball's motion, demonstrating that the zero of PE is a human convention, not a physical quantity.

Setup

  1. Leave all sliders at their defaults: Mass = 2 kg, Hill Height = 6 m, Reference Level = 0 m. Note the PE readout before starting; it should show approximately 58.9 J (ball rests at y ≈ 3 m above the reference).
  2. Press Start and watch the ball roll rightward. Observe that PE falls and KE rises as the ball descends, then reverses as it climbs the right slope. Note that the Total E readout stays constant throughout.
  3. Press Reset. Drag the Reference Level slider to 3 m and press Start again. Watch the PE readout: it should start near 0 J (ball at y ≈ 3 m equals the new reference) and become negative as the ball descends below ref = 3 m.
  4. Press Reset. Drag the Hill Height slider to 10 m and press Start. Compare the energy swing: PE now peaks near 196 J at the starting point (y ≈ 5 m, ref = 0 m) and the ball rolls faster through the valley.
  5. Press Reset. Drag the Mass slider from 2 kg to 4 kg. Note that PE and KE both double, but the Total E readout also doubles. Press Start and confirm the ball traverses the same x(t) path (mass scales energy, not the trajectory geometry).
The ball rests on the left slope of the hill before the simulation starts, with the reference level (dashed amber line) at ground level.
Energy graph with the reference level raised to 2 m: PE dips below zero as the ball descends past the reference line, while total energy (forest dashed line) remains constant.
Ball at the peak of a tall hill: the velocity arrow vanishes (v = 0) and the PE bar is at its maximum, showing complete conversion from KE at the base.

Analytical Prediction

With Mass = 2 kg, Hill Height = 6 m, and Reference Level = 0 m, the ball starts at x = −3 m where hillProfile(−3, 6, 12) = 6·0.5·(1 + cos(π·(−3)/6)) = 3.00 m. Initial PE (and total energy, since v = 0):

E_total=PE₀ = m·g·(y₀ − y_ref)
=2.0 × 9.81 × (3.00 − 0)
=58.86 J

At the right foot of the hill (y = 0, ref = 0), all energy is kinetic:

KE=E_total = 58.86 J
v_foot=sqrt(2·KE / m) = sqrt(2 × 58.86 / 2.0)
7.67 m/s

With Reference Level raised to 3 m (and all else equal), the total energy becomes:

E_total=2.0 × 9.81 × (3.00 − 3.00) = 0 J

So the ball has zero total energy relative to the new reference: at y = 3 m, PE = 0; at the valley (y = 0), PE = 2.0 × 9.81 × (0 − 3) = −58.86 J, and KE = 58.86 J. The ball's speed is identical in both cases.

Results Analysis

The #peOut readout should show approximately 58.9 J at the default start (Mass = 2, Height = 6, Ref = 0), matching the prediction PE₀ = 58.86 J within 0.1 J. As the ball rolls, #keOut rises while #peOut falls; their sum displayed in #totalOut should remain at 58.9 J throughout. When Reference Level is set to 3 m, #peOut should read near 0 J at the start and drop to approximately −58.9 J when the ball reaches the valley, while #totalOut reads near 0 J (within ±0.5 J). The energy graph panel shows three traces: PE (amber) and KE (sky) mirror each other about the forest-dashed total-E line. Drag the Reference Level slider to confirm the amber PE trace shifts up or down while the KE trace (sky) is unchanged, and the total (forest) remains flat.

Source of Error

The hill is modeled as a mathematically ideal cosine bell on a frictionless surface. Real hills have rolling resistance, air drag, deformation, and surface irregularities that continuously dissipate energy. The ball is treated as a point mass sliding along the 1D hill profile, ignoring rotational inertia (for a sphere, about 29% of KE would be rotational). The cosine-bell shape is a convenient mathematical curve, not a physically derived hill profile. Speed is computed analytically from energy conservation at every step rather than integrated from forces, so there is zero numerical accumulation error in the PE + KE = E balance; any residual gap between the analytical prediction and the readouts is therefore purely a rounding artefact in the displayed decimal digits, not a physical mismatch.

Further Exploration