Simulation

Ramp into Spring · SimulatorWhy angle doesn't change the squeeze

Energy & WorkConservation of energy

A ball rolls down a frictionless ramp and compresses a spring. Gravitational PE converts to KE then to spring PE; the key insight is that ramp angle does not affect maximum compression.

Published: July 6, 2026

Objective

Observe that a ball released from height h on a frictionless ramp always compresses a spring by the same amount x_max = sqrt(2mgh/k), regardless of the ramp angle. Verify energy conservation as gravitational PE converts to kinetic energy at the ramp base and then fully into spring PE at maximum compression. Idealizations: frictionless ramp, massless spring, point-mass ball.

Setup

  1. Set Height to 2.0 m, Ramp Angle to 35°, Spring Stiffness to 80 N/m, and Ball Mass to 0.5 kg. These are the default values. Note that the Total Energy readout shows 9.81 J (= m·g·h = 0.5 × 9.81 × 2.0).
  2. Press Start. Watch the ball roll down the ramp while KE rises and the Grav PE bar shrinks. Record the Compression x readout when the simulation stops.
  3. Press Reset (the button morphs to Clear after the first run). Change Ramp Angle to 65° and press Start again. Record the new Compression x at the stop frame.
  4. Compare both compression values. They should match within ±5%, confirming that ramp angle does not appear in x_max = sqrt(2mgh/k).
  5. Now increase Height to 4.0 m (angle still 65°) and run again. Record Compression x to verify it increases by a factor of sqrt(2) ≈ 1.414 relative to the h = 2.0 m result.
  6. Finally, change Spring Stiffness to 160 N/m (doubling k) and run. Confirm Compression x falls by a factor of 1/sqrt(2) ≈ 0.707.
The ball rests at the top of the ramp at 2 m height, with the spring at natural length against the wall.
At maximum compression the ball has stopped and all gravitational PE has transferred to spring PE, shown by the energy bars.
With a steeper 65 degree ramp and the same 2 m height, the maximum compression readout is identical to the 35 degree case.

Analytical Prediction

Energy conservation gives the maximum compression directly. At the stop frame v = 0, so all initial gravitational PE has transferred to spring PE: mgh = ½kx² → x_max = sqrt(2mgh / k) With the default settings m = 0.5 kg, h = 2.0 m, k = 80 N/m, g = 9.81 m/s²:

x_max=sqrt(2 × 0.5 × 9.81 × 2.0 / 80)
=sqrt(9.810 / 80)
=sqrt(0.12263)
0.495 m

At h = 4.0 m (all other values the same):

x_max=sqrt(2 × 0.5 × 9.81 × 4.0 / 80)
=sqrt(0.24525)
0.700 m

Ratio = 0.700 / 0.495 ≈ 1.414 = sqrt(2). Compression scales as sqrt(h), not h. The ramp angle (35° or 65°) does not appear anywhere in this derivation: only height determines the outcome.

Results Analysis

At the stop frame the Compression x readout should read 0.495 m (±5%) for h = 2.0 m, k = 80 N/m, m = 0.5 kg. The Total Energy readout should hold at 9.81 J throughout the run; any drift beyond ±0.5 J signals integration error, not a physics discrepancy. The Spring PE readout at the stop frame should equal the Total Energy readout within ±5%, confirming complete transfer. The KE readout should drop to 0.00 J at the stop frame. Swapping angle between 35° and 65° with height fixed at 2.0 m should leave the Compression x readout unchanged within the stated tolerance. The energy bar overlay visually confirms the transfer: the amber Grav PE bar shrinks to zero, the sky KE bar peaks at the ramp base, and the green Spring PE bar grows to fill the full width at maximum compression.

Source of Error

The simulation assumes a perfectly frictionless ramp, so no energy is lost to rolling resistance or heat. The ball is treated as a point mass sliding, not rolling, so rotational kinetic energy is ignored (a rolling solid sphere retains 2/7 of KE as rotation, reducing the compression by roughly 3.4% compared to this model). The spring is massless and perfectly linear (Hooke's law), with no coil-binding at large compressions. Gravity is uniform across the ramp (no curvature effects). These idealizations are consistent between the model and the prediction formula, so they cancel in the comparison and the residual gap between the Compression x readout and the analytical prediction is purely numerical.

Further Exploration