Design of a control strategy for optimal operation of an autonomous distributed generation system for electricity and heat