I am trying to understand an interesting effect I observed while playing with my kids' toys (video). The energy in this system seems to slosh back and forth between the trough and the ball, with the ball periodically almost coming to rest. I'm hoping to get a better understanding by developing the dynamics equations describing the system.
The problem can be reduced to two dimensions since the center of mass of the ball and the trough move in the same plane (assuming the ball starts in the center of the trough).
The equations for the motion of the trough alone are relatively easy to compute (equations). I extended the Lagrangian approach to include the ball. This is also relatively straightforward since potential and kinetic energies are just the sums of the corresponding energies for the ball and the trough.
$$ T_t=\frac 12\,{\dot\varphi }^{2} \left( M{R}^{2}-2\,M\,R\,c\cos \left( \varphi \right) +M{c}^{2}+I_{{C}} \right) $$ $$ U_t=M\,g \left( R-c\cos \left( \varphi \right) \right) $$ where $\phi$ is the angle between the vertical and radius through the center of mass, $M$ is the mass of the trough, $R$ is its radius, $c$ is the distance of the center of mass from the cylinder's (encompassing the trough) axis of symmetry and $I_C$ is the moment of inertia of the trough about its center of gravity.
For the ball I'm getting $$ T_b=\frac 12\, Ib \left(\frac{\dot{\psi} R}{2 \pi r}\right)^2+\frac{1}{2} m \left((\sin (\phi+\psi) (\dot{\phi} R+\dot{\psi} (R-r)))^2+(\cos (\phi+\psi) (\dot{\phi} R+\dot{\psi} (R-r))-\dot{\phi} R)^2\right) $$ $$ U_b=m\, g\, R (1 - \cos(\phi + \psi)) $$ where $\psi$ is the angle between the radii through the center of mass of the ball and through the center of mass of the trough, $m$ is the mass of the ball, $r$ is its radius, $Ib$ is its moment of inertia. The complicated bit seems to be getting the kinetic energy right since the velocity of the ball is the combination of the ball's center of mass due to the rolling motion of the ball and the velocity of the point of contact between the ball and the trough wall. Well, and the kinetic energy due to the ball's rotation.
Forming the Lagrangian $$ L=T_t+T_b-(U_t+U_b) $$ and solving the system of resulting equations $$ \frac{\partial L}{\partial q}-\frac{d}{dt}\frac{\partial L}{\partial \dot{q}}=0 $$ where $q=(\phi,\psi)$, I get a system of second order ODEs. Solving the equations numerically (using Mathematica), I get solution plots for $q$ that look like:
This, however, does not match observed experiments in which the amplitudes of the oscillations of the ball and the trough grow and decay out of phase. It seems unlikely (though perhaps possible) that these changes in amplitude are caused by friction, which is not modeled in the above equations. If the amplitude modulation is not due to friction there must be a bug in my energy equations that I'm failing to spot.
Energy plot looks constant within the numerical precision:
I believe I have found the error by comparing to this write-up on dynamics of a cylinder rolling within a cylinder (an obviously connected problem). In summary, the issue is that the ball's angular velocity is computed in a non-intertial coordinate system. I will post a detailed answer shortly.