This doubt(about if the Hamiltonian is always equal to the energy E of the system) arose from one of my lectures on fluids last week, to be more accurate, last monday. My professor gave us a lecture about the ergodic hipothesis this states that,over long periods of time, the time spent by a particle in some region of the phase space of microstates with the same energy is proportional to the volume of this region, i.e., that all accessible microstates are equiprobable over a long period of time(as Wikipedia says). One of the requirements of the system is that its Hamiltonian always has to be equal to the energy.
The question now is, What happens if a system fulfills al the requirements except the one that the Hamiltonian must be equal to the energy E of the system? How do we aproach to that system?
That's the reason of my question, but I have seen that is nothing trivial at all. Of course all of this classically.