Design of Integrated Electricity and Heating Systems