  In this paper, we develop a Hamiltonian variational formulation for the
nonequilibrium thermodynamics of simple adiabatically closed systems that is an
extension of Hamilton's phase space principle in mechanics. We introduce the
Hamilton-d'Alembert principle for thermodynamic systems by considering
nonlinear nonholonomic constraints of thermodynamic type. In particular, for
the case in which the given Lagrangian is degenerate, we construct the
Hamiltonian by incorporating the primary constraints via Dirac's theory of
constraints. We illustrate our Hamiltonian variational formulation with some
examples of systems with friction, with internal matter transfer as well as
with chemical reactions.
