Solution
= Solution
<Hamilton's equations> give $\dot q=p$ and $\dot p=-\omega^2q$, hence $\ddot q+\omega^2q=0$. The phase-space energy curve is an ellipse. Its <action variable> is
$$
I=\frac1{2\pi}\oint p\,dq
=\frac1{2\pi}\times\pi\sqrt{2E}\frac{\sqrt{2E}}\omega
=\frac E\omega.
$$
Thus $\boxed{E=\omega I}$.