# Polar and Cilindrical Frame of Reference
Renato Naville Watanabe

Consider that we have the position vector $\bf\vec{r}$ of a particle, moving in a circular path indicated in the figure below by a dashed line. This vector $\bf\vec{r(t)}$ is described in a fixed reference frame as:

$${\bf\hat{r}}(t) = {x}{\bf\hat{i}}+{y}{\bf\hat{j}} + {z}{\bf\hat{k}}$$




Naturally, we could describe all the kinematic variables in the fixed reference frame. But in circular motions, is convenient to define a basis with a vector in the direction of the position vector  $\bf\vec{r}$. So, the vector  $\bf\hat{e_R}$ is defined as:

$$ {\bf\hat{e_R}} =  \frac{\bf\vec{r}}{\Vert{\bf\vec{r} }\Vert} $$

The second vector of the basis can be obtained by the cross multiplication between $\bf\hat{k}$ and $\bf\hat{e_R}$:

$$ {\bf\hat{e_\theta}} = {\bf\hat{k}} \times {\bf\hat{e_R}}$$

The third vector of the basis is the conventional ${\bf\hat{k}}$ vector.



This basis can be used also for non-circular movements. For a 3D movement, the versor ${\bf\hat{e_R}}$ is obtained by removing the projection of the vector ${\bf\vec{r}}$  onto the versor ${\bf\hat{k}}$:

$$ {\bf\hat{e_R}} =  \frac{\bf\vec{r} - ({\bf\vec{r}.{\bf\hat{k}}){\bf\hat{k}}}}{\Vert\bf\vec{r} - ({\bf\vec{r}.{\bf\hat{k}}){\bf\hat{k}}\Vert}} $$





## Time-derivative of the versors ${\bf\hat{e_R}}$ and ${\bf\hat{e_\theta}}$

To obtain the expressions of the velocity and acceleration vectors, it is necessary to obtain the expressions of the time-derivative of the vectors ${\bf\hat{e_R}}$ and ${\bf\hat{e_\theta}}$.

This can be done by noting that:

$${\bf\hat{e_R}} = \cos(\theta){\bf\hat{i}} + \sin(\theta){\bf\hat{j}}$$
$${\bf\hat{e_\theta}} = -\sin(\theta){\bf\hat{i}} + \cos(\theta){\bf\hat{j}}$$

Deriving ${\bf\hat{e_R}}$ we obtain:

$$ \frac{d{\bf\hat{e_R}}}{dt} = -\sin(\theta)\dot\theta{\bf\hat{i}} + \cos(\theta)\dot\theta{\bf\hat{j}} = \dot{\theta}{\bf\hat{e_\theta}}$$

Similarly, we obtain the time-derivative of ${\bf\hat{e_\theta}}$:

$$ \frac{d{\bf\hat{e_\theta}}}{dt} = -\cos(\theta)\dot\theta{\bf\hat{i}} - \sin(\theta)\dot\theta{\bf\hat{j}} = -\dot{\theta}{\bf\hat{e_R}}$$


## Position, velocity and acceleration

### Position

The position vector $\bf\vec{r}$, from the definition of $\bf\hat{e_R}$, is:

$${\bf\vec{r}} = R{\bf\hat{e_R}} + z{\bf\hat{k}}$$ 

where $R = \Vert\bf\vec{r} - ({\bf\vec{r}.{\bf\hat{k}}){\bf\hat{k}}\Vert}$.

### Velocity

The velocity vector $\bf\vec{v}$ is obtained by deriving the vector $\bf\vec{r}$:

$$ {\bf\vec{v}} = \frac{d(R{\bf\hat{e_R}})}{dt} + \dot{z}{\bf\hat{k}} = \dot{R}{\bf\hat{e_R}}+R\frac{d\bf\hat{e_R}}{dt}=\dot{R}{\bf\hat{e_R}}+R\dot{\theta}{\bf\hat{e_\theta}}+ \dot{z}{\bf\hat{k}}$$

### Acceleration

The acceleration vector $\bf\vec{a}$ is obtained by deriving the velocity vector:

$$ {\bf\vec{a}} = \frac{d(\dot{R}{\bf\hat{e_R}}+R\dot{\theta}{\bf\hat{e_\theta}}+\dot{z}{\bf\hat{k}})}{dt}= \ddot{R}{\bf\hat{e_R}}+\dot{R}\frac{d\bf\hat{e_R}}{dt} + \dot{R}\dot{\theta}{\bf\hat{e_\theta}} + R\ddot{\theta}{\bf\hat{e_\theta}} + R\dot{\theta}\frac{d{\bf\hat{e_\theta}}}{dt} + \ddot{z}{\bf\hat{k}}= \ddot{R}{\bf\hat{e_R}}+\dot{R}\dot{\theta}{\bf\hat{e_\theta}} + \dot{R}\dot{\theta}{\bf\hat{e_\theta}} + R\ddot{\theta}{\bf\hat{e_\theta}} - R\dot{\theta}^2{\bf\hat{e_R}}+ \ddot{z}{\bf\hat{k}}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= \ddot{R}{\bf\hat{e_R}}+2\dot{R}\dot{\theta}{\bf\hat{e_\theta}}+ R\ddot{\theta}{\bf\hat{e_\theta}} - {R}\dot{\theta}^2{\bf\hat{e_R}}+ \ddot{z}{\bf\hat{k}} = (\ddot{R}-R\dot{\theta}^2){\bf\hat{e_R}}+(2\dot{R}\dot{\theta} + R\ddot{\theta}){\bf\hat{e_\theta}}+ \ddot{z}{\bf\hat{k}}$$

+ The term $\ddot{R}$ is  an acceleration in the radial direction.

+ The term $R\ddot{\theta}$ is an angular acceleration.

+ The term $\ddot{z}$ is an acceleration in the $\bf\hat{k}$ direction.

+ The term $-R\dot{\theta}^2$ is the well known centripetal acceleration.

+ The term $2\dot{R}\dot{\theta}$ is known as Coriolis acceleration. This term may be difficult to understand. It appears when there is displacement in the radial and angular directions at the same time.

## Important to note

The reader must bear in mind that the use of a different basis to represent the position, velocity or acceleration vectors is only a different representation of the same vector. For example, for the acceleration vector:

$${\bf\vec{a}} = \ddot{x}{\bf\hat{i}}+ \ddot{y}{\bf\hat{j}} + \ddot{z}{\bf\hat{k}}=(\ddot{R}-R\dot{\theta}^2){\bf\hat{e_R}}+(2\dot{R}\dot{\theta} + R\ddot{\theta}){\bf\hat{e_\theta}}+ \ddot{z}{\bf\hat{k}}=\dot{\Vert\bf\vec{v}\Vert}{\bf\hat{e}_t}+{\Vert\bf\vec{v}\Vert}^2\Vert{\bf\vec{C}} \Vert{\bf\hat{e}_n}$$

In which the last equality is the acceleration vector represented in the path-coordinate of the particle (see http://nbviewer.jupyter.org/github/BMClab/bmc/blob/master/notebooks/Time-varying%20frames.ipynb). 

## Example


Consider a particle following the spiral path described below:

$${\bf\vec{r}}(t) = (2\sqrt(t)\cos(t)){\bf\hat{i}}+ (2\sqrt(t)\sin(t)){\bf\hat{j}}$$


```python
import numpy as np
import sympy as sym
from sympy.plotting import plot_parametric,plot3d_parametric_line
from sympy.vector import CoordSys3D
import matplotlib.pyplot as plt
sym.init_printing()
```

### Solving numerically 


```python
t = np.linspace(0.1,10,30)
R = 2*np.sqrt(t)
theta = t
r = np.transpose(np.array([R*np.cos(t), R*np.sin(t)]))
```


```python
e_r = np.transpose(np.array([r[:,0]/np.sqrt(r[:,0]**2+r[:,1]**2), r[:,1]/np.sqrt(r[:,0]**2+r[:,1]**2)]))
e_theta = np.cross([0,0,1],e_r)[:,0:-1]
```


```python
Rdot = np.diff(R,1,0)/t[1]
thetaDot = np.diff(theta,1,0)/t[1]
v = np.transpose(np.array([Rdot*e_r[0:-1,0],Rdot*e_r[0:-1,1]]) + np.array([R[0:-1]*thetaDot*e_theta[0:-1,0],R[0:-1]*thetaDot*e_theta[0:-1,1]]))
```


```python
Rddot = np.diff(Rdot,1,0)/t[1]
thetaddot = np.diff(thetaDot,1,0)/t[1]
```


```python
a = np.transpose(np.array([(Rddot-R[0:-2]*thetaDot[0:-1]**2)*e_r[0:-2,0], (Rddot-R[0:-2]*thetaDot[0:-1]**2)*e_r[0:-2,1]]) + 
                 np.array([(2*Rdot[0:-1]*thetaDot[0:-1] + R[0:-2]*thetaddot)*e_theta[0:-2,0],(2*Rdot[0:-1]*thetaDot[0:-1] + R[0:-2]*thetaddot)*e_theta[0:-2,1]]))
```


```python
from matplotlib.patches import FancyArrowPatch
%matplotlib inline
plt.rcParams['figure.figsize']=10,10
fig = plt.figure()
plt.plot(r[:,0],r[:,1],'.')
ax = fig.add_axes([0,0,1,1])
for i in np.arange(len(t)-2):
    vec1 = FancyArrowPatch(r[i,:],r[i,:]+e_r[i,:],mutation_scale=20,color='r')
    vec2 = FancyArrowPatch(r[i,:],r[i,:]+e_theta[i,:],mutation_scale=20,color='g')
    ax.add_artist(vec1)
    ax.add_artist(vec2)
plt.xlim((-10,10))
plt.ylim((-10,10))
plt.show()
```


```python
from matplotlib.patches import FancyArrowPatch
%matplotlib inline
plt.rcParams['figure.figsize']=10,10
fig = plt.figure()
plt.plot(r[:,0],r[:,1],'.')
ax = fig.add_axes([0,0,1,1])
for i in np.arange(len(t)-2):
    vec1 = FancyArrowPatch(r[i,:],r[i,:]+v[i,:],mutation_scale=20,color='r')
    vec2 = FancyArrowPatch(r[i,:],r[i,:]+a[i,:],mutation_scale=20,color='g')
    ax.add_artist(vec1)
    ax.add_artist(vec2)
plt.xlim((-10,10))
plt.ylim((-10,10))
plt.show()
```

### Solved simbolically (extra reading)


```python
O = sym.vector.CoordSys3D(' ')
t = sym.symbols('t')
```


```python
r = 2*sym.sqrt(t)*sym.cos(t)*O.i+2*sym.sqrt(t)*sym.sin(t)*O.j
r
```


```python
plot_parametric(r.dot(O.i),r.dot(O.j),(t,0,10))
```


```python
e_r = r - r.dot(O.k)*O.k
e_r = e_r/sym.sqrt(e_r.dot(O.i)**2+e_r.dot(O.j)**2+e_r.dot(O.k)**2)
```


```python
e_r
```


```python
e_theta = O.k.cross(e_r)
e_theta
```


```python
from matplotlib.patches import FancyArrowPatch
plt.rcParams['figure.figsize']=10,10
fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1])    
ax.axis("on")
time = np.linspace(0,10,30)
for instant in time:
    vt = FancyArrowPatch([float(r.dot(O.i).subs(t,instant)),float(r.dot(O.j).subs(t,instant))], 
                         [float(r.dot(O.i).subs(t,instant))+float(e_r.dot(O.i).subs(t,instant)), float(r.dot(O.j).subs(t, instant))+float(e_r.dot(O.j).subs(t,instant))], 
                         mutation_scale=20,
                         arrowstyle="->",color="r",label='${{e_r}}$')
    vn = FancyArrowPatch([float(r.dot(O.i).subs(t, instant)),float(r.dot(O.j).subs(t,instant))], 
                         [float(r.dot(O.i).subs(t, instant))+float(e_theta.dot(O.i).subs(t, instant)), float(r.dot(O.j).subs(t, instant))+float(e_theta.dot(O.j).subs(t, instant))], 
                         mutation_scale=20,
                         arrowstyle="->",color="g",label='${{e_{theta}}}$')
    ax.add_artist(vn)
    ax.add_artist(vt)
plt.xlim((-10,10))
plt.ylim((-10,10))
plt.legend(handles=[vt,vn],fontsize=20)
plt.grid()
plt.show()
```


```python
R = 2*sym.sqrt(t)
```


```python
Rdot = sym.diff(R,t)
Rddot = sym.diff(Rdot,t)
Rddot
```


```python
v = Rdot*e_r + R*e_theta
```


```python
v
```


```python
a = (Rddot - R)*e_r + (2*Rdot*1+0)*e_theta
aCor = 2*Rdot*1*e_theta
aCor
```


```python
a
```


```python
from matplotlib.patches import FancyArrowPatch
plt.rcParams['figure.figsize'] = 10,10
fig = plt.figure()
ax = fig.add_axes([0, 0, 1, 1])    
ax.axis("on")
time = np.linspace(0.1,10,30)
for instant in time:
    vt = FancyArrowPatch([float(r.dot(O.i).subs(t,instant)),float(r.dot(O.j).subs(t,instant))], 
                         [float(r.dot(O.i).subs(t,instant))+float(v.dot(O.i).subs(t,instant)), float(r.dot(O.j).subs(t, instant))+float(v.dot(O.j).subs(t,instant))], 
                         mutation_scale=20,
                         arrowstyle="->",color="r",label='${{v}}$')
    vn = FancyArrowPatch([float(r.dot(O.i).subs(t, instant)),float(r.dot(O.j).subs(t,instant))], 
                         [float(r.dot(O.i).subs(t, instant))+float(a.dot(O.i).subs(t, instant)), float(r.dot(O.j).subs(t, instant))+float(a.dot(O.j).subs(t, instant))], 
                         mutation_scale=20,
                         arrowstyle="->",color="g",label='${{a}}$')
    vc = FancyArrowPatch([float(r.dot(O.i).subs(t, instant)),float(r.dot(O.j).subs(t,instant))], 
                         [float(r.dot(O.i).subs(t, instant))+float(aCor.dot(O.i).subs(t, instant)), float(r.dot(O.j).subs(t, instant))+float(aCor.dot(O.j).subs(t, instant))], 
                         mutation_scale=20,
                         arrowstyle="->",color="b",label='${{a_{Cor}}}$')
    ax.add_artist(vn)
    ax.add_artist(vt)
    ax.add_artist(vc)
plt.xlim((-10,10))
plt.ylim((-10,10))
plt.legend(handles=[vt,vn,vc],fontsize=20)
plt.grid()
plt.show()
```

## Problems

1. Problems from 14.1.1 to 14.1.14from Ruina and Rudra's book,
2. Problems from 17.1.1 to 17.1.10 from Ruina and Rudra's book.

## Reference

+ Ruina A, Rudra P (2015) Introduction to Statics and Dynamics. Oxford University Press. http://ruina.tam.cornell.edu/Book/RuinaPratap-Jan-20-2015.pdf

5e18fce999c3dcc9479e1cdde3dfdd0e77f2447b
ipynb
Jupyter Notebook
notebooks/PolarCoordinates.ipynb
marses/BMC
0aa3ac7307246b61c979a679e4ebe3b1e7c339bd
CC-BY-4.0
2020-03-18T01:39:12.000Z
2020-04-12T19:16:48.000Z
notebooks/PolarCoordinates.ipynb
marses/BMC
0aa3ac7307246b61c979a679e4ebe3b1e7c339bd
CC-BY-4.0
notebooks/PolarCoordinates.ipynb
marses/BMC
0aa3ac7307246b61c979a679e4ebe3b1e7c339bd
CC-BY-4.0
Qwen/Qwen-72B
1. YES
2. YES