```python
from sympy.physics.mechanics import *
import sympy as sp
mechanics_printing(pretty_print=True)
```


```python
m, M, l = sp.symbols(r'm M l')
t, g = sp.symbols('t g')
r, v = dynamicsymbols(r'r \theta')
dr, dv = dynamicsymbols(r'r \theta', 1)
```


```python
x = r*sp.sin(v)
y = -r*sp.cos(v)
X = sp.Rational(0,1)
# l = Y+r
Y = l-r

dx = x.diff(t)
dy = y.diff(t)
dX = X.diff(t)
dY = Y.diff(t)
```


```python
V = m*g*y + M*g*Y
T = sp.Rational(1, 2)*m*(dx**2+dy**2)+sp.Rational(1, 2)*M*(dX**2+dY**2)
L = T - V
```


```python
LM = LagrangesMethod(L, [r, v])
```


```python
soln = LM.form_lagranges_equations()
```


```python
soln
```


```python
sp.solve((soln[0],soln[1]),(r.diff(t,t),v.diff(t,t)))
```

094f6e0a5729b9b1c9965dbd38372ba3164f2cfe
ipynb
Jupyter Notebook
Pendula/Misc/PendulumHangingMass/PendulumHangingMass.ipynb
ethank5149/Classical-Mechanics
4684cc91abcf65a684237c6ec21246d5cebd232a
MIT
Pendula/Misc/PendulumHangingMass/PendulumHangingMass.ipynb
ethank5149/Classical-Mechanics
4684cc91abcf65a684237c6ec21246d5cebd232a
MIT
Pendula/Misc/PendulumHangingMass/PendulumHangingMass.ipynb
ethank5149/Classical-Mechanics
4684cc91abcf65a684237c6ec21246d5cebd232a
MIT
Qwen/Qwen-72B
1. YES
2. YES