I'm working on some classical mechanics and just got a question stated: Is the Hamiltonian for this system conserved? Is it the total energy? In my problem it was indeed the total energy and it was conserved but it got me thinking, isn't the Hamiltonian always the total energy of a system when you are working with classical dynamics? My lecture notes tell me that "this and that is known as the Hamiltonian and it is usually identified with the total energy of the system". Could anyone give me an example when this is not the case?