Lagrange equation


The Lagrange equation is a second order1 differential equation that finds the motion of a system from its energy:

ddtTq˙j(q(t),q˙(t),t)Tqj(q(t),q˙(t),t)=Qj\frac{d}{dt} \frac{ \partial T }{ \partial \dot{q}_{j} }(q(t),\dot{q}(t),t)- \frac{ \partial T }{ \partial q_{j} } (q(t),\dot{q}(t),t)=Q_{j}

Here TT is the kinetic energy, q(t)q(t) is the motion in generalized coordinates qjq_{j} and QjQ_{j} are the generalized forces. The value j=1,,nj=1,\ldots,n depends on the degrees of freedom nn of the system.

If the system is subject to conservative forces and can be written in terms of a Potential VV, we can further define the Lagrangian L=TVL=T-V to rewrite the equation as

ddtLq˙i(q(t),q˙(t),t)Lqi(q(t),q˙(t),t)=0\frac{d}{dt} \frac{ \partial L }{ \partial \dot{q}_{i} }(q(t),\dot{q}(t),t)-\frac{ \partial L }{ \partial q_{i} } (q(t),\dot{q}(t),t)=0

A dynamical system whose equations of motion can be written in this form is said to be a Lagrangian system.

The benefit of using a set of Lagrange equations over a set of Newton's second laws is that they allow picking a parameterization of the constraints such that the constraint forces vanish. The equations that are left can then be solved algorithmically by differentiation, which is typically far easier than what would be necessary with Newton's laws and can also be offloaded to a computer for numerical differentiation.

Validity

This equation is correct point-wise, for each tR+t\in \mathbb{R}^{+}, and for this reason it is said that the Lagrange equation describes motion locally (as opposed to globally). See Globally-determined motion.

Velocity-dependent forces

Many forces do not depend on velocity. Examples including the force applied by gravity or the spring pullback force. In these cases, the generalized forces, which inherits arguments from the regular forces, also do not. In other cases though, such as friction or the Lorentz force, the forces depend explicitly on velocity and the function signature becomes QjQj(q(t),q˙(t),t)Q_{j}\equiv Q_{j}(q(t),\dot{q}(t),t) with the force itself being

Qj=ddtVq˙j(q,t)Vqj(q,t)Q_{j}=\frac{d}{dt} \frac{ \partial V }{ \partial \dot{q}_{j} } (q,t)-\frac{ \partial V }{ \partial q_{j} } (q,t)

See the examples below on the Coriolis force, inertial frames and electromagnetic forces for practical results on this.

Kinetic energy

The general form of the Lagrange equation is in terms of kinetic energy. Fortunately, we have a very general expression for it

T(q,q˙,t)=12j,k=1najk(q,t)q˙jq˙k+l=1nbl(q,t)q˙l+12c(q,t)T(q,\dot{q},t)= \frac{1}{2}\sum_{j,k=1}^{n}a_{jk}(q,t)\dot{q}_{j}\dot{q}_{k}+\sum_{l=1}^{n} b_{l}(q,t)q̇_{l} + \frac{1}{2}c(q,t)

See Kinetic energy > In analytical mechanics for the derivation. We can substitute this into the Lagrange equation and take the derivatives directly. Starting from the derivative in qmq_{m} we get

Tqm=12j,k=1najkqmq˙jq˙k+l=1nblqmq˙l+12cqm\frac{ \partial T }{ \partial q_{m} } =\frac{1}{2}\sum_{j,k=1}^{n} \frac{ \partial a_{jk} }{ \partial q_{m} } \dot{q}_{j}\dot{q}_{k}+\sum_{l=1}^{n} \frac{ \partial b_{l} }{ \partial q_{m} } \dot{q}_{l}+ \frac{1}{2}\frac{ \partial c }{ \partial q_{m} }

As for the other derivative, it's a little more complicated:

Tq˙m=12j,k=1najkq˙jq˙mδjmq˙k+12j,k=1najkq˙jq˙kq˙mδkm+l=1nblq˙lq˙mδlm=\frac{ \partial T }{ \partial \dot{q}_{m} } =\frac{1}{2}\sum_{j,k=1}^{n} a_{jk}\underbrace{ \frac{ \partial \dot{q}_{j} }{ \partial \dot{q}_{m} } }_{ \delta_{jm} }\dot{q}_{k}+ \frac{1}{2}\sum_{j,k=1}^{n} a_{jk}\dot{q}_{j}\underbrace{ \frac{ \partial \dot{q}_{k} }{ \partial \dot{q}_{m} } }_{ \delta_{km} } +\sum_{l=1}^{n} b_{l}\underbrace{ \frac{ \partial \dot{q}_{l} }{ \partial \dot{q}_{m} } }_{ \delta_{lm} } =\ldots

where we used Kronecker deltas. These allows us to cut down on the sums:

=12k=1namkq˙k+12j=1najmq˙j+bm=\ldots=\frac{1}{2}\sum_{k=1}^{n} a_{mk}\dot{q}_{k}+ \frac{1}{2}\sum_{j=1}^{n} a_{jm}\dot{q}_{j}+b_{m}=\ldots

If we rename the second sum's index from jj to kk and remember that the matrix a\mathrm{a} is symmetric, we can write ajmakm=amka_{jm}\to a_{km}=a_{mk}, which leads to the exact same sum as the first. Summing the two we get

=k=1namk(q,t)q˙k+bm(q,t)\ldots=\sum_{k=1}^{n} a_{mk}(q,t)\dot{q}_{k}+b_{m}(q,t)

We now need to take the time derivative:

ddtTq˙m=k,h=1namkqhq˙hq˙k+k=1namkq¨k+h=1nbmqhq˙h\frac{d}{dt} \frac{ \partial T }{ \partial \dot{q}_{m} } =\sum_{k,h=1}^{n} \frac{ \partial a_{mk} }{ \partial q_{h} } \dot{q}_{h}\dot{q}_{k}+\sum_{k=1}^{n} a_{mk}\ddot{q}_{k}+\sum_{h=1}^{n} \frac{ \partial b_{m} }{ \partial q_{h} } \dot{q}_{h}

Note that the highest derivative of qq is the second, in q¨k\ddot{q}_{k}. This confirms that the Lagrange equation is a second order differential equation.

All of the partial derivatives of aa, bb and cc, alongside the generalized force QjQ_{j} are functions of qq and q˙\dot{q} composed with motion, so the whole differential equation can be written as

k=1namk(q(t),t)q¨k(t)=fm(q(t),q˙(t),t)\sum_{k=1}^{n} a_{mk}(q(t),t)\ddot{q}_{k}(t)=f_{m}(q(t),\dot{q}(t),t)

where fmf_{m} is a function that includes everything other than the amka_{mk} term. This is still a second order differential equation, just implicitly so since q¨\ddot{q} is "trapped" inside the sum. The left hand side now reads as a matrix product between the matrix a\mathrm{a} and the vector q¨\ddot{\mathbf{q}}, so we can write

aq¨=f\mathrm{a}\ddot{\mathbf{q}}=f

To continue, we'll apply the inverse matrix of a\mathrm{a} on both sides: a1aq¨=a1f\mathrm{a}^{-1}\mathrm{a}\ddot{\mathbf{q}}=\mathrm{a}^{-1}f. Since a1a=I\mathrm{a}^{-1}\mathrm{a}=\mathrm{I}, we get

q¨=a1f(q,q˙,t)\boxed{\ddot{\mathbf{q}}=\mathrm{a}^{-1}f(q,\dot{q},t)}

We now have the same equation in explicit form. What this tells us is that we can, at least in principle, find the motion from the inverse of the kinetic matrix applied onto a (vector-valued) function ff. Our next step then is to better understand what ff is.

Linearization

Like other differential equations, we can linearize the Lagrange equation near an equilibrium point in the approximation of small movement near that point. More correctly, it's not the Lagrange equation itself that we linearize, as much as the general form of the equation for q(t)q(t) that we do.

We assume that the motion q(t)q(t) is always near our equilibrium point q\mathbf{q}^{*} for all time, so that q(t)q1\lvert \mathbf{q}(t)-\mathbf{q}^{*} \rvert\ll 1 for all tt. This also implies that the velocity must be small: q˙(t)1\lvert \dot{\mathbf{q}}(t) \rvert\ll 1 (otherwise the moving object could not possibly remain near the equilibrium point). Also, this of course requires q\mathbf{q}^{*} to be stable, otherwise the object would diverge from it as soon as it starts moving, making it impossible for motion to be small.

