Pendulum with a prescribed translating support (source code)

= Pendulum with a prescribed translating support
{title2=$l\ddot\theta+\ddot a_x\cos\theta+(g+\ddot a_y)\sin\theta=0$}

For support displacement $\mathbf a(t)$ and angle measured from the downward vertical, the mass position is $(a_x+l\sin\theta,a_y-l\cos\theta)$. Its <Euler-Lagrange equation> is $l\ddot\theta+\ddot a_x\cos\theta+(g+\ddot a_y)\sin\theta=0$. In the support frame the effective acceleration is $\mathbf g-\ddot{\mathbf a}$; taking its <torque> about the hinge gives $l^2\ddot\theta\hat{\mathbf z}=\mathbf l\times(\mathbf g-\ddot{\mathbf a})$. The prescribed support can do work, so pendulum energy need not be conserved.