Simple pendulum as Hamiltonian system I am unable to understand how to put the equation of the simple pendulum in the generalized coordinates and generalized momenta in order to check if it is or not a Hamiltonian System.
Having
$$E_T = E_k + E_u = \frac{1}{2}ml^2\dot\theta^2 + mgl(1-cos\theta)$$
How can I found what are the $p$ and $q$ for $H(q,p)$ in order to check that the following holds, i.e. the system is a Hamiltonian system.
$$\frac{dq}{dt}=\frac{\partial H}{\partial p}~~~~~~~~~~~~~~\frac{dp}{dt}=\frac{-\partial H}{\partial q}$$

The Lagrangian is
$${\cal L}=\frac{1}{2}ml^2\dot{\theta}^2-mgl(1-\cos\theta).$$
The conjugate momentum is
$$p_\theta=\frac{\partial{\cal L}}{\partial\dot{\theta}}=ml^2\dot{\theta}$$
and so the Hamiltonian is
$${\cal H}=\sum_q \dot{q}p_q-{\cal L}=\frac{1}{2}ml^2\dot{\theta}^2+mgl(1-\cos\theta)=\frac{p_\theta^2}{2ml^2}+mgl(1-\cos\theta).$$
