Skip to content
ScienceQuest
Mechanics Simulator School

Conservation of Energy Simulator

Roll a cart along a track you reshape. Kinetic energy, potential energy and the heat from friction trade places, and their total never changes.

Simulator

Drag a round handle up or down to reshape the track, or drag the cart along it to choose where it is released. The left and right arrow keys move the release point 0.1 m. Space plays and pauses.

t = 0 s
Total energy
Kinetic plus potential plus thermal. It starts as mgh at the release point and stays there for the whole run, because energy only moves between the three.
68.65 J
Kinetic energy
½mv², from the speed along the track.
0 J
Potential energy
mgh, with h the height above the ground line.
68.65 J
Thermal energy
The heat friction has made so far: the friction force times the distance the cart has moved against it.
0 J
Speed
0 m/s
Height
3.5 m
Normal force
The rail’s push on the cart, 19.6 N on level track at rest. It is more in a dip and less over a crest, and negative where the rail has to hold the cart on, as the wheels under a roller coaster’s rail do.
16.3 N
Top speed
The fastest the cart goes, at the lowest point it reaches. With no friction it is √(2gΔh), where Δh is the drop from the release height to that point.
7.671 m/s
Round trip
Out to the far turning point and back to rest at the release point. With no friction it would repeat forever; the recording holds 3 of them.
7.17 s
Energy drift
The most the total strays from its starting value at any moment of this run. The physics conserves energy exactly, so this is the numerical error of the integration, measured, not assumed.
1.7 × 10⁻⁷ J
Parameters
m

How far along the track the cart starts, from the left end. It starts at rest.

Sliding friction and rolling resistance together. The energy they take shows up as thermal energy.

kg

Every energy is proportional to it. The motion is not.

Track
Set each handle’s height
m
m
m
m
m
m
m
  • Kinetic
  • Potential
  • Thermal
  • Total
Kinetic, potential and thermal energy of the cart against time for this run, with their total, which stays flat. The dot is the moment the scene is showing.

Citing this tool

Last updated . Add the date you accessed it as well, which a citation of a page that can change asks for. If a specific result matters, cite the permalink from the tool’s share row instead of this page: it reproduces the exact parameters.

Teaching with this? You can put it on a class page or LMS for free, with no ads inside the frame. Get the embed code.

The equation

12mv2+mgh+Eth=mgh0\tfrac{1}{2}mv^{2} + mgh + E_{\text{th}} = mgh_0

Conservation of energy, counting friction’s work as heat (Joule, 1850)

What conservation of energy means for the cart

Conservation of energy means the cart’s kinetic energy, its potential energy and the heat friction makes always add up to the energy it was released with: ½mv² + mgh + E_th = mgh₀, where h₀ is the height of the release point. Energy moves between the three forms as the cart rolls, but none is created and none is lost, so the total bar never changes length and the grey total line on the plot stays flat.

The cart always starts at rest, so all of its energy begins as potential energy. On the way down a slope the violet potential bar shrinks and the blue kinetic bar grows by exactly the same amount; on the way up they trade back. With friction switched on, the orange thermal bar takes a share on every stretch of track and never gives it back.

How to use the simulator

Drag a round handle up or down to reshape the track, drag the cart along the rail to choose where it is released, or start from one of the ready-made tracks. Every handle also has its own slider under Set each handle’s height, and the left and right arrow keys move the release point. Play, pause or scrub through the run: it is worked out in full before it plays, so the plot below the scene shows the whole of it at once, and the dot on the plot is the moment the scene is showing.

The dashed line is the height the cart’s kinetic and potential energy together could lift it to, (KE + PE)/mg. With no friction it sits at the release height, and the cart turns round exactly where the track rises to meet it. With friction it sinks as the heat builds up, and the cart turns lower each time.

Worked example: the default track

The cart is 2 kg and starts 3.5 m up, so its energy is mgh₀ = 2 × 9.80665 × 3.5 = 68.65 J. The simulator uses standard gravity, 9.80665 m/s².

  • At the bottom of the first dip, 0.5 m up, the potential energy is 2 × 9.80665 × 0.5 = 9.807 J, so the kinetic energy is 68.65 − 9.807 = 58.84 J and the speed is v = √(2 × 58.84 / 2) = 7.671 m/s, the top speed the readout reports.
  • Over the hill in the middle, 2 m up, the potential energy is 39.23 J, which leaves 29.42 J of kinetic energy and a speed of 5.424 m/s. The hill is lower than the release point, so the cart gets over it.
  • On the far side it climbs until all 68.65 J is potential energy again, which happens at 3.5 m, 16.36 m along the track, and rolls back. A round trip takes 7.17 s, and with no friction it repeats forever.

Each speed needs only the drop from the release height: v = √(2gΔh), so a drop of 3 m gives √(2 × 9.80665 × 3) = 7.671 m/s whatever the track does on the way down. Change the mass and every energy changes in proportion while the speeds stay exactly the same, because the mass cancels from mgΔh = ½mv².

What friction does to the energy

Switch friction on at its default coefficient of 0.05 and the cart turns lower each time. It comes to rest after 18.9 s in the second dip, about 12 m along the track and 0.8 m up. By then 52.95 J, 77 percent of the 68.65 J, has become heat, and 15.69 J is still potential energy, because the cart stopped above the ground line. The total is still 68.65 J.

So friction does not destroy energy. It turns kinetic energy into thermal energy, warming the wheels and the rail, and that is the one change the cart cannot undo: the heat never comes back as motion. What friction does not conserve is mechanical energy, KE + PE, which is why the cart cannot climb back to where it started.

Why the dips get hotter than the crests

The friction force is the coefficient times the normal force, the rail’s push on the cart, and on a curved track that push is not the familiar mg cos θ. To turn the cart the rail has to supply the centripetal force as well, so N = m(g cos θ + v²κ), where κ is the curvature of the track, positive in a dip and negative over a crest. In a dip the rail pushes harder, so friction makes more heat there; over a crest it pushes less.

On the default track the normal force reaches 145 N near the bottom of the first dip, about 7.4 times the cart’s 19.6 N weight, and falls as low as −36.3 N on the shoulder of the hill. A negative normal force means the cart is going too fast for the bend and the rail has to pull it down. A roller coaster car has a second set of wheels running under the rail for exactly this, and so does this cart: the lower pair lights up while they are working. A cart resting on top of a track would leave it there.

What this does not cover

  • The cart is a point on the rail and its wheels store no energy. Real wheels spin, and the energy of their spin comes out of the kinetic energy, so a real cart is a little slower than √(2gΔh) at the bottom of a dip.
  • There is no air resistance. Friction here is proportional to the normal force, as sliding friction and rolling resistance are, and does not grow with speed as drag does.
  • The same coefficient holds a cart at rest and slows a moving one, where real surfaces grip a little harder before they start to slide.
  • The track is a height at each distance along the ground, so it cannot loop or overhang, and the buffers at the two ends bounce the cart back without losing any energy.

Common mistakes

  • Saying friction destroys energy. It converts mechanical energy into thermal energy. The thermal bar grows by exactly what the other two lose, and the total is unchanged.
  • Expecting a heavier cart to go faster. Mass multiplies every energy and cancels out of the speed. The same track gives the same speeds for 0.1 kg and 100 kg.
  • Using the distance along the track for the potential energy. Only height counts, which is why the path taken makes no difference to the speed at a given height.
  • Working out the heat as μmg times the distance. That is right only on level ground. With friction at 0.05 the cart rolls 38.9 m before it stops, and μmgd for that distance is 38.16 J, while the heat made is 52.95 J, because the dips press the cart into the rail far harder than its weight.
  • Expecting the cart to climb higher than its release point. It would need more energy than it has. Raise the middle hill above 3.5 m and the cart turns back before the top; the Hill too high track shows it.
  • Forgetting that the zero of potential energy is a choice. Here it is the ground line. Measuring heights from anywhere else changes every potential energy by the same amount and changes no speed at all.

