On a relation between economic and thermodynamic optima