A Digital Twin for Energy Efficient and Sustainable Districts

A Digital Twin for Energy Efficient and Sustainable Districts


Germany’s plan is to completely switch from coal and nuclear to renewables. The target is to reduce greenhouse gas emissions by 55% in 2030 compared with 1990. Today, a huge amount of solar and wind renewables is already installed, but Germany wants to expand the use of renewables up to 2030. The regional Ministry of the Environment, Climate Protection and the Energy Sector in Baden-Wuerttemberg, The European Institute for Energy Research (EIFER), and partners worked together on improving the resource efficiency and energy transition for highly efficient and sustainable districts in Germany.


The main problem was how to integrate fluctuable renewables into the system. Electricity must immediately cover the daily demand. It could be stored in batteries, but this way was quite expensive for energy needed for the whole district or city. That’s why in this project EIFER followed the approach of using the existing electricity devices in their flexibility for better adapting the demand to fluctuable renewables. This means, for example, shifting loads of electricity devices that would run when there is some sun and wind.

The cost of flexibility would be much lower than installing the additional batteries. Thus, they needed to activate as much flexibility as possible instead of using the batteries.

Decentralized energy management

Decentralized energy management

Decentralized energy management is quite predictable, but currently, it consists of a lot of technologies, renewables, as well as new consumers (e.g., electric vehicles). It changed how the system was managed including generation resources, distributed storage as well as flexible loads, for example, the devices that could shift the energy use in time (e.g., home appliances).


EIFER worked on a real energy demonstrator of a district containing 10 buildings which included around 25 households in which EIFER was setting up a decentralized energy management system. In parallel, they constructed a digital twin that could be compared with the real demonstrator.

Digital twin conceptual components

Digital twin conceptual components (click to enlarge)

EIFER showed the advantages of this digital twin, a virtual representation of the real system. It accompanied the project through various phases and enriched it throughout its life cycle. The digital twin also served as a data repository for static and dynamic information, such as for different operating scenarios.

Virtual demonstrator

Virtual demonstrator

The energy demonstrator was a highly detailed agent-based simulation model that mapped and connected the individual plant components of generation, storage, and demand for the electricity and heat sectors.

The Allensbach property was chosen to illustrate the virtual demonstration through a multimethod simulation model. This model replaced 140 real devices for testing. 1-second resolution enabled real-time and hardware-in the-loop testing of the energy management system. It represented thermal and electrical flows at different levels (appliance, household, building, and property) and their interactions.

Agent-based model of a household

Agent-based model of a household (click to enlarge)

This example of a household included different parts that were modeled as individual agents. There were electrical flows in yellow and thermal flows in red. There were the controllers that allowed demand flexibilities for shifting the consumption of the heat pump to the proper times with the autonomous algorithm. And this was connected with a grid state indicator that came from the grid connection point. The agents received the information from the grid state indicator.

Platform architecture

Platform architecture (click to enlarge)

AnyLogic was the simulation core. The inputs were stored in Excel files and the AnyLogic database. EIFER used AnyLogic Cloud for visualization. Outputs could also be exported to Excel to enable non-modelers to analyze the data.

EIFER used a multimethod approach including discrete event modeling and system dynamics due to the complexity of the system. In addition, they used data-driven models. AnyLogic allowed connectivity with different devices. Finally, AnyLogic Cloud was used for experiments and evaluation.


This system showed an increase in the self-consumption rate from 55% to 75%. At the same time there was a reduction of the power peak. If we include EVs, there is a huge reduction in this peak because people don’t load them all at the same time and shift loading over time.

Results of 1-year simulations

Results of 1-year simulations

The increase in the self-consumption rate led to the reduction of the operation costs of the system. This was translated into a decrease of the electricity cost up to 5€ct/kWh to German users. As the tariff was 30€ct/kWh before the energy crises, the savings are almost 20%. Due to the energy crises, the electricity tariffs had gone up a lot, but the savings were expected to go up proportionally.

Home appliances

Home appliances

As for appliances, they usually work when they are switched on. If people want their dishes to be washed by morning, the operation window is a whole night. Dishwashers in various houses will not be run at the same time flattening the electricity curve overall.

The simulation investigated how the proportion of locally generated and used energy can be increased by intelligently controlling the generation and consumption of electricity and heat.

In the future, EIFER plans to use AnyLogic Cloud more for such kinds of projects. For further development towards an interconnected digital twin, EIFER wants to add new functions such as a replay of real historical scenarios in the virtual world, predictive control, optimization, and learning algorithms.

The case study was presented by Enrique Kremers, of EIFER, at the AnyLogic Conference 2022.

The slides are available as a PDF.

Études de cas similaires

Plus d’études de cas

Obtenez une brochure avec des études de cas de l’industrie (en anglais)