hamiltonian dynamics