# Bead on a rotating circle



We consider a movement of a material point (bead) with the mass $m$ in a gravitational field, along a vertical circle with a radius $l$ rotating with the frequency $\omega$ around a vertical axis, passing through the center of the circle.

Turning circle creates a virtual sphere with a $R$ radius and a bead moves in this sphere. Therefore, it is most convenient to choose a reference system in $(r, \theta, \phi)$ spherical variables:

\begin{eqnarray}
x&=&r \sin \theta \cos \phi \\
y&=&r \sin \theta \sin \phi \\
z&=&r \cos \theta
\end{eqnarray}

It is a system with constraints and therefore it is convenient to analyze this issue in the framework of Lagrange mechanics.

The Lagrange function is the difference in the kinetic energy of the bead and its potential energy (particles in the gravitational field):

$$L=L(r, \theta, \phi, \dot{r}, \dot{\theta}, \dot{\phi}) = E_k -E_p$$

The kinetic energy of the bead is given by the formula:

\begin{equation}
\label{eq:Ek_spherical}
E_k =\frac{m v^2}{2} = \frac{m}{2} [\dot{x}^2 + \dot{y}^2 + \dot{z}^2] =  \frac{m}{2}[\dot{r}^2 + r^2 \dot{\theta}^2 + r^2 \sin^2 (\theta) \dot{\phi}^2]
\end{equation}

The potential energy of the bead has the form
$$E_p = mgz = mgr \cos(\theta)$$

## Lagrange aproach in spherical coordinates

We can  write Lagrangian of the system in   spherical coordinates. Contraints in spherical coordinates have simple form:

 - $r = l$ - radius is constant.
 - $\phi(t)=\omega_0 t$ - the azimuthal angle is forced by the  constraint.
 
Effectively, the only degree of freedom is a polar angle $\theta$. 
 
We will used CAS to derive both the form of the Lagrangian as well as equation of motion.


```python
load('cas_utils.sage')
```


```python
var('t')
var('l g w0')
xy_names = [('x','x'),('y','y'),('z','z')]
uv_names = [('r','r'),('phi',r'\phi'),('theta',r'\theta')]

load('cas_utils.sage')

to_fun, to_var = make_symbols(xy_names,uv_names)
x2u = {x:r*sin(theta)*cos(phi),
       y: r*sin(theta)*sin(phi),
       z: r*cos(theta)}
_  = transform_virtual_displacements(xy_names,uv_names,suffix='_uv')
```


```python
Ek = 1/2*sum([x_.subs(x2u).subs(to_fun).diff(t).subs(to_var)^2 \
              for x_ in [x,y,z]])
```

The symbolic variable is kinetic energy in spherical coordinates \ref{eq:Ek_spherical},


```python
showmath(Ek.trig_simplify())
```

At this point we can substitute conditions resulting from constraints. Note that since we have already time derivatives $\dot r$ and $\dot phi$, we have to also substitute them explicitely.


```python
Ek = Ek.subs({phi:w0*t,phid:w0,rd:0,r:l}).trig_simplify()
showmath(Ek)
```

The potential energy can be computer in a similar way:


```python
Ep = g*z.subs(x2u).subs({r:l})
showmath(Ep)
```

Langrange function is a difference between $E_k$ and $E_{pot}$:


```python
L = Ek-Ep
showmath(L.trig_simplify())
```

We have single Euler-Lagrange equation in generalized coodinate: polar angle $\theta$.


```python
EL = L.diff(thetad).subs(to_fun).diff(t).subs(to_var) - L.diff(theta)
```


```python
showmath(EL.trig_simplify())
```

## Analysis of the system

### Effective potential 

Fist, we can notice that the form of Lagrangian contains kinetic part, with term contatining $\dot \theta$ and two terms dependent only on $\theta$. We can interpret the latter as an effective potential of 1d motion in $\theta$ coordinate.  The term comes from kinetic energy.

We can extract it symbolically in SageMath by setting $\dot \theta=0$ in Lagrangian:


```python
Ueff = -L.subs(thetad==0)
showmath(Ueff)
```


```python
plot?
```


```python
w0s = [0,3,4,5]
p_u1 = plot([Ueff.subs({w0:w0_,l:1,g:9.81}) for w0_ in w0s],\
            (theta,-3*pi/2-0.01,pi/2),
           legend_label=[r'$\omega_0=%0.1f$'%w_ for w_ in w0s], 
         tick_formatter=pi, gridlines=[[-pi],None])
p_u1.show(figsize=(6,3))
```

\newpage

15a33a6cc0fa1ce88d3adab13b0ed8f6e5b53e7a
ipynb
Jupyter Notebook
061-Lagrange_bead_rotating_circle.ipynb
marcinofulus/Mechanics_with_SageMath
6d13cb2e83cd4be063c9cfef6ce536564a25cf57
MIT
061-Lagrange_bead_rotating_circle.ipynb
marcinofulus/Mechanics_with_SageMath
6d13cb2e83cd4be063c9cfef6ce536564a25cf57
MIT
2022-01-30T16:45:58.000Z
2022-01-30T16:45:58.000Z
061-Lagrange_bead_rotating_circle.ipynb
marcinofulus/Mechanics_with_SageMath
6d13cb2e83cd4be063c9cfef6ce536564a25cf57
MIT
2020-11-15T08:26:14.000Z
2022-02-12T13:07:16.000Z
Qwen/Qwen-72B
1. YES
2. YES