We'll use a Coordinate transformation to set the equilibrium point in (0,0)(0,0); this just makes the treatment easier and no less general, as motion cannot possibly depend on the choice of coordinates. In these coordinates, q(t)1\lvert \mathbf{q}(t) \rvert\ll 1 and q˙(t)1\lvert \dot{\mathbf{q}}(t) \rvert\ll 1. We are now going to expand the Lagrangian in a Taylor series about (0,0)(0,0):

L(q,q˙)=L(0,0)+i=1nLqi(0,0)qi+i=1nLq˙i(0,0)q˙i+12i,j(2Lqiqj(0,0)qiqj+2Lqiq˙j(0,0)qiq˙j+2Lq˙iq˙j(0,0)q˙iq˙j)+O(q3,q2q˙,qq˙2,q˙3)\begin{align} L(\mathbf{q},\dot{\mathbf{q}})&=L(0,0) \\ &+\sum_{i=1}^{n} \frac{ \partial L }{ \partial q_{i} } (0,0)q_{i}+\sum_{i=1}^{n} \frac{ \partial L }{ \partial \dot{q}_{i}}(0,0)\dot{q}_{i} \\ &+\frac{1}{2}\sum_{i,j}\left( \frac{ \partial ^{2}L }{ \partial q_{i}q_{j} } (0,0) q_{i}q_{j}+\frac{ \partial ^{2}L }{ \partial q_{i}\dot{q}_{j} } (0,0)q_{i}\dot{q}_{j}+\frac{ \partial ^{2}L }{ \partial \dot{q}_{i}\dot{q}_{j} } (0,0)\dot{q}_{i}\dot{q}_{j}\right) \\ &+O(q^{3},q^{2}\dot{q},q\dot{q}^{2},\dot{q}^{3}) \end{align}

We'll ignore anything third order and above since motion is small. We now substitute L=TVL=T-V:

L(q,q˙)V(0)i=1nVqi(0)qi12i,j=1n2Vqiqj(0)qiqj+12i,j=1naij(0)q˙iq˙jL(\mathbf{q},\dot{\mathbf{q}})\simeq-V(0)-\cancel{ \sum_{i=1}^{n} \frac{ \partial V }{ \partial q_{i} } (0)q_{i} }- \frac{1}{2}\sum_{i,j=1}^{n} \frac{ \partial ^{2}V }{ \partial q_{i}\partial q_{j} } (0)q_{i}q_{j}+ \frac{1}{2}\sum_{i,j=1}^{n} a_{ij}(0)\dot{q}_{i}\dot{q}_{j}

where most terms vanish in the equilibrium point. V(0)V(0) is also constants, so we may as well redefine VV so that V(0)=0V(0)=0. This leaves us with

L(q,q˙)12i,j=1naij(0)q˙iq˙j12i,j=1n2Vqiqj(0)qiqjL(\mathbf{q},\dot{\mathbf{q}})\simeq\frac{1}{2}\sum_{i,j=1}^{n} a_{ij}(0)\dot{q}_{i}\dot{q}_{j}- \frac{1}{2}\sum_{i,j=1}^{n} \frac{ \partial ^{2}V }{ \partial q_{i}\partial q_{j} } (0)q_{i}q_{j}

or

L(q,q˙)12q˙Aq˙12qBq\boxed{L(\mathbf{q},\dot{\mathbf{q}})\simeq\frac{1}{2}\dot{\mathbf{q}}\cdot \mathrm{A}\dot{\mathbf{q}}- \frac{1}{2}\mathbf{q}\cdot \mathrm{B}\mathbf{q}}

where Aa(0)\mathrm{A}\equiv \mathrm{a}(0) is the kinetic matrix evaluated in the minimum and B\mathrm{B} is the "potential" matrix

Bij=2Vqiqj(0)B_{ij}=\frac{ \partial ^{2}V }{ \partial q_{i}q_{j} }(0)

Plugging this into the Lagrange equation yields

Aq¨+Bq=0\boxed{\mathrm{A} \ddot{\mathbf{q}}+\mathrm{B}\mathbf{q}=0}

which is a fully general, linearized form of the equation of motion for the approximate Lagrangian above2.

This is a homogeneous, linear, second-order ODE, so the solution isn't too difficult. There are 2n2n independent solutions and the general solution is the Linear combination of all of them. Following the guidance of the general theory (see Equilibrium point > Linearization near equilibrium points), we ansatz

q(t)=ρ(t)u\mathbf{q}(t)=\rho(t)\mathbf{u}

so

ρ¨(t)Au+ρ(t)Bu=0\ddot{\rho}(t)\mathrm{A}\mathbf{u}+\rho(t)\mathrm{B}\mathbf{u}=0

This equation only has nn nontrivial independent solutions if Au\mathrm{A}\mathbf{u} and Bu\mathrm{B}\mathbf{u} are parallel vectors, which is to say one is a scalar multiple of the other: Bu=λAu\mathrm{B}\mathbf{u}=\lambda \mathrm{A}\mathbf{u}. Plug this in and you get

ρ¨(t)=λρ(t)\ddot{\rho}(t)=-\lambda \rho(t)

This has two independent solutions.

Examples

> If the Lagrange equation is to be believed, this quantity contains the entire dynamics of the system, which we can extract by solving its Lagrange equations. To find it, we'll need the derivatives > $$\frac{ \partial L }{ \partial q } =-m\omega ^{2}q,\quad \frac{ \partial L }{ \partial \dot{q} } =m \dot{q}

We now need to take the time derivative of the second:

> Hence the equation > $$\frac{d}{dt} \frac{ \partial L }{ \partial \dot{q} } -\frac{ \partial L }{ \partial q }=0 \quad\Rightarrow \quad m\ddot{q}+m\omega ^{2}q=0\quad\Rightarrow \quad \ddot{q}=-\omega ^{2}q

which is the well known harmonic oscillator equation.

> The potential is $V(q,\dot{q})=-m(\dot{\mathbf{q}}\times \boldsymbol{\omega})\cdot \mathbf{q}$[^3]. Before we take the derivatives, we should expand the mixed product. The [[Scalar product]] of a [[cross product]] in general is > $$\begin{align} > (\mathbf{a}\times \mathbf{b})\cdot \mathbf{c}&=\left( \sum_{i,j,k=1}^{3} \epsilon_{ijk}a_{i}b_{j}\mathbf{e}_{k} \right)\cdot\left( \sum_{l}c_{l}\mathbf{e}_{l} \right) \\ > &=\sum_{i,j,k=1}^{3} \epsilon_{ijk}a_{i}b_{j}c_{l}\underbrace{ \mathbf{e}_{k}\cdot \mathbf{e}_{j} }_{ \delta_{kj} } \\ > &=\sum_{i,j,k=1}^{3} \epsilon_{ijk}a_{i}b_{j}c_{k} \\ > &=\sum_{i,j,k=1}^{3} \epsilon _{jki}b_{j}c_{k}a_{i} \\ > &=\mathbf{a}\cdot (\mathbf{b}\times \mathbf{c}) > \end{align}

using the Levi-Civita tensor and the Kronecker delta. Now we can rewrite the potential as

> The derivatives over the motion are > $$\frac{ \partial V }{ \partial \dot{q}_{j} } =-m(\boldsymbol{\omega}\times \mathbf{q})_{j}\quad\to \quad \frac{d}{dt} \frac{ \partial V }{ \partial \dot{q}_{j} } =-m(\boldsymbol{\omega}\times \dot{\mathbf{q}})=m(\dot{\mathbf{q}}\times \boldsymbol{\omega})_{j}

and also

> So if we plug these in the definition of the force components we get > $$F_{j}=2m(\dot{\mathbf{q}}\times \boldsymbol{\omega})_{j}

which is exactly our Coriolis force.

> The issue here figuring out the motion relative to the moving frame. Normally, this would require a lot of imagination and lengthy mathematics to try to understand the relative motion. The benefit of Lagrangian mechanics is that no such thing is needed: since frame changes lead to apparent forces, the process of figuring this out is identical to any other force and is just a matter of applying the usual mathematical algorithm; no fancy methods required. > > Since it's inertial, the frame must move at a constant velocity. In our case, we set it to uniform circular motion of [[Frequency|angular frequency]] $\omega$ on the $xy$ plane, such that the [[Coordinate transformation]] is > $$x=q_{1}\cos \omega t-q_{2}\sin \omega t,\quad y=q_{1}\sin \omega t-\cos \omega t,\quad z=q_{3}

The Lagrangian is dependent only on the derivatives, so we find those

\dot{x}&=\dot{q}_{1}\cos \omega t-\dot{q}_{2}\sin \omega t-q_{1}\omega \sin \omega t-q_{2}\omega \cos \omega t \\ \dot{y}&=\dot{q}_{1}\sin \omega t+\dot{q}_{2}\cos \omega t+q_{1}\omega \cos \omega t-q_{2}\omega \sin \omega t \\ \dot{z}&=\dot{q}_{3} \end{align}
> We now add these in the Lagrangian equation. As you might imagine, this leads to a really complicated expression due to the squares. Thankfully, we can use some trigonometry to delete some terms before we even write them. For one, $\cos ^{2}\theta+\sin ^{2}\theta=1$ merges several terms and $\cos ^{2}\theta-\sin ^{2}\theta=$; you can see these stacked on top of each other in $\dot{x}$ and $\dot{y}$. In the end, we get > $$L(\dot{x},\dot{y},\dot{z})=\frac{m}{2}(\dot{q}^{2}_{1}+\dot{q}^{2}_{2}+\dot{q}^{2}_{3})+ \frac{m}{2}\omega ^{2}(q_{1}^{2}+q_{2}^{2})-m \dot{q}_{1}q_{2}\omega+m \dot{q}_{2}q_{1}\omega

The last two terms can be rewritten to be more meaningful using a cross product:

> The final result is > $$L(\dot{x},\dot{y},\dot{z})=\frac{m}{2}(\dot{q}^{2}_{1}+\dot{q}^{2}_{2}+\dot{q}^{2}_{3})+ \frac{m}{2}\omega ^{2}(q_{1}^{2}+q_{2}^{2})-m\omega(\mathbf{q}\times \dot{\mathbf{q}}) > for a charge $e$ (we're not using $q$ to avoid overwriting the generalized coordinate). The [[electric field]] is in general > $$\mathbf{E}=-\left( \nabla \phi+\frac{ \partial \mathbf{A} }{ \partial t } \right)

and the magnetic field is

> where $\phi$ is the [[electric potential]] (not to be confused with $V$ the potential *energy*) and $\mathbf{A}$ is the [[magnetic vector potential]]. > > The potential energy is given by

V(q,\dot{q})=e\phi-e \dot{\mathbf{q}}\cdot \mathbf{A}

> Now we have everything we need to find the force: > $$\begin{align} > F_{n}&=\frac{d}{dt} \frac{ \partial V }{ \partial \dot{q}_{n} } -\frac{ \partial V }{ \partial q_{n} } \\ > &=\frac{d}{dt} (-eA_{n}(q,t))-e\frac{ \partial \phi }{ \partial q_{n} } +e \dot{\mathbf{q}}\cdot \frac{ \partial \mathbf{A} }{ \partial q_{n} } \\ > &=-e\frac{ \partial A_{n} }{ \partial t } -e\sum_{k=1}^{3} \frac{ \partial A_{n} }{ \partial q_{k} } \dot{q}_{k}-e\frac{ \partial \phi }{ \partial q_{n} } +e\sum_{l=1}^{3} \dot{q}_{l} \frac{ \partial A_{l} }{ \partial q_{n} } \\ > &=-e\left( \frac{ \partial \phi }{ \partial q_{n} } +\frac{ \partial A_{n} }{ \partial t } \right)+e\sum_{l=1}^{3} \dot{q}_{l}\frac{ \partial A_{l} }{ \partial q_{n} } -e\sum_{k=1}^{3} \dot{q}_{k}\frac{ \partial A_{n} }{ \partial q_{k} } > \end{align}

This is kind of a mess: ideally there's some vector operations to compress this into. In fact, if this is to be equal to the Lorentz force, then the last two terms must end up being e(q˙×(×A))ne(\dot{\mathbf{q}}\times(\nabla\times \mathbf{A}))_{n}. Using the shorthand AjqiiAj\frac{ \partial A_{j} }{ \partial q_{i} }\equiv\partial_{i}A_{j}, we find that

-[(\nabla\times \mathbf{A})\times \dot{\mathbf{q}}]_{n}&=-\sum_{l,m=1}^{3} \left( \sum_{i,j=1}^{3} \epsilon_{lij} \partial_{i}A_{j} \right)\dot{q}_{m}\epsilon_{nlm} \\ &=\sum_{m,i,j=1}^{3} \partial_{i}A_{j}\dot{q}_{m}\sum_{l=1}^{3} \underbrace{ \epsilon_{lij}\epsilon_{lnm} }_{ \delta_{in}\delta_{jm}-\delta_{im}\delta_{jn} } \\ &=\sum_{m,i,j=1}^{3} \partial_{i}A_{j}\dot{q}_{m}\delta_{in}\delta_{jm}-\sum_{m,i,j=1}^{3} \partial_{i}A_{j}\dot{q}_{m}\delta_{im}\delta_{jn} \\ &=\ldots \end{align}
> Here we use the Kronecker deltas to delete some indexes. $i$ and $j$ vanish, leaving only $n$ and $m$. The last step is > $$\ldots=\sum_{m=1}^{3} \dot{q}_{m}\frac{ \partial A_{n} }{ \partial q_{m} } -\dot{q}_{n}\frac{ \partial A_{m} }{ \partial q_{n} }

which are the terms above.

The Lagrangian can then be written in general as

> which is a [[Lagrange equation]] of the form $m \ddot{q}=\mathbf{F}$. > > If $\mathbf{B}=0$, then $\nabla\times \mathbf{A}=0$ and $\mathbf{E}=-\nabla \phi$. Since the vector potential is now irrotational, it can also be expressed by a potential, say $\chi$, as $\mathbf{A}=\nabla \chi$. (TODO: Finish this, end of lesson 26/03/2025; gauge transformation). > > If $\mathbf{B}$ is constant, then we want to find what kind of $\mathbf{A}$ leads to a constant $\nabla\times \mathbf{A}$. If $\mathbf{B}$ is entirely on the $z$ axis, we have > $$\mathbf{B}=\begin{pmatrix} > 0 \\ > 0 \\ > B > \end{pmatrix},\qquad \mathbf{A}=\frac{1}{2}\begin{pmatrix} > -B_{y} \\ > B_{x} \\ > 0 > \end{pmatrix}

In fact, the curl of A\mathbf{A} is

\mathbf{e}_{1} & \partial_{x} & - \frac{B_{y}}{2} \\ \mathbf{e}_{2} & \partial_{y} & \frac{B_{x}}{2} \\ \mathbf{e}_{3} & \partial_{z} & 0 \end{pmatrix}=\left( \frac{B}{2}+ \frac{B}{2} \right)\mathbf{e}_{3}=\begin{pmatrix} 0 \\ 0 \\ B \end{pmatrix}
> The Lagrangian is > $$L=\frac{m}{2}(\dot{x}^{2}+\dot{y}^{2}+\dot{z}^{2})+ \frac{e}{2}B(x \dot{y}-y \dot{x})=\frac{m}{2}(\dot{r}^{2}+r^{2}\dot{\varphi}^{2}+\zeta ^{2})+ \frac{e}{2}B^{2}r^{2}\dot{\varphi}

where we also switched to cylindrical coordinates.

> The velocity vector $\mathbf{v}=(\dot{x},\dot{y},\dot{z})$ is also easy to find: > $$\dot{x}=R\cos \theta \cos \phi \dot{\theta}-R\sin \theta \sin \phi \dot{\phi},\quad y=R\cos \theta \sin \phi \dot{\theta}+R\sin \theta \cos \phi \dot{\phi},\quad z=-R\sin \theta \dot{\theta}

This is enough to find the kinetic energy

T&=\frac{1}{2}m(\dot{x}^{2}+\dot{y}^{2}+\dot{z}^{2}) \\ &=\frac{1}{2}m[(R^{2}\cos ^{2}\theta \cos ^{2}\phi \dot{\theta}^{2}-\cancel{ 2R^{2}\dot{\theta}\dot{\phi}\cos \theta \cos \phi \sin \theta \sin \phi }+R^{2}\sin ^{2}\theta \sin ^{2}\phi \dot{\phi} ^{2}) \\ &\qquad \quad+(R^{2}\cos ^{2}\theta \sin ^{2}\phi \dot{\theta}^{2}+\cancel{ 2R^{2}\dot{\theta}\dot{\phi}\cos \theta \sin \phi \sin \theta \cos \phi }+R^{2}\sin ^{2} \theta \cos ^{2}\phi \dot{\phi}^{2}) \\ &\qquad \quad+(R^{2}\sin ^{2}\theta \dot{\theta}) ] \\ &=\frac{1}{2}m[R^{2}\sin ^{2}\theta \dot{\phi}^{2}+R^{2}\dot{\theta }^{2}] \end{align}
> where we used $\sin ^{2}x+\cos ^{2}x=1$. Remember that this quantity needs to be equal to > $$T=\frac{1}{2}\sum_{j,k=1}^{n} a_{jk}\dot{q}_{j}\dot{q}_{k}

In our case, n=2n=2 and q1=ϕq_{1}=\phi and q2=θq_{2}=\theta, so

> The two off-diagonal mixed terms must evidently be null, whereas the diagonal terms must be $mR^{2}\sin ^{2}\theta$ and $mR^{2}$ respectively. The kinetic matrix then is > $$\mathrm{a}=\begin{pmatrix} > mR^{2}\sin ^{2}\theta & 0 \\ > 0 & mR^{2} > \end{pmatrix}

This is a function of qq, since it depends on θ\theta.

We now need the potential energy. For a pendulum, it's just gravity, so V=mgz=mgRcosθV=mgz=mgR\cos \theta. With both kinds of energies determined, we are ready to write the Lagrangian:

> Through this, we get to the two Lagrange equation we need (one in $\theta$ and one in $\phi$). Firstly, let's differentiate $L$. > $$\frac{ \partial L }{ \partial \theta }=mR^{2}\sin \theta \cos \theta \phi ^{2}+mgR\sin \theta,\quad\frac{ \partial L }{ \partial \dot{\theta} } =mR^{2}\dot{\theta},\quad \frac{d}{dt} \frac{ \partial L }{ \partial \dot{\theta} } =mR^{2}\ddot{\theta}

which leads to

> Dividing through by $mR^{2}$ we get > $$\boxed{\ddot{\theta}=\sin \theta \cos \theta \phi ^{2}+ \frac{g}{R}\sin \theta}

Doing the same thing for ϕ\phi gives

> and so > $$mR^{2}\sin ^{2}\theta \ddot{\phi}=-2mR^{2}\sin \theta \cos \theta \dot{\theta}\dot{\phi}

Dividing through by mR2sin2θmR^{2}\sin ^{2}\theta gives

> When solved, these two equations provide the motion in both coordinates. We can then use the coordinate transformation to convert to $x,y,z$. Note how these equations depend on each other, since $\phi$ appears in the $\ddot{\theta}$ equation and $\theta$ appears in $\ddot{\phi}$. These are so-called *coupled* equations and they are generally very difficult, if possible, to solve by hand. A [[Numerical integration]] method is often needed. > [!example]- Pendulum with a spring joint > In this example, we'll analyze how a spring interacts with gravity. Consider a point mass attached to the $x$ axis by a spring of some elastic constant that always remains exactly vertical. Gravity pulls the mass down. Crucially, the spring is allowed to slide over the $x$ axis: thing of it like a coat hanger on a metal pipe of sorts. > > ![[Diagram Spring pendulum.svg]] > > We'll use [[polar coordinates]], with a distance $l$ and an angle $q$. The coordinate transformation back to $x$ and $y$ is $x=l\sin q$ and $y=-l\cos q$. Their derivatives are $\dot{x}=l\cos q\dot{q}$ and $\dot{y}=l\sin q\dot{q}$, which leads to kinetic energy > $$T=\frac{1}{2}m(\dot{x}^{2}+\dot{y}^{2})=\frac{1}{2}m(l^{2}\cos ^{2}q \dot{q}^{2}+l^{2}\sin ^{2}q \dot{q}^{2})=\frac{1}{2}ml^{2}\dot{q}^{2}

The potential energy is a mix of gravitational and elastic potential:

> The Lagrangian is the usual $L=T-V$, but here it's more interesting to look at [[equilibrium point|equilibrium points]]. To find them, we need to find [[Punto critico|stationary points]] of the potential: > $$V'(q)=mgl\sin q-kl^{2}\cos q\sin q=kl^{2}\sin q\left[ \frac{mg}{kl}-\cos q \right]

This nullifies at sinq=0\sin q=0, which means q=0,πq=0,\pi. Alternatively, it nullifies for cosq=mg/kl\cos q=mg/kl, which means q=arccos(mg/kl)q=\arccos(mg/kl). Well, sort of. The arccosine is only defined in [1,1][-1,1], so we can't allow mg/klmg/kl to have any value. Such an equilibrium point only exists if mg/kl1mg/kl\leq1 (it's >0>0 because m,g,k,lm,g,k,l are all >0>0). To find which of these are minima, we need the second derivative:

V''(q)&=mgl\cos q-kl^{2}\cos ^{2}q+kl^{2}\sin ^{2}q \\ &=mgl\cos q-2kl^{2}\cos q+kl^{2} \end{align}
> For our guess in $q=0$ we see > $$V''(0)=mgl-kl^{2}=\left( \frac{mg}{kl}-1 \right)kl^{2}

mg/kl>1mg/kl>1, the V(0)>0V''(0)>0 and the point is stable. Else it is unstable. If mg/kl=1mg/kl=1, V(0)=0V''(0)=0, which gives us no information on the point. We'd need the third derivative, or some other information about the point, which is beyond the interest of this example.

The guess q=πq=\pi leads to V(π)=mglkl2V''(\pi)=-mgl-kl^{2} which is <0<0 everywhere, so it's never stable.

Now, as for the arccosine point, we can qualitatively analyze mg/klmg/kl. Since gg doesn't change and mm is not part of the construction, we'll look at kk and ll. If the spring constant is very small (k1k\ll 1, and thus the string "pulls" very little), this value is very large, and so never <1<1. This tells us that this equilibrium point is reliant on a strong enough spring, or alternatively a very large pendulum (l1l\gg 1). In fact, if we look at the actual contraption, you'll see that the gravitational force applied to the point mass is going downwards (since g\mathbf{g} is also going downwards), but the spring response is going in the exact opposite direction, upwards. If the spring response is strong enough (read: kk is big), then it can fully cancel out gg and leave no force left, thus leaving the system at rest. But again, this can only happen if the spring is strong enough to counteract gravity; anything weaker and it'll be overcome.

Quantitatively, we'll check the potential. Call the two possible equilibrium points q=arccos(mg/kl)q^{*}=\arccos(mg/kl) and q-q^{*}:

V''(\pm q^{*})&=mgl \frac{mg}{kl}-2kl^{2} \left( \frac{mg}{kl} \right)^{2}+kl^{2} \\ &=\frac{(mg)^{2}}{k}- 2 \frac{(mg)^{2}}{k}+kl^{2} \\ &=\frac{(kl)^{2}- (mg)^{2}}{k} \\ &=\frac{(kl-mg)(kl+mg)}{k}> 0 \end{align}
> This is because if these points exist, then $mg/kl<1$, which means $mg<kl$ and so $kl-mg>0$. So if the points exists, they are always stable. In summary: > > $$\begin{array}{c|c} > & \frac{mg}{kl}<1 & \frac{mg}{kl}>1 \\ > q=0 & \text{unstable} & \text{stable} \\ > q=\pi & \text{unstable} & \text{unstable} \\ > q^{*} & \text{stable} & - \\ > -q^{*} & \text{stable} & - > \end{array}

When plotted, they look like this:

The two qq^{*} points split in the middle as the parameter mg/klmg/kl goes lower. This shape is called a bifurcation and this graph allows us to get an idea of how the potential looks like by tracing a vertical line anywhere in the graph to fix any one mg/klmg/kl. Since stable points are potential minima and unstable ones are potential maxima, our potential has two behaviors. When mg/kl1mg/kl\geq1, it's a rather typical parabola, with maxima at q=±πq=\pm \pi and minima at q=0q=0; about what you'd expect from the usual pendulum. But when the spring gets rigid enough, mg/kl<1mg/kl<1 and we start to see the characteristic behavior of this pendulum. The vertical is no longer a stable equilibrium point, so the two new "oblique" equilibrium points ±q\pm q^{*} come in as the "replacement" minima. This gives the potential two valleys with an additional central peak at q=0q=0.

Footnotes

  1. q(t)q(t) and q˙(t)\dot{q}(t) are implicit in TT, whereas q¨(t)\ddot{q}(t) appears when taking the time derivative in the first term.

  2. We could have reached the same result by linearizing the ODEs of a generic Lagrangian system q˙=v,v˙=f(q,η)\dot{\mathbf{q}}=\mathbf{v},\dot{\mathbf{v}}=f(\mathbf{q},\boldsymbol{\eta}).