Thermodynamics of converting lead sulfide