Quantifying demand flexibility of power-to-heat and thermal energy storage in the control of building heating systems | Synapse