Duality and equilibrium