No TL;DR found
The algebraic theory of thermodynamics developed in a previous paper is extended to include the algebraic structure that arises from the introduction of a physical body into the theory. The extension is based on very general definitions of both the thermodynamic states of a body and subsystems of that body. The algebraic analysis, which includes bodies in nonuniform states, shows that the set of all thermodynamic states of a body has the same algebraic structure as the set of thermodynamic states and that composite systems are induced by the algebraic structure of thermodynamic states. The analysis also justifies a variational treatment of thermodynamic bodies in uniform as well as nonuniform states. The variational calculation includes all conventional methods of calculation as special cases and helps to illuminate the origin and interpretation of the electrochemical potential.