A frictionless pendulum hangs from a disk rolling without slipping in a circular well. This Demonstration uses Lagrangian mechanics to compute the equations of motion of the disk and the pendulum and to plot the trace of the pendulum bob.

A horizontal energy gauge shows the total energy of the system, which remains constant while the potential energy and kinetic energy change in opposite directions. For higher energies, the motion becomes chaotic.

The circular well has radius . The disk with angular position has mass and radius . The pendulum rod with angular position has length and its bob has mass .

This is a system with two degrees of freedom: and .

The potential energy of the disk and pendulum system is .

The kinetic energy is .

The Lagrangian of this system is . Substituting this in the Euler–Lagrange equations for and ): , which results in the equations of motion: