# Application of Euler-Lagrange equations (Trivial problem, instructive one)

I have some doubt about a really trivial and simple problem in which I have to use ELE.

Supposing I have a pendulum, in which the rope is a spring, so it's length may change in time. I have a mass M and the spring rest length is $\ell$. I have to find the Lagrangian of the system, and the equations of motions.

Then I start finding $\mathcal{L} = T - V$

$$T = \frac{1}{2}m v^2$$

and to find $v$, remembering that $v^2 = \dot{x}^2 + \dot{y}^2$ I simply perform a change of coordinates with

$$x = \ell\cos\theta$$ $$y = \ell\sin\theta$$

and I'll get

$$v^2 = \dot{\ell}^2 + \ell^2\dot{\theta}^2$$

which leads me to have the kinetic energy $$T = \frac{1}{2}m\left(\dot{\ell}^2 + \ell^2\dot{\theta}^2\right)$$

Hope it's fine until here

Then The first problem: the potential $V$. I know that for a pendulum I can use $V = mg\ell\cos\theta$ but considering the rope is a spring, should I add to that term the elastic recall force $kx = k\ell\cos\theta$?

This would mean

$$V = (mg - k)\ell\cos\theta$$

but now a problem arises: $(mg - k)$ cannot be calculated because dimensions of $mg$ isn't the same of $k$ so where am I wrong?

EDIT AFTER FIRST ANSWER - UNDERSTOOD THIS I was using a Force, whilst I had to use, of course, the potential $\frac{1}{2}kx^2$

The potential then becomes

$$V = mg\ell\cos\theta - \frac{1}{2}k\ell^2\cos^2\theta$$

Continuing

After finding out what $V$ is, I get $\mathcal{L} = T - V$ so I'm ready for ELE:

$$\frac{\partial \mathcal{L}}{\partial \dot{q}_i} - \frac{d}{dt}\frac{\partial\mathcal{L}}{\partial q_i} = 0$$

I know we have Einstein convention about the $i$-index so here arises another problem: my generalized coordinates will be $q_1 = \ell$ and $q_2 = \theta$.

How will Euler-Lagrange equations be written? Will I have two coupled equations or one single chaotic equation?

ELE

So I cam up with those Euler-Lagrange equations. Taking into account the comment below, I don't really know if it's good to name $\ell = l - l_0$. Anyway, those should be the equations. Are they correct?

$$m\ell^2\dot{\theta} = \frac{\text{d}}{\text{d}t}\left(\left[mg - \frac{k}{2}\ell\right]\ell\sin\theta\right) = 0$$

$$m\dot{\ell} = \frac{\text{d}}{\text{d}t}\left(m\ell\dot{\theta}^2 - mg\cos\theta + k\ell\cos\theta\right)$$

• @BruceLee is correct about the force/energy confusion, but here is another issue. You are using the rope length as both a constant and a variable. You define it as a rest lenght initially, but then allow it to vary later. You should make a distinction (ie $l_0$ for rest length and $l$ for the variable). Then the potential term to be added is $k/2(l-l_0)^2$. Jan 7, 2016 at 14:03
• Uhm.. can't I simply rename $\ell = l - l_0$? I guess nope.. Something will change in the polar coordinates then. Jan 7, 2016 at 14:31

Well you are adding force terms in an expression for energy. The potential energy of a spring is $1/2kx^2$ and that is what needs to be added.
And in this case since $l$ and $\theta$ are both variables you will have two coupled differential equations to solve for.
• So, did I write them correctly? Assuming also my hypothesis by which writing $\ell = l - l_0$ holds.. Jan 7, 2016 at 16:39