District Heating

District heating systems can contain several types of production units, some producing both electricity and heat. The units can have different fuels, start-up and shutdown times, as well as overall economy.

Modelon has experience in production planning problem with schedule optimization for all power units in the network, so that customer heat demands are fulfilled while maximizing plant profits.

Modelica models are used to describe the network, with all important features of the units and network topology included in the setup. Combined heat and power plants can be modeled  to capture their behavior at various loads.

Physical phenomena such as delays, heat losses and energy storage in accumulators as well as in the network are included in the model.


  • Proven method for reduction of the operation cost of district heating network.
  • Integration of networks and production facilities.
  • Deliver tools and expertise for real-world control development.

Production planning for District Heating Systems

In the current use case, Modelon  performed model optimizations  based on the district heating system of Uppsala, close to Stockholm in Sweden. This case is a result of collaboration with Vattenfall and SICS Swedish ICT and information can be found in the following presentation.


We divided the problem into two separate steps:

  •  A Unit Commitment Problem (UCP), based on discrete time models to generate optimal status (on/off) of the plants using standard linear programming
  • An Economic Dispatch Problem (EDP), expressed with continuous time and physics-based Modelica models, where continuous and physically relevant signals such as temperatures, flows and pressure are optimized.

The UCP problem was encoded and solved using Pyomo and Gurobi while the EDP problem was solved using OPTIMICA Compiler Toolkit.


The results show that the economics of a network can be taken into account when performing production planning, resulting in most cases in high mass flows and low supply temperatures.

It also shows that limitations of real plants, such as pump capacities and pressure constraints, can be incorporated into the formulation as well as variable time delays in pipes and heat accumulation in network and units.

More significantly, the optimizations show that the production peaks of the units can be decreased by utilizing network structure and energy storing units in efficient ways. 

  1. Runvik, H., et al., Production Planning for Distributed District Heating Networks with JModelica.org, Proceedings of the 11th International Modelica Conference, September 21-23, 2015, Versailles, France, pp. 217-224.
  2. Rantzer, J., Robust Production Planning for District Heating Networks, MSc Thesis, Lund University, 2015
  3. Larsson, H., District Heating Network Models for Production Planning, MSc Thesis, Lund University, 2015