# Lagrangian of two masses connected by a spring in semicircle

Tags:
1. Dec 15, 2015

### Klas

1. The problem statement, all variables and given/known data
Two masses are connected by a weightless spring in a friction-less semicircular well (Picture included). Derive the equations of motion with help of lagrange

2. Relevant equations
L = T - U = kinetic energy - potential energy

3. The attempt at a solution
$L = \frac{1}{2}m_1(\dot{x_1}^2 + \dot{y_1}^2) + \frac{1}{2}m_2(\dot{x_2}^2 + \dot{y_2}^2) - (m_1gx_1 + m_2gx_2 + \frac{1}{2}k(\sqrt{x^2-y^2} -l_0)^2)$

Where:
$x_1 = R\cos\theta_1, \;\;x_2 = R\cos(\theta_1+\theta_2) \\y_1 = R\sin\theta_1, \;\;y_2 = R\sin(\theta_1+\theta_2)$
$x=x_2-x_1$
$y=y_2-y_1$

I think I'm gonna be able to get the equation of motion from here if only L is right...
And if it's correct it feels like the EOM will be a pain in the ass from here but it feels like I'm missing something rather essential here?

I'll be thankful for any help

Last edited: Dec 15, 2015
2. Dec 15, 2015

### DocZaius

Your gravitational potential energy is of the form "mgy" yet your y seems to point down in your definition.

3. Dec 15, 2015

### Klas

I guess you mean it should rather be $mgRcos(\theta)$. I'm have put potential zero at the bottom so at $mgRcos0$ it should be the max potential energy.

Did an edit on the original post

4. Dec 15, 2015

### DocZaius

No I meant that your gravitational potential terms should be of the form -mgy instead of mgy since you have y increasing downwards in your definition.

5. Dec 15, 2015

### Klas

I see what you mean. If I rewrite it as $L = \frac{1}{2}m_1(\dot{x_1}^2 + \dot{y_1}^2) + \frac{1}{2}m_2(\dot{x_2}^2 + \dot{y_2}^2) - (-m_1gy_1 - m_2gy_2 + \frac{1}{2}k(\sqrt{x^2-y^2} -l_0)^2)$
should it be correct then?

And if, when I rewrite it with $\theta_1, \theta_2$ this part is gonna be hard to partial derivative with respect to $\theta1, \theta2$ $(\sqrt{x^2-y^2} -l_0)^2) = (\sqrt{(Rcos(\theta_1+ \theta_2)-Rcos(\theta_1))^2+(Rsin(\theta_1+\theta_2)+Rsin(\theta_2))^2)}-l_0)^2$

Last edited: Dec 15, 2015
6. Dec 15, 2015

### DocZaius

You still have x's in your potential energy. You should put the y's back in. Just make sure to keep the negatives. The rest of the Lagrangian looks good to me.

7. Dec 15, 2015

### Klas

Fixed it. Any tips on how to deal with $(\sqrt{x^2-y^2} -l_0)^2) = (\sqrt{(Rcos(\theta_1+ \theta_2)-Rcos(\theta_1))^2+(Rsin(\theta_1+\theta_2)+Rsin(\theta_2))^2)}-l_0)^2$ when I'm gonna partial derivative it later?

Thank you for all your help!

8. Dec 15, 2015

### TSny

Express $T$ and $U$ in terms of $\theta_1$ and $\theta_2$ and their time derivatives. For the distance between the masses, consider the right triangle shown below where one leg of the triangle bisects $\theta_2$.

#### Attached Files:

• ###### triangle.png
File size:
18.9 KB
Views:
58
9. Dec 15, 2015

### Klas

$L = \frac{1}{2}m_1R^2\dot{\theta_1}^2 + \frac{1}{2}m_2R^2(\dot{\theta_1} + \dot{\theta_2})^2 + m_1gRcos\theta_1 + m_2gRcos(\theta_1 + \theta_2) -(\sqrt{(Rcos(\theta_1+ \theta_2)-Rcos(\theta_1))^2+(Rsin(\theta_1+\theta_2)+Rsin(\theta_2))^2)}-l_0)^2$
Is what I get. Since:
$\dot{x_1}^2 + \dot{y_1}^2 = (-R\dot{\theta_1}sin\theta_1)^2 + (R\dot{\theta_1}cos\theta_1)^2 = R^2\dot{\theta_1}^2(cos^2\theta_1 + sin^2\theta_2) = R^2\dot{\theta_1}^2*1$.

TSny. I'm still unsure what to do with that.. For the partial derivative when coming to the sqrt.. Is there anything I'm missing to make my life easier with that part or is it just time to get my hands dirty?

10. Dec 15, 2015

### TSny

You should be able to avoid the square root. Don't use Cartesian coordinates at all.