H[ϕ_,p_,t_]:=(1/2)m (l^2)((((p/(m (l^2)))+((r ω)/l)Sin[ω t+ϕ]))^2)-(1/2)m (ω^2) (r^2)-m g (r Sin[ω t]+l Cos[ϕ])