Thermodynamic Potentials and Equilibrium Criteria