  This paper proposes to build a bridge between microscopic descriptions of
matter with internal energy, composed of many fast interacting particles inside
an environment, and their port-Hamiltonian (PH) descriptions at macroscopic
scale. The environment, assumed to be slow, is modeled through experimental
constraints on macroscopic quantities (e.g. energy, particle number, etc), with
a partitioning into two classes: non fluctuating and fluctuating values. The
method to derive the PH macroscopic laws is detailed in several steps and
illustrated on two standard cases (ideal gas, Ising ferromagnets). It revisits
equilibrium statistical physics with a focus on this partitioning. First, the
Boltzmann's principle is used to provide the statistic law of the matter. It
defines a macroscopic equilibrium characterized by a scalar value, the entropy,
together with thermodynamic quantities emerging from each constraint. Then, the
port-Hamiltonian system is derived. The Hamiltonian (macroscopic energy) is
derived as a function of the macroscopic state (entropy and the macroscopic
quantities associated with the fluctuating class). The ports (flows/efforts)
are related to the time-derivative of the state and the Hamiltonian gradient in
a conservative way. This open system defines the reversible laws that govern
standard thermodynamic quantities. Lastly, this paper presents a strategy to
extend this PH system to an irreversible conservative one, given a macroscopic
dissipative law.
