0
$\begingroup$

I'm having a little bit of trouble converting the following system of differential equations into a first-order system $\dot z = f(z,u)$ for some vector $z$:

$$(M + m)\ddot x - ml\dot \theta^2\sin\theta + ml\ddot\theta\cos\theta = u$$ $$m\ddot x\cos\theta + ml\ddot\theta = mg\sin\theta$$

Here's what I've done so far: I thought I would try letting $$w_1 = x \implies w_1' = \dot x = w_2$$ $$w_2 = \dot x \implies w_2' = \ddot x = {ml\dot\theta^2\sin\theta - ml\ddot\theta\cos\theta + u \over M + m}$$ and $$z_1 = \theta \implies z_1' = \dot \theta = z_2 $$ $$z_2 = \dot\theta \implies z_2' = \ddot\theta = {mg\sin\theta - m \ddot x \cos\theta \over ml}$$

Which substitution will give us $$z_2' = {mg\sin(z_1) - mw_2'\cos(z_1) \over ml}$$ $$w_2' = {mlz_2^2\sin(z_1) - mlz_2'\cos(z_1) +u \over M + m}$$

But I'm not sure this was even the correct thing to do. I now have a differential equation with my variables of interest in sines and cosines, which I don't think is correct.

Can someone provide me a little bit of help on the correct way to approach this problem?

$\endgroup$
2
  • $\begingroup$ You need to solve the linear system for $(\ddot x,\ddot θ)$. $\endgroup$ Sep 22, 2016 at 12:44
  • $\begingroup$ Are these Euler-Lagrange equations of a physical system with given Lagrangian function (basically the difference between kinetic and potential energy)? If so, there is a very standard way of doing this and getting additional helpful information. $\endgroup$ Sep 23, 2016 at 3:40

2 Answers 2

1
$\begingroup$

There is a standard way to transform a $n$th order differential equation in a system of $n$ first order equation. In your case, since you have two second order equation the system contains four equations.

$$ \begin{cases} \dot x=y\\ \dot \theta=\phi\\ (M+m)\dot y -ml \dot \theta^2 \sin \theta+ml\dot \phi \cos \theta=u\\ m\dot y \cos \theta + ml\dot \phi=mg\sin \theta \end{cases} $$

$\endgroup$
1
$\begingroup$

OK, so according to my calculations, your system is the Euler-Lagrange system of equations given by the Lagrangian function $$\mathcal{L}(x, \theta, \dot{x}, \dot{\theta}) = \frac{M+m}{2} \, \dot{x}^2 + ml\,\cos{\theta}\,\, \dot{x}\,\dot{\theta} + \frac{ml^2}{2} \, \dot{\theta}^2 + u\, x - mgl \, \cos{\theta}$$ Compute $$\frac{\partial \mathcal{L}}{\partial \dot{x}} = (M+m) \, \dot{x} + ml \,\dot{\theta} \cos{\theta} $$ $$\frac{\partial \mathcal{L}}{\partial \dot{\theta}} = ml \, \dot{x} \cos{\theta + ml^2\, \dot{\theta}}$$ $$\frac{\partial \mathcal{L}}{\partial {x}} = u$$ $$\frac{\partial \mathcal{L}}{\partial {\theta}} = - \, ml \, \dot{x}\, \dot{\theta} \sin{\theta} + mgl \, \sin{\theta}$$ The Euler-Legrange equations are \begin{align} \frac{d}{dt}\left(\frac{\partial \mathcal{L}}{\partial \dot{x}}\right) &= \frac{\partial \mathcal{L}}{\partial {x}} \\ \frac{d}{dt}\left(\frac{\partial \mathcal{L}}{\partial \dot{\theta}} \right) &= \frac{\partial \mathcal{L}}{\partial {\theta}} \end{align} or written explicitly

\begin{align} &\frac{d}{dt}\left((M+m) \, \dot{x} + ml \,\dot{\theta} \cos{\theta}\right) = u \\ &\frac{d}{dt}\left(ml \, \dot{x} \cos{\theta + ml^2\, \dot{\theta}}\right) = - \, ml \, \dot{x}\, \dot{\theta} \sin{\theta} + mgl \, \sin{\theta} \end{align} which after differentiation in the left hand side become \begin{align} &(M+m) \, \ddot{x} - ml \,\dot{\theta}^2 \sin{\theta} + ml \,\ddot{\theta} \cos{\theta} = u \\ &ml \, \ddot{x} \cos{\theta} - ml \,\dot{x} \, \dot{\theta} \sin{\theta} + ml^2\, \ddot{\theta}= - \, m l \, \dot{x}\, \dot{\theta} \sin{\theta} + mgl \, \sin{\theta} \end{align} They reduce to \begin{align} &(M+m) \, \ddot{x} - ml \,\dot{\theta}^2 \sin{\theta} + ml \,\ddot{\theta} \cos{\theta} = u \\ &m \, \ddot{x} \cos{\theta} + ml\, \ddot{\theta} = mg \, \sin{\theta} \end{align} With this structure in mind we switch to Hamiltonian formulation. Define the conjugate momenta \begin{align} p_x = \frac{\partial \mathcal{L}}{\partial \dot{x}} &= (M+m) \, \dot{x} + ml \,\dot{\theta} \cos{\theta}\\ p_{\theta} = \frac{\partial \mathcal{L}}{\partial \dot{\theta}} &= ml \, \dot{x} \cos{\theta + ml^2\, \dot{\theta}} \end{align} Solve this linear system with respect to $\dot{x}, \dot{\theta}$ obtaining

\begin{align} \dot{x} &= \frac{ml^2 \, p_{x} - ml \, p_{\theta} \cos{\theta}}{(M+m)ml^2 - m^2l^2 \, \cos^2{\theta}} = \frac{ml^2 \, p_{x} - ml \, p_{\theta} \cos{\theta}}{Mml^2 + m^2l^2 \, \sin^2{\theta}} \\ \dot{\theta} &= \frac{- ml \, p_{x} \cos{\theta} + (M+m) \, p_{\theta}}{(M+m)ml^2 - m^2l^2 \, \cos^2{\theta}} = \frac{- ml \, p_{x} \cos{\theta} + (M+m) \, p_{\theta}}{Mml^2 + m^2l^2 \, \sin^2{\theta}} \end{align} Now observing that \begin{align} \frac{d}{dt}p_x &= \frac{\partial \mathcal{L}}{\partial {x}} \\ \frac{d}{dt} p_{\theta} &= \frac{\partial \mathcal{L}}{\partial {\theta}} \end{align} combining all pairs of equations together

\begin{align} \dot{x} &= \frac{l \, p_{x} - \, p_{\theta} \cos{\theta}}{Ml + ml \, \sin^2{\theta}} \\ \dot{\theta} &= \frac{- ml \, p_{x} \cos{\theta} + (M+m) \, p_{\theta}}{Mml^2 + m^2l^2 \, \sin^2{\theta}}\\ \dot{p}_x &= u \\ \dot{p}_{\theta} &= - \, \, \frac{\big(l \, p_{x} - \, p_{\theta} \cos{\theta}\big) \, \big(- ml \, p_{x} \cos{\theta} + (M+m) \, p_{\theta}\big) \, \sin{\theta}}{\big(Ml + ml \, \sin^2{\theta}\big)^2} \, + \, mgl \, \sin{\theta} \end{align} These are the Hamiltonian equations. You have conservation of total energy, which is the Hamiltonian function of the system.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .