This Demonstration shows an object sliding with damping on a track defined by the position of three locators. Explore the effect of the damping coefficient and the position of the locators on the motion of the object and the constraining force that keeps it on the track.
Lagrangian mechanics can be used to derive the equations of motion .
Here is the interpolating polynomial representing the curve of the track, is the position of the object at time , is the mass of the object, is the Lagrangian multiplier, and is the damping coefficient.
This gives the equations of motion
subject to the constraint .
 S. Timoshenko and D. H. Young, Advanced Dynamics, New York: McGraw–Hill, 1948 p. 281 (eq. 150).