# Can a system have the total energy conserved but the hamiltonian not conserved?

## Homework Statement

Can a system have the total energy conserved but the hamiltonian not conserved?

## Homework Equations

If the partial of the lagrangian w.r.t time is zero, energy is conserved.
The hamiltonian is found by the usual method- get the generalized momentum from the lagrangian then plug each into the equation:let me skip typing it in latex. :yuck: Compare this to the total energy.

## The Attempt at a Solution

I can work the equations and find L and H. It seems, conceptually, that anytime H does not equal the total energy, then energy is not conserved. I wonder if this always is so. Also, I know that H is not equal to E when the generalized coordinates depend on time. I also have worked problems where H does not equal E but H is conserved.

## The Attempt at a Solution

After you find some syster in which the energy is conserved, just define coords so that $$\frac{\partial H}{\partial t} \neq 0$$