```python
from sympy import symbols, sin, cos, sqrt, trigsimp
from sympy.physics.mechanics import ReferenceFrame, Point, dynamicsymbols, init_vprinting
```


```python
init_vprinting()
```


```python
r, h, l, m, g = symbols('r, h, l, m, g', positive=True, real=True)
theta = dynamicsymbols('theta')
```


```python
N = ReferenceFrame('N')
A = N.orientnew('A', 'Axis', (theta, N.z))
```


```python
R = r * A.y + r * theta * A.x + h / 2 * A.y
R
```


```python
R.express(N)
```


```python
o = Point('o')
o.set_vel(N, 0)
p = o.locatenew('p', R)
p.set_vel(A, R.diff(dynamicsymbols._t, A))
p.v1pt_theory(o, N, A)
```


```python
p.vel(N).magnitude().simplify()
```


```python
R.diff(dynamicsymbols._t, A).simplify()
```


```python
(r * theta.diff() * A.x + (theta.diff() * A.z).cross(r * theta * A.x + (r + h / 2) * A.y)).simplify()
```


```python
sqrt((r * theta * theta.diff())**2 + ((r + h / 2) * theta.diff() - r * theta.diff())**2).simplify()
```


```python
v = R.diff(dynamicsymbols._t, N).magnitude().simplify()
v
```


```python
v.subs({theta.diff(): symbols('theta_d', real=True)}).simplify()
```


```python
(sqrt((R.magnitude().diff(dynamicsymbols._t)**2 + (R.magnitude() * theta.diff())**2)) - v).simplify()
```


```python
I = m / 12 * (l**2 + h**2)
I
```


```python
T = I / 2 * theta.diff()**2 + m / 2 * v**2
T
```


```python
U = -m * g * (r + h / 2 - R.dot(N.y))
U.simplify()
```


```python
U.diff(theta).simplify()
```


```python
(m * g * ((r + h / 2) * cos(theta) + r * theta * sin(theta))).diff(theta).simplify()
```


```python
L = T - U
```


```python
eom = L.diff(theta.diff()).diff(dynamicsymbols._t) - L.diff(theta)
eom.simplify().expand()
```


```python
eom.simplify() / m * 12
```


```python
Istar = eom.expand().coeff(theta.diff().diff())
Istar
```


```python
(eom - Istar * theta.diff().diff()).simplify()
```


```python
lin_eom = eom.subs({cos(theta): 1, sin(theta): theta, theta**2: 0, theta.diff()**2: 0}).simplify()
(lin_eom.expand() / m).simplify()
```


```python
m_ = lin_eom.expand().coeff(theta.diff().diff())
k_ = lin_eom.expand().coeff(theta)
m_, k_
```


```python
sqrt(k_ / m_).simplify()
```

Stability


```python
(k_ / m / g).simplify()
```


```python
ct = cos(theta)
st = sin(theta)
I_ = r * r * theta * theta + h * h / 3 + l * l / 12
eom_mont = -(r * r * theta.diff() * theta.diff() * theta + g * (r * theta * ct - h * st / 2)) / I_
```


```python
I_
```


```python
eom_mont.simplify()
```


```python
(-eom_mont * I_ + I_ * theta.diff().diff() - eom / m).simplify()
```


```python
(eom / m * 12).simplify()
```

3722f058673b836f6158a5a52b72a7e48785f436
ipynb
Jupyter Notebook
content/materials/notebooks/book_balancing_equations_of_motion.ipynb
greg1877/eng122
3a9821f41c860e190cd3c8285fac212ae897337b
CC-BY-4.0
2020-05-11T05:56:54.000Z
2020-12-20T13:44:12.000Z
content/materials/notebooks/book_balancing_equations_of_motion.ipynb
greg1877/eng122
3a9821f41c860e190cd3c8285fac212ae897337b
CC-BY-4.0
2016-09-20T01:26:33.000Z
2020-01-22T02:10:33.000Z
content/materials/notebooks/book_balancing_equations_of_motion.ipynb
greg1877/eng122
3a9821f41c860e190cd3c8285fac212ae897337b
CC-BY-4.0
2017-06-09T01:28:45.000Z
2020-02-29T02:36:18.000Z
Qwen/Qwen-72B
1. YES
2. YES