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.

TheoremGravity 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. The factor (1+fu2)(1+f_u^2) is the only place the curve enters the kinetic energy, and it is there for a simple reason: a particle whose coordinate uu advances at rate u˙\dot{u} is not moving through the plane at rate u˙\dot{u}, because the curve lifts it as well.

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.

The Bowl is Not a Spring

It is worth seeing what the two correction terms actually cost, because the temptation is to ignore them. Take the parabola f(u)=k2u2f(u)=\tfrac{k}{2}u^2, where fu=kuf_u=ku and fuu=kf_{uu}=k, so the theorem reads

u¨=kuku˙2+g1+k2u2\ddot{u}=-ku\frac{k\dot{u}^2+g}{1+k^2u^2}

Near the bottom of the bowl uu and u˙\dot{u} are both small, the two quadratic terms drop out, and what is left is u¨=gku\ddot{u}=-gku: the harmonic oscillator, with frequency ω=gk\omega=\sqrt{gk}. This is the approximation one is really making when one says a ball rolling in a bowl is a spring.

Away from the bottom it fails, and always in the same direction. The reason is not in the equation of motion but back in the kinetic energy. Both systems have the same potential V=12gku2V=\tfrac{1}{2}gku^2; what the bowl adds is the factor (1+k2u2)(1+k^2u^2) multiplying u˙2\dot{u}^2. Away from the bottom the bead has to climb as well as advance, so a given u˙\dot{u} costs more energy — and the energy is fixed, by the height it was released from. Released from u=Au=A, the bead satisfies

u˙2=gk(A2u2)1+k2u2\dot{u}^2=\frac{gk(A^2-u^2)}{1+k^2u^2}

against the oscillator’s u˙2=gk(A2u2)\dot{u}^2=gk(A^2-u^2). It is slower at every point but the very bottom, and slower by exactly the factor 1+fu2\sqrt{1+f_u^2} that the velocity triangle measures. So it always takes longer to come back, and it falls further behind the higher it starts. A spring’s period does not depend on amplitude at all.

← All notes