A Thermodynamic Formulation of Economics