Florian Will, Moritz Beckschulte, Stephan Göbel, Matthias Mersch, Christian Vering, Dirk Müller, Germany
Digital twins enable highly efficient control strategies such as model predictive control (MPC) and are therefore a promising technology to decrease energy consumption and reduce operating costs. A Hardware-in-the-Loop test bench combines a real heat pump with a simulated building to investigate the setup under realistic and dynamic operating conditions. This research compares an MPC using a digital twin within a cloud infrastructure against a conventional heating curve controller on a typical winter day. The MPC dynamically adjusts the compressor speed to maintain comfort while minimizing energy use. Results demonstrate that the MPC reduces electrical consumption by 11 % compared to the standard controller.
Introduction
Maximizing the environmental and economic benefits of heat pump systems while minimizing the impact on the electrical grid requires minimizing energy consumption. One way to minimize energy consumption is to increase the operating efficiency of the heat pump. The instantaneous efficiency of a heat pump largely depends on the given process temperatures and the heating capacity, which can be changed by the controller by adjusting the compressor speed. When heating buildings, the optimal operating point depends on the ambient air temperature, sink temperature, thermal demand, and user occupancy patterns. In practice, conventional control strategies typically use a heating curve with a PI controller that considers the ambient air temperature as the only input variable while neglecting further disturbance variables such as solar irradiation. This control setup leads to robust operation at the expense of suboptimal performance and, therefore, not maximum operating efficiency. A second way to minimize energy consumption is to only provide heat when it is actually needed, which is also possible by implementing further disturbances into the controller and knowledge about the building.
To achieve minimum energy consumption while maintaining robust operation at all times, advanced control methods are suggested in the literature.
Model Predictive Control (MPC) is a promising control strategy enabling maximization of energy efficiency and minimization of energy consumption using mathematical optimization based on process models of the entire system. To achieve optimal control, MPC uses these models to manage multiple disturbances. By incorporating weather forecasts, it predicts future system behaviour and proactively adapts the heat pump’s next control step accordingly. Overall, the use of process models and mathematical optimization leads to optimal operation of the heat pump. Previous studies have demonstrated the effectiveness of MPCs in building energy management [1], [2], [3]), but experimental validation is still needed. Bringing MPC into practice, digital twins are proposed as a promising way of implementation in the literature.
In this work, we conduct experiments on a Hardware-in-the-Loop (HiL) test bench, combining a real heat pump with a simulated building environment. This approach allows us to implement MPC into a digital twin framework to evaluate the system performance under realistic conditions. The heat pump process model is provided with a data-driven approach. The paper is structured in the following way:
- Section 2 introduces the HiL methodology and describes MPC fundamentals.
- Section 3 presents the experimental results.
- Section 4 summarizes the findings and discusses implications and limitations.
By demonstrating the advantages of MPCs in real-world applications, this work contributes to the development of smarter and more efficient heat pump systems for a sustainable energy future.
Methods
The HiL approach for building energy systems involves real-time coupling of actual hardware with dynamic simulation models; please refer to Figure 1 for a schematic view [4]. The entire setup is connected using an internal, fully digitalized Internet of Things approach, enabling bi-directional communication between the experiment and simulation environments. The setup fulfills the requirements of implementing digital twins at a technology readiness level of 7, which enables bringing highly‑efficient control strategies into practice.

In the experimental environment, the climate chamber is designed to emulate realistic environmental conditions, e.g., for an air-source heat pump, by using weather data from a simulation, which are transmitted to the chamber’s control system in real-time. The hydraulic test rig consists of multiple hydraulic circuits that can be used, e.g., to simulate hydronic heating systems as heat sinks. In the simulation environment, a building performance simulation model computes the heating demand in real-time and communicates the supply temperature and flow rates back to the test rig. In this way, the test rig emulates realistic operating conditions for the heat pump’s sink side. The heat pump test bench features a commercially available heat pump modified with additional sensors and actuators, including an electronic expansion valve, a compressor with variable speed control, a four-way valve, and an evaporator fan. In this setup, the electronic expansion valve controls the superheat, while the fan operates at a constant speed. The basic controller implementation is set up with a conventional heating curve and PI controllers.
To allow for more sophisticated control strategies than conventional heating curves, the data-driven (DD) MPC framework is utilized in this work in a digital twin setup. DDMPC is a Python-based tool that enables the implementation of model predictive control [2], allowing for (1) the definition of the system’s state space, (2) formulation of the optimization problem using CasADi [5] syntax, (3) integration of data-driven models, and (4) solution of the optimization problem using the Ipopt solver [6].
By solving the optimization problem, the MPC aims to achieve minimum energy consumption while maintaining the desired room temperature. The objective function is formulated to minimize the deviation of the room temperature from the setpoint and penalize high compressor speeds, as described by Equation 1.

The penalization of compressor speeds incentivizes the MPC to operate at low compressor speeds. Hence, the compressor speed is only set as high as needed, which leads to low energy consumption.
The MPC solves the optimal control problem every 10 minutes, applying the resulting compressor speed to the heat pump. A prediction horizon of 6 hours is used, with an artificial neural network predicting the future state of the system by estimating changes in room temperature based on weather forecast, future demand, and the heat pumps’ operation over the prediction horizon. A more detailed description of the optimal control problem can be found in [3]. The results of the model predictive controller are compared to the reference controller in the next section.
Results
Figure 2 compares two different ways to control residential heat pumps: the MPC and a conventional heating curve controller. Weather data of a typical winter day of a test reference year [4] in Potsdam, 2015, is used. We filtered out startup procedures and included only periods when the compressor operates, to ensure a meaningful comparison.

The supply temperature shows differences between the two control methods. The heating curve controller runs at higher supply temperatures, as seen in the left subplot. The mean supply temperature (indicated through the black x) is 5 K higher with the heating curve compared to the MPC. This happens because the heating curve sets the supply temperature purely based on outdoor air temperature. In contrast, the MPC varies the supply temperature according to the solution of the optimization to maintain comfort while using less energy.
The MPC runs the compressor at lower speeds (about 30-40 Hz) compared to the reference controller (50-70 Hz). The mean compressor speed is 63 Hz for the heating curve and 46 Hz for the MPC. This is directly related to the higher supply temperatures required by the heating curve controller.
We also see that the compressor speed as well as the supply temperature spans over a greater area with the MPC compared to the HC. That highlights the variability of the MPC.
By running the system at lower compressor speeds and lower average supply temperatures, the MPC decreases energy consumption by 11 % compared to the heating curve. The SCOP is increased by 3 % using the MPC.
Conclusions
This study demonstrates the potential of model predictive control (MPC) for building energy systems:
- The study shows a successful experimental comparison between two heat pump controllers paving the way towards rapid control prototyping.
- The digital twin framework with MPC has a high overall potential and outperforms the heating curve due to the integration of disturbance variables and forecasts.
- The limitations of the study include the assumption of perfect forecasts for weather conditions and user behavior, which may not be realistic in practice. This could result in lower savings in reality, as the MPC may not be able to adapt to unexpected changes in the system or user behavior.
Overall, these findings show in an experimental study why advanced controllers like MPC perform better than basic heating curve controllers. While the heating curve only reacts on changes in the outdoor temperature, the MPC can adapt to various conditions, including solar radiation and occupancy patterns. By adjusting the compressor speed based on actual needs, the MPC maintains comfort while using less energy. This leads to an 11 % reduced energy consumption with MPC compared to a heating curve on a typical winter day while increasing the SCOP by 3 %. Overall, we presented how advanced controllers can reduce the energy consumption of heat pumps to minimize their impact on the electrical grid. In the next steps, the methodology should be demonstrated in a field test to further show its technological readiness and reduce hurdles for practical implementation.
Author contact information
| Name | Florian Will |
| Title | M. Sc. |
| Affiliation | RWTH Aachen University, E.ON Energy Research Center, Institute for Energy Efficient Buildings and Indoor Climate |
| E-mail address | Florian.will@eonerc.rwth-aachen.de |
References
[1]. M. Beckschulte, J. Klingebiel, F. Will, C. Vering, und D. Müller, „Multi-objective model predictive control for air-source heat pumps: Leveraging system flexibility to simultaneously reduce noise and increase efficiency“, Applied Thermal Engineering, S. 126926, Juni 2025, doi: 10.1016/j.applthermaleng.2025.126926.
[2]. P. Stoffel, M. Berktold, und D. Müller, „Real-life data-driven model predictive control for building energy systems comparing different machine learning models“, Energy and Buildings, Bd. 305, S. 113895, Feb. 2024, doi: 10.1016/j.enbuild.2024.113895.
[3]. S. Göbel, P. Stoffel, F. Will, C. Vering, und D. Müller, „Maximizing operational efficiency of heat pumps with Model Predictive Control: An experimental case study for residential application“, in 14th IEA Heat Pump Conference 2023 (HPC2023) Conference Proceedings – Full Papers, Chicago, IL, USA, Mai 2023, S. 12.
[4]. C. Vering u. a., „Towards a defossilized building sector with field tests in the lab: Review, development, and evaluation“, Applied Energy, Bd. 365, S. 123225, Juli 2024, doi: 10.1016/j.apenergy.2024.123225.
[5]. J. A. E. Andersson, J. Gillis, G. Horn, J. B. Rawlings, und M. Diehl, „CasADi: a software framework for nonlinear optimization and optimal control“, Math. Prog. Comp., Bd. 11, Nr. 1, S. 1–36, März 2019, doi: 10.1007/s12532-018-0139-4.
[6]. A. Wächter und L. T. Biegler, „On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming“, Math. Program., Bd. 106, Nr. 1, S. 25–57, März 2006, doi: 10.1007/s10107-004-0559-y.
[7]. P. Mehrfeld, „Evaluation of Heat Pump Systems Under Dynamic Operating Conditions“, RWTH Aachen University, Aachen, Germany, 2022. doi: 10.18154/RWTH-2022-06640.