A long history of analogy making between neoclassical economics and physical thermodynamics has unfortunately served to obscure two important relations between the two fields: their definitions of equilibria stem from essentially the same three axioms for the mathematical representations of systems, while the classes of transformation each has chosen to emphasize, and their responses to the problem of path dependence, have led them to very different interpretations of duality in those representations. Despite these conventional differences, we show that economies in which all agents have preferences quasi-linear in some good have a trading-constraint structure isomorphic to the structure of physical systems with classical thermodynamic equations of state. Exact equivalents of thermodynamic potentials, including entropy, can be constructed, and function as the economic counterparts to free energies. Quasi-linear economies are the most general in which the Walrasian idea of price formation as an analog of force balance can be realized. More general economic models raise the same methodological problems as more complex physical models that exhibit path-dependence. We show how the degree of aggregatability of an economic model corresponds to which properties of equilibria retain path-independence, and to the extent to which a social-welfare function exists. A new contour money-metric utility defines the maximal generalization of social-welfare functions in arbitrary economies, but depends on the endowments and composition of the economy in non-quasi-linear cases, and is limited to one-dimensional contours of equilibria in non-aggregatable cases. The differences between economic and thermodynamic methodology lies in the economic focus on the irreversible movement from initial disequilibrium endowments to equilibrium through voluntary trade, in contrast to the thermodynamic recognition that only reversible transformations lead to measurement of system structure. The consequences of respecting reversibility for economic method are sketched, and alternative interpretations of the Walrasian notion of wealth preservation are presented.