  District heating is an important component in the EU strategy to reach the
set emission goals, since it allows an efficient supply of heat while using the
advantages of sector coupling between different energy carriers such as power,
heat, gas and biomass. Most district heating systems use several different
types of units to produce heat for hundreds or thousands of households. The
technologies reach from natural gas-fired and electric boilers to biomass-fired
units as well as waste heat from industrial processes and solar thermal units.
Furthermore, combined heat and power units (CHP) units are often included to
use the synergy effects of excess heat from electricity production.
  We propose a generic mathematical formulation for the operational production
optimization in district heating systems. The generality of the model allows it
to be used for most district heating systems although they might use different
combinations of technologies in different system layouts. The mathematical
formulation is based on stochastic programming to account for the uncertainty
of production from non-dispatchable units such as waste heat and solar heat.
Furthermore, the model is easily adaptable to different application cases in
district heating such as operational planning, bidding to electricity markets
and long-term evaluation. We present results from three real cases in Denmark
with different requirements.