Each piece of the equation has its own calculator: the kinetic energy calculator for ½mv², the potential energy calculator for mgh and the work and power calculator for the work a force does. The simple pendulum simulator shows the same exchange between kinetic and potential energy on a circular path, and the collision simulator shows kinetic energy turning into heat in an impact rather than over a distance. The inclined plane simulator takes a single straight slope, where the normal force is exactly mg cos θ and friction’s heat is μmg cos θ times the distance.

Model and assumptions

Method
Runge-Kutta 4th order
Largest step
0.002 s
Repeatability
Deterministic. The same link gives the same numbers on any machine.

What it assumes

  • The cart is a point held on its rail, so where the normal force would have to pull, as over a crest taken fast, the rail holds it on, as the wheels under a roller coaster’s rail do.
  • Friction is one coefficient times the size of the normal force, and the normal force includes the m v² κ it takes to turn the cart on a curve. The same coefficient holds a cart at rest.
  • The heat friction makes is integrated as a quantity of its own rather than worked out as whatever energy went missing, so the flat total is a check on the integration.
  • Gravity is uniform at the standard 9.80665 m/s², there is no air resistance, the wheels store no rotational energy and the buffers at the two ends are perfectly elastic.
  • Each step is 2 ms unless a buffer impact or the moment the cart stops falls inside it, when the step is split to land exactly on that moment.

Where it stops holding. A cart that is not held on, which leaves the track wherever the normal force here goes negative, and real wheels, whose spin takes a share of the kinetic energy and slows the cart below √(2gΔh).

Numerical accuracy

Estimated error
1.7e-7 J in the total energy, about 2.5e-9 of the largest value reached
How that was obtained
Running the same problem again at half the step changed the answer by at most 1.6e-7 J over 21.5 s, about three round trips. Richardson extrapolation of that difference gives the figure above.
Observed order
3.97, measured from a second halving rather than assumed
Conditions
2 kg cart released from rest 3.5 m up on the default track, friction off, the shipped defaults
Conservation of Energy Simulator: the height of the track along its length, which is the cart’s potential energy.
The height of the track along its length, which is the cart’s potential energy, computed by the simulator’s own model. Image © ScienceQuest, CC BY 4.0. Free to reuse with credit and a link to this page; how to reuse it. Download PNG

Common questions

Is energy conserved when there is friction?

Yes. Friction does not destroy energy; it turns kinetic energy into thermal energy, warming the wheels and the rail. Switch friction on and the thermal bar grows by exactly what the kinetic and potential bars lose, so the total stays at the mgh the cart was released with. What friction does not conserve is mechanical energy, kinetic plus potential, which is why the cart can no longer climb back to its starting height.

How fast is the cart at the bottom of a dip?

With no friction, v = √(2gΔh), where Δh is how far the dip is below the release point, whatever the shape of the track on the way down. On the default track the cart drops 3 m into the first dip, so v = √(2 × 9.80665 × 3) = 7.671 m/s, the top speed the simulator reports. With friction on it arrives slower, because some of the drop has already gone into heat.

Does a heavier cart go faster?

No. Mass multiplies every energy, kinetic, potential and thermal alike, so it cancels from mgh = ½mv² and the speed at every point is the same for any cart. Double the mass and every bar reads twice as many joules while the cart moves exactly as before. That holds with friction too, because the friction force is proportional to the mass as well.

Why can the cart never rise above its release point?

Because it would need more energy than it has. At the release point all of its energy is potential energy, mgh₀, and reaching any greater height would take more potential energy than that total. With no friction it turns round exactly at the release height wherever the track rises that high, unless a buffer at the end turns it first; with friction it turns lower each time, as the dashed line shows, and a hill higher than the release point turns it back.

Why does the normal force go negative over the hill?

Because the cart is going too fast for the bend. Following a crest of radius r at speed v needs a downward acceleration of v²/r, and when that is more than gravity can supply across the track, the rail has to pull the cart down instead of pushing it up. On the default track that happens on the shoulder of the hill, where the normal force falls to −36.3 N. A roller coaster car has wheels under the rail for exactly this; a cart resting on top of a track would leave it there.