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)) 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 f under a uniform downwards gravitational field of strength g follows the trajectory
t↦(u(t),f(u(t))) determined by the following differential equation:
u¨=−fu(1+fu2)fuuu˙2+g
The Lagrangian
The kinetic energy of a particle is 21mv2, where in R2 the square velocity is given in coordinates by v2=x˙2+y˙2. Confined to the curve (u,f(u)) this becomes
Where we’ve written fu for the derivative. The factor (1+fu2) is the only place the curve enters the kinetic energy, and it is there for a simple reason: a particle whose coordinate u advances at rate u˙ is not moving through the plane at rate u˙, because the curve lifts it as well.
For a uniform gravitational field the potential is simply proportional to the height (by the constants g giving strength of gravity and m the particle’s mass). Thus we may take
V=my=mgf(u)
Putting these together gives the lagrangian for our system,
L=K−V=2m(1+fu2)u˙2−mgf
The Calculus of Variations
Let u(t) be the coordinate representation of a particle moving along this curve for t∈I. The action of such a trajectory is given by the functional
S[u]:=∫ILdt
The physical trajectory of the particle is that which minimizes the action, which we find using the Euler-Lagrange equation:
∂u∂L=dtd∂u˙∂L
Thus we need the derivatives of L with respect to u,u˙ to get started:
It is worth seeing what the two correction terms actually cost, because the temptation is to ignore them. Take the parabola f(u)=2ku2, where fu=ku and fuu=k, so the theorem reads
u¨=−ku1+k2u2ku˙2+g
Near the bottom of the bowl u and u˙ are both small, the two quadratic terms drop out, and what is left is u¨=−gku: the harmonic oscillator, with frequency ω=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=21gku2; what the bowl adds is the factor (1+k2u2) multiplying u˙2. Away from the bottom the bead has to climb as well as advance, so a given u˙ costs more energy — and the energy is fixed, by the height it was released from. Released from u=A, the bead satisfies
u˙2=1+k2u2gk(A2−u2)
against the oscillator’s u˙2=gk(A2−u2). It is slower at every point but the very bottom, and slower by exactly the factor 1+fu2 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.