Ball rolling inside a cylinder Hugh Hunt http://www.eng.cam.ac.uk/~hemh

The dynamics of a ball rolling inside a cylinder is fascinating. The equations (left) make use of the result where QP is the total moment of external forces about a moving point P, hP is the moment of momentum about the moving point P, is the velocity of point P and p is the linear momentum of the ball. A feature of a rolling ball is that the centre of mass G is always radially aligned with the contact point P.

 

Note that the motion of a ball inside a horizontal cylinder is described by the same equations simply put g = 0. It is much easier to demonstrate the case of the ball leaving the cylinder when horizontal, but the oscillatory solution is more difficult to observe unless the cylinder is large enough to permit launching of the ball far enough in so that it cannot escape.