Second law analysis of residential heating systems