Gravity Along a Curve

The ODE for a bead sliding down a wire.

This note records a simple calculation in lagrangian mechanics that is useful when making 2D animations. We consider a curve given by the graph of a function u(u,f(u))u\mapsto (u,f(u)) and a particle moving along the curve under the influence of a uniform downwards gravitational field.

PICTURE

Gravity Along a Curve

A particle moving along the graph of a function ff under a uniform downwards gravitational field of strength gg follows the trajectory t(u(t),f(u(t)))t\mapsto (u(t),f(u(t))) determined by the following differential equation:

u¨=fufuuu˙2+g(1+fu2)\ddot{u}=-f_u\frac{f_{uu}\dot{u}^2+g}{(1+f_u^2)}

The Lagrangian

The kinetic energy of a particle is 12mv2\frac{1}{2}mv^2, where in R2\mathbb{R}^2 the square velocity is given in coordinates by v2=x˙2+y˙2v^2=\dot{x}^2+\dot{y}^2. Confined to the curve (u,f(u))(u,f(u)) this becomes

K=m2(x˙2+y˙2)=m2(u˙2+[f(u)]2)=m2(u˙2+[fuu˙]2)=m2(1+fu2)u˙2\begin{align} K&=\frac{m}{2}\left(\dot{x}^2+\dot{y}^2\right)\\ &=\frac{m}{2}\left(\dot{u}^2+\left[f(u)^\prime\right]^2\right)\\ &=\frac{m}{2}\left(\dot{u}^2+[f_u\dot{u}]^2\right)\\ &=\frac{m}{2}(1+f_u^2)\dot{u}^2 \end{align}

Where we’ve written fuf_u for the derivative. For a uniform gravitational field the potential is simply proportional to the height (by the constants gg giving strength of gravity and mm the particle’s mass). Thus we may take

V=my=mgf(u)V = my = mgf(u)

Putting these together gives the lagrangian for our system,

L=KV=m2(1+fu2)u˙2mgf\mathcal{L}=K-V=\frac{m}{2}\left(1+f_u^2\right)\dot{u}^2-mgf

The Calculus of Variations

Let u(t)u(t) be the coordinate representation of a particle moving along this curve for tIt\in I. The action of such a trajectory is given by the functional

S[u]:=ILdtS[u]:=\int_I \mathcal{L}\,dt

The physical trajectory of the particle is that which minimizes the action, which we find using the Euler-Lagrange equation:

Lu=ddtLu˙\frac{\partial\mathcal{L}}{\partial u}=\frac{d}{dt}\frac{\partial\mathcal{L}}{\partial\dot{u}}

Thus we need the derivatives of L\mathcal{L} with respect to u,u˙u,\dot{u} to get started:

Lu=u[m2(1+fu2)u˙2mgf]=m2[2fufuu]u˙2mgfu=mfu[fuuu˙2g]\begin{align} \frac{\partial\mathcal{L}}{\partial u}&=\frac{\partial}{\partial u}\left[\frac{m}{2}\left(1+f_u^2\right)\dot{u}^2-mgf\right]\\ &=\frac{m}{2}\left[2f_uf_{uu}\right]\dot{u}^2-mgf_u\\ &=mf_u\left[f_{uu}\dot{u}^2-g\right] \end{align} Lu˙=u˙[m2(1+fu2)u˙2mgf]=m(1+fu2)u˙\begin{align} \frac{\partial\mathcal{L}}{\partial \dot{u}}&=\frac{\partial}{\partial \dot{u}}\left[\frac{m}{2}\left(1+f_u^2\right)\dot{u}^2-mgf\right]\\ &=m(1+f_u^2)\dot{u} \end{align}

Next we need the total time derivative of this latter quantity:

ddtLu˙=ddtm(1+fu2)u˙=m[u˙ddt(1+fu2)+(1+fu2)ddtu˙]=m[u˙(2fufuuu˙)+(1+fu2)u¨]=m[2fufuuu˙2+(1+fu2)u¨]\begin{align} \frac{d}{dt}\frac{\partial\mathcal{L}}{\partial\dot{u}}&=\frac{d}{dt}m(1+f_u^2)\dot{u}\\ &=m\left[\dot{u}\frac{d}{dt}(1+f_u^2) + (1+f_u^2)\frac{d}{dt}\dot{u}\right]\\ &= m\left[\dot{u}(2f_{u}f_{uu}\dot{u})+(1+f_u^2)\ddot{u}\right]\\ &= m\left[2f_uf_{uu}\dot{u}^2+(1+f_u^2)\ddot{u}\right] \end{align}

Both sides of the Euler-Lagrange equation are proportional to mm, which then drops out of the equation yielding

fu[fuuu˙2g]=2fufuuu˙2+(1+fu2)u¨f_u\left[f_{uu}\dot{u}^2-g\right]=2f_uf_{uu}\dot{u}^2+(1+f_u^2)\ddot{u}

To simplify, we solve for u¨\ddot{u}:

(1+fu2)u¨=fu[fuuu˙2g]2fufuuu˙2=(fufuuu˙2+gfu)\begin{align}(1+f_u^2)\ddot{u}&=f_u\left[f_{uu}\dot{u}^2-g\right]-2f_uf_{uu}\dot{u}^2\\ &=-(f_uf_{uu}\dot{u}^2+gf_u) \end{align}

    u¨=fufuuu˙2+gfu(1+fu2)\implies \ddot{u}=-\frac{f_uf_{uu}\dot{u}^2+gf_u}{(1+f_u^2)}

This proves the claimed theorem.

← All posts