Modelling, control, and optimal power dispatch of integrated heat and electricity systems including low-carbon technologies