### 2.1my typed solution of EME 121 midterm

2.1.1  Problem 1

2.1.4  Problem 2
2.1.5  Convert to ﬁrst form
2.1.6  Problem 3

This is my EME 121 midterm post-mortem write up.

#### 2.1.1Problem 1

Cart moves on top of circle as shown, with pendulum attached. Find equations of motion. This is 2 DOF, using $$\theta$$ and $$\phi$$ for generalized coordinates.

#### 2.1.2Velocity, acceleration and force diagrams

For the mass $$m$$ we use  $$V_{p}=V_{o}+\omega \times r+V_{rel}$$. The important thing to see is that $$\omega$$ of the frame of reference for $$m$$ is relative to the inertial frame always. Hence $$\omega =\dot{\phi }+\dot{\theta }$$. In this problem, we see that $$V_{rel}=0$$ for mass $$m$$ since the length $$L$$ do not change. Therefore, for $$m$$ we have\begin{align*} V_{p} & =V_{o}+\omega \times r+V_{rel}\\ & =R\dot{\theta }+L\left ( \dot{\phi }+\dot{\theta }\right ) \end{align*}

For the acceleration, we have$a_{p}=a_{0}+\dot{\omega }\times r+\omega \times \left ( \omega \times r\right ) +2\omega \times V_{rel}+a_{rel}$ For the mass $$m$$, $$V_{rel}$$ and $$a_{rel}$$ are zero, since the mass $$m$$ is on a ﬁxed rod. So we have\begin{align*} a_{p} & =a_{0}+\left ( \ddot{\phi }+\ddot{\theta }\right ) \times r+\left ( \dot{\phi }+\dot{\theta }\right ) \times \left ( \left ( \dot{\phi }+\dot{\theta }\right ) \times r\right ) \\ & =R\ddot{\theta }+L\left ( \ddot{\phi }+\ddot{\theta }\right ) +\left ( \dot{\phi }+\dot{\theta }\right ) \left ( \dot{\phi }+\dot{\theta }\right ) L\\ & =R\ddot{\theta }+L\left ( \ddot{\phi }+\ddot{\theta }\right ) +L\dot{\phi }^{2}+L\dot{\theta }^{2}+2L\dot{\phi }\dot{\theta }\\ & =R\ddot{\theta }+L\left ( \ddot{\phi }+\ddot{\theta }\right ) +L\left ( \dot{\phi }^{2}+\dot{\theta }^{2}\right ) +2L\dot{\phi }\dot{\theta } \end{align*}

So, in diagram, this is how it looks

The unknowns are $$\theta ,\phi ,T,N$$, hence we need 4 equations.

#### 2.1.3Solution using $$F=ma$$

For pendulum mass $$m$$, resolving forces radially we obtain\begin{align} mg\cos \left ( \theta +\phi \right ) -T & =m\left ( L\left ( \dot{\phi }^{2}+\dot{\theta }^{2}\right ) +2L\dot{\phi }\dot{\theta }+R\dot{\theta }^{2}\cos \phi -R\ddot{\theta }\sin \phi \right ) \nonumber \\ T & =m\left [ g\cos \left ( \theta +\phi \right ) -L\left ( \dot{\phi }^{2}+\dot{\theta }^{2}\right ) -2L\dot{\phi }\dot{\theta }-R\dot{\theta }^{2}\cos \phi +R\ddot{\theta }\sin \phi \right ] \tag{1} \end{align}

and resolving forces tangentially gives\begin{align} mg\sin \left ( \theta +\phi \right ) & =m\left ( L\left ( \ddot{\phi }+\ddot{\theta }\right ) +R\dot{\theta }^{2}\sin \phi +R\ddot{\theta }\cos \phi \right ) \nonumber \\ \ddot{\phi } & =\frac{g}{L}\sin \left ( \theta +\phi \right ) -\frac{R}{L}\left ( \dot{\theta }^{2}\sin \phi +\ddot{\theta }\cos \phi \right ) -L\ddot{\theta }\tag{2} \end{align}

For the cart $$M\,$$, resolving forces radially we obtain$$N-T\cos \phi -Mg\cos \theta =-MR\dot{\theta }^{2}\tag{3}$$ and resolving forces tangentially gives$$Mg\sin \theta -T\sin \phi =MR\ddot{\theta }\tag{4}$$ We now have 4 equations with 4 unknowns. Using Mathematica the solution is

##### Convert to ﬁrst form

Let$\begin{pmatrix} x_{1}\\ x_{2}\\ x_{3}\\ x_{4}\end{pmatrix} =\begin{pmatrix} \theta \\ \phi \\ \dot{\theta }\\ \dot{\phi }\end{pmatrix} \rightarrow \begin{pmatrix} \dot{x}_{1}\\ \dot{x}_{2}\\ \dot{x}_{3}\\ \dot{x}_{4}\end{pmatrix} =\begin{pmatrix} x_{3}\\ x_{4}\\ \ddot{\theta }\\ \ddot{\phi }\end{pmatrix}$ Now since the equations are decoupled, the rest follows.

#### 2.1.4Problem 2

The disk rolls with no slip, spring has no friction on the side with the disk slot. Find equations of motion.

2 DOF, using $$x$$ and $$\theta$$ for generalized coordinates.

##### Solution using $$F=ma$$

There are 5 unknowns $$\theta ,x,T,N,F_{f}$$, hence we need 5 equations.

For mass $$m$$, resolving forces along $$x$$ direction, positive upward$$-kx-mg\cos \theta =m\left ( \ddot{x}-x\dot{\theta }^{2}+R\ddot{\theta }\sin \theta \right ) \tag{1}$$ Resolving tangential to $$x$$ direction gives$$mg\sin \theta -T=m\left ( R\ddot{\theta }\cos \theta +x\ddot{\theta }+2\dot{x}\dot{\theta }\right ) \tag{2}$$ For mass $$M$$, resolving horizontally, positive to the right results in$$-F_{f}+T\cos \theta +kx\sin \theta =M\left ( R\ddot{\theta }\right ) \tag{3}$$ Resolving vertically, positive upwards gives$$-Mg+N-T\sin \theta +kx\cos \theta =0 \tag{4}$$ Applying moments around c.g. for disk results in$$\tau +F_{f}R+Tx=I\ddot{\theta } \tag{5}$$ Now we have 5 equations and 5 unknowns. Solving for $$\ddot{\theta },\ddot{x}$$ gives\begin{align*} \theta ^{\prime \prime }\left ( t\right ) & =\frac{\tau +gmR\cos \theta \sin \theta +\left ( gm+Rk\right ) x\sin \theta -2m\left ( R\cos \theta +x\right ) \dot{x}\dot{\theta }}{I+MR^{2}+mR^{2}\cos ^{2}\theta +mx\left ( 2R\cos \theta +x\right ) }\\ x^{\prime \prime }\left ( t\right ) & =-g\cos \theta +x\left ( \dot{\theta }^{2}-\frac{k}{m}\right ) -\frac{R\sin \theta \left ( \tau +kRx\sin \theta +m\left ( R\cos \theta +x\right ) \left ( g\sin \theta -2\dot{x}\dot{\theta }\right ) \right ) }{I+MR^{2}+mR^{2}\cos ^{2}\theta +mx\left ( 2R\cos \theta +x\right ) } \end{align*}

#### 2.1.5Convert to ﬁrst form

Let$\begin{pmatrix} x_{1}\\ x_{2}\\ x_{3}\\ x_{4}\end{pmatrix} =\begin{pmatrix} \theta \\ x\\ \dot{\theta }\\ \dot{x}\end{pmatrix} \rightarrow \begin{pmatrix} \dot{x}_{1}\\ \dot{x}_{2}\\ \dot{x}_{3}\\ \dot{x}_{4}\end{pmatrix} =\begin{pmatrix} x_{3}\\ x_{4}\\ \ddot{\theta }\\ \ddot{x}\end{pmatrix}$ Hence\begin{align*} \begin{pmatrix} \dot{x}_{1}\\ \dot{x}_{2}\\ \dot{x}_{3}\\ \dot{x}_{4}\end{pmatrix} & =\begin{pmatrix} x_{3}\\ x_{4}\\ \frac{\tau +gmR\cos \theta \sin \theta +\left ( gm+Rk\right ) x\sin \theta -2m\left ( R\cos \theta +x\right ) \dot{x}\dot{\theta }}{I+MR^{2}+mR^{2}\cos ^{2}\theta +mx\left ( 2R\cos \theta +x\right ) }\\ -g\cos \theta +x\left ( \dot{\theta }^{2}-\frac{k}{m}\right ) -\frac{R\sin \theta \left ( \tau +kRx\sin \theta +m\left ( R\cos \theta +x\right ) \left ( g\sin \theta -2\dot{x}\dot{\theta }\right ) \right ) }{I+MR^{2}+mR^{2}\cos ^{2}\theta +mx\left ( 2R\cos \theta +x\right ) }\end{pmatrix} \\ & =\begin{pmatrix} x_{3}\\ x_{4}\\ \frac{\tau +gmR\cos x_{1}\sin x_{1}+\left ( gm+Rk\right ) x_{2}\sin x_{1}-2m\left ( R\cos x_{1}+x_{2}\right ) x_{4}x_{3}}{I+MR^{2}+mR^{2}\cos ^{2}x_{1}+mx\left ( 2R\cos x_{1}+x_{2}\right ) }\\ -g\cos x_{1}+x_{2}\left ( x_{3}^{2}-\frac{k}{m}\right ) -\frac{R\sin x_{1}\left ( \tau +kRx_{2}\sin x_{1}+m\left ( R\cos x_{1}+x_{2}\right ) \left ( g\sin x_{1}-2x_{4}x_{3}\right ) \right ) }{I+MR^{2}+mR^{2}\cos ^{2}x_{1}+mx_{2}\left ( 2R\cos x_{1}+x_{2}\right ) }\end{pmatrix} \end{align*}

#### 2.1.6Problem 3

The kinetic energy is\begin{align*} T & =\frac{1}{2}M\left ( R\dot{\theta }\right ) ^{2}+\frac{1}{2}I\dot{\theta }^{2}+\frac{1}{2}m\left [ \left ( \dot{x}+R\dot{\theta }\sin \theta \right ) ^{2}+\left ( R\dot{\theta }\cos \theta +x\dot{\theta }\right ) ^{2}\right ] \\ & =\frac{1}{2}M\left ( R\dot{\theta }\right ) ^{2}+\frac{1}{2}I\dot{\theta }^{2}+\frac{1}{2}m\left [ \dot{x}^{2}+2R\dot{x}\dot{\theta }\sin \theta +R^{2}\dot{\theta }^{2}+x^{2}\dot{\theta }^{2}+2x\dot{\theta }^{2}R\cos \theta \right ] \\ & =\frac{1}{2}M\left ( R\dot{\theta }\right ) ^{2}+\frac{1}{2}I\dot{\theta }^{2}+\frac{1}{2}m\dot{x}^{2}+mR\dot{x}\dot{\theta }\sin \theta +\frac{1}{2}m\dot{\theta }^{2}\left ( R^{2}+x^{2}+2xR\cos \theta \right ) \end{align*}

and the potential energy is$V=\frac{1}{2}kx^{2}+mgx\cos \theta$ Hence\begin{align*} L & =T-V\\ & =\frac{1}{2}M\left ( R\dot{\theta }\right ) ^{2}+\frac{1}{2}I\dot{\theta }^{2}+\frac{1}{2}m\dot{x}^{2}+mR\dot{x}\dot{\theta }\sin \theta +\frac{1}{2}m\dot{\theta }^{2}\left ( R^{2}+x^{2}+2xR\cos \theta \right ) -\frac{1}{2}kx^{2}-mgx\cos \theta \end{align*}

For $$x$$ we have\begin{align*} \frac{\partial L}{\partial \dot{x}} & =m\dot{x}+mR\dot{\theta }\sin \theta \\ \frac{d}{dt}\frac{\partial L}{\partial \dot{x}} & =m\ddot{x}+mR\ddot{\theta }\sin \theta +mR\dot{\theta }^{2}\cos \theta \\ \frac{\partial L}{\partial x} & =m\dot{\theta }^{2}\left ( x+R\cos \theta \right ) -kx-mg\cos \theta \end{align*}

Hence equation of motion is\begin{align*} \frac{d}{dt}\frac{\partial L}{\partial \dot{x}}-\frac{\partial L}{\partial x} & =Q_{x}\\ m\ddot{x}+mR\ddot{\theta }\sin \theta +mR\dot{\theta }^{2}\cos \theta -m\dot{\theta }^{2}\left ( x+R\cos \theta \right ) +kx+mg\cos \theta & =0 \end{align*}

Since generalized force is zero for $$x$$. Hence from above, we have\begin{align} \ddot{x} & =-R\ddot{\theta }\sin \theta -R\dot{\theta }^{2}\cos \theta +\dot{\theta }^{2}\left ( x+R\cos \theta \right ) -\frac{k}{m}x-g\cos \theta \nonumber \\ & =-R\ddot{\theta }\sin \theta +\dot{\theta }^{2}x-\frac{k}{m}x-g\cos \theta \tag{1} \end{align}

Now for $$\theta$$\begin{align*} \frac{\partial L}{\partial \dot{\theta }} & =MR^{2}\dot{\theta }+I\dot{\theta }+mR\dot{x}\sin \theta +m\dot{\theta }\left ( R^{2}+x^{2}+2xR\cos \theta \right ) \\ \frac{d}{dt}\frac{\partial L}{\partial \dot{\theta }} & =MR^{2}\ddot{\theta }+I\ddot{\theta }+mR\ddot{x}\sin \theta +mR\dot{x}\dot{\theta }\cos \theta +m\ddot{\theta }\left ( R^{2}+x^{2}+2xR\cos \theta \right ) +m\dot{\theta }\left ( 2x\dot{x}+2\dot{x}R\cos \theta -2xR\dot{\theta }\sin \theta \right ) \\ & =MR^{2}\ddot{\theta }+I\ddot{\theta }+mR\ddot{x}\sin \theta +mR\dot{x}\dot{\theta }\cos \theta +m\ddot{\theta }R^{2}+m\ddot{\theta }x^{2}+2m\ddot{\theta }xR\cos \theta +2m\dot{\theta }x\dot{x}+2m\dot{\theta }\dot{x}R\cos \theta -2mxR\dot{\theta }^{2}\sin \theta \\ & =MR^{2}\ddot{\theta }+I\ddot{\theta }+mR\ddot{x}\sin \theta +3mR\dot{x}\dot{\theta }\cos \theta +m\ddot{\theta }R^{2}+m\ddot{\theta }x^{2}+2m\ddot{\theta }xR\cos \theta +2m\dot{\theta }x\dot{x}-2mxR\dot{\theta }^{2}\sin \theta \\ \frac{\partial L}{\partial \theta } & =mR\dot{x}\dot{\theta }\cos \theta -m\dot{\theta }^{2}xR\sin \theta +mgx\sin \theta \end{align*}

Hence equation of motion is$\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta }}-\frac{\partial L}{\partial \theta }=Q_{\theta }$ Hence, since $$Q_{\theta }=\tau$$ then$MR^{2}\ddot{\theta }+I\ddot{\theta }+mR\ddot{x}\sin \theta +m\ddot{\theta }R^{2}+m\ddot{\theta }x^{2}+2xm\ddot{\theta }R\cos \theta +2m\dot{\theta }x\dot{x}+2m\dot{\theta }\dot{x}R\cos \theta -m\dot{\theta }^{2}xR\sin \theta +mgx\sin \theta =\tau$ or\begin{align} \ddot{\theta }\left ( I+2xmR\cos \theta +MR^{2}\right ) & =\tau -mR\ddot{x}\sin \theta +m\ddot{\theta }R^{2}+m\ddot{\theta }x^{2}+2m\dot{\theta }x\dot{x}+2m\dot{\theta }\dot{x}R\cos \theta -m\dot{\theta }^{2}xR\sin \theta +mgx\sin \theta \nonumber \\ \ddot{\theta } & =\frac{\tau -mR\ddot{x}\sin \theta +m\ddot{\theta }R^{2}+m\ddot{\theta }x^{2}+2m\dot{\theta }x\dot{x}+2m\dot{\theta }\dot{x}R\cos \theta -m\dot{\theta }^{2}xR\sin \theta +mgx\sin \theta }{I+2xmR\cos \theta +MR^{2}} \tag{2} \end{align}

To decouple Eqs. (1) and (2), substitute (1) into (2), and then (2) into (1) to obtain\begin{align*} \theta ^{\prime \prime }\left ( t\right ) & =\frac{\tau +gmR\cos \theta \sin \theta +\left ( gm+Rk\right ) x\sin \theta -2m\left ( R\cos \theta +x\right ) \dot{x}\dot{\theta }}{I+MR^{2}+mR^{2}\cos ^{2}\theta +mx\left ( 2R\cos \theta +x\right ) }\\ x^{\prime \prime }\left ( t\right ) & =-g\cos \theta +x\left ( \dot{\theta }^{2}-\frac{k}{m}\right ) -\frac{R\sin \theta \left ( \tau +kRx\sin \theta +m\left ( R\cos \theta +x\right ) \left ( g\sin \theta -2\dot{x}\dot{\theta }\right ) \right ) }{I+MR^{2}+mR^{2}\cos ^{2}\theta +mx\left ( 2R\cos \theta +x\right ) } \end{align*}

These are the same equations found in part (2).