Ars Numerandi

Double pendulum

\(x_1=l_1\sin\left(\theta_1\right),\quad y_1=-l_1\cos\left(\theta_1\right)\)
\(x_2=l_2\sin\left(\theta_2\right)+l_1\sin\left(\theta_1\right),\quad y_2=-l_2\cos\left(\theta_2\right)-l_1\cos\left(\theta_1\right)\)

$$L\left(\theta_1,\dot{\theta}_1,\theta_2,\dot{\theta}_2\right)=\frac{m_1(\dot{x}_1^2+\dot{y}_1^2)}{2}+\frac{m_2(\dot{x}_2^2+\dot{y}_2^2)}{2}-m_1gy_1-m_2gy_2=$$
$$=\frac{m_1l_1^2\dot{\theta}_1^2}{2}+\frac{m_2\left(l_1^2\dot{\theta}_1^2+l_2^2\dot{\theta}_2^2+2l_1l_2\cos\left(\theta_2-\theta_1\right)\dot{\theta}_1\dot{\theta}_2\right)}{2}+$$
$$+\left(m_1+m_2\right)gl_1\cos\left(\theta_1\right)+m_2l_2\cos\left(\theta_2\right)$$

Lagrange's equations:
$$\frac{d}{dt}\left(\frac{\partial L}{\partial{\dot{\theta}_1}}\right)-\frac{\partial L}{\partial\theta_1}=0$$
$$(m_1+m_2)l_1^2\ddot{\theta}_1+m_2l_1l_2\left(-\dot{\theta}_2^2\sin\left(\theta_2-\theta_1\right)+\ddot{\theta}_2\cos\left(\theta_2-\theta_1\right)\right)+(m_1+m_2)gl_1\sin(\theta_1)=0$$

$$\frac{d}{dt}\left(\frac{\partial L}{\partial{\dot{\theta}_2}}\right)-\frac{\partial L}{\partial\theta_2}=0$$
$$m_2l_2\left(l_2\ddot{\theta}_2+l_1\dot{\theta}_2^2\sin\left(\theta_2-\theta_1\right)+l_1\ddot{\theta}_1\cos\left(\theta_2-\theta_1\right)+g\sin\left(\theta_2\right)\right)=0$$



#physics #mechanics