1. Introduction
Energy efficiency is crucial for lowering energy consumption and reducing greenhouse gas emissions [
1]. Switching to heat pumps that utilize renewable sources such as geothermal and ambient heat for heating and cooling can lessen reliance on fossil fuels and help save on potential carbon prices [
2]. Furthermore, heat pumps have the added possibility of providing cooling to a building, making them a versatile and more sustainable solution [
3].
Heat pumps are sophisticated machines that require specialized knowledge to design and operate effectively. Their performance is sensitive to the temperature level of the heating and cooling system, and particularly the return temperature entering the condenser [
4]. Competent designers are essential to achieve success with heat pump systems [
5]. Among the challenges a heat pump system designer faces are refrigerant selection [
6], capacity control, and effective management of interaction with energy reservoirs and peak load units [
7]. Additionally, it is critical to select machines with properties tailored to the process energy and temperature demands [
8]. There are various examples of unsuccessful heat pump projects, almost always leading to high energy consumption, either due to a heat pump with a low coefficient of performance (COP) [
9] or high use of peak load or backup heating [
10]. Understanding how a specific heat pump responds to different system temperatures is crucial to maximizing its potential within a system [
11].
Accurate modeling and simulation of components of an energy plant are essential for various purposes such as training, strategic planning, maintenance, techno-economic decisions, and monitoring of the plant operation [
12]. Furthermore, as the demand for environmentally friendly and decentralized energy production grows, improved and user-friendly simulation and monitoring tools become vital. Model-based predictive control (MPC) has been proven a promising technology for building control [
13]. An MPC optimizes system control actions using a simulation model. One of the most important but also most time-consuming parts of MPC design is determining a suitable model that captures the dynamics of the controlled system [
14].
In the academic literature, researchers commonly distinguish between physics-based (white-box) and data-driven (black-box) models, with grey-box models serving as an intermediate approach [
15]. Physics-based models are built based on the underlying physics of the processes and incorporation of physical relationships that describe these processes. Zanetti et al. presented an experimental investigation and a numerical analysis of a heat pump with ambient air and the ground as heat sources [
16]. Each of the components within the heat pump were modelled as independent blocks and then combined to simulate the operation of the heat pump. The models were based on a physics-based approach that allowed a direct calculation of heat transfer coefficients and pressure drop in the heat exchangers. The model provided predictions of the heat pump performance with deviations below 7% for the tests in winter mode and below 10% during summer mode. Xu et al. developed thermodynamic models for an air source CO
2 heat pump system for space heating and domestic hot water production [
17]. The models predicted COP and heat production for two experimental datasets with mean absolute percentage errors (MAPE) of 5.5–6.1% and 2.9–3.1%, respectively.
However, physics-based models can become rather complex, leading to higher modeling costs, potential errors, and increased simulation times [
18]. The availability of data capacity to solve the equations may be a challenge, especially in commercial installations. In addition, if a physics-based model is utilized to monitor a specific process, the uncertainty of the physical relationships tends to increase over time as the equations representing the processes may become unsuitable due to the degradation of the energy plant [
19].
The grey-box modeling approach combines elements of both white-box and black-box models. The approach often requires both long calculation times due to the parameter optimization process and expert knowledge during the model development process [
15]. A grey-box model may represent a good trade-off between physics, expert knowledge, and data-driven modeling. Madani et al. developed a ground source heat pump system model [
20]. The heat pump model used semi-empirical compressor, evaporator, and condenser sub-models along with a simplified expansion valve model to create a black box model. Validation against experimental data showed deviations of less than 15% for COP and heating capacity, and less than 10% for compressor power. Another grey-box model was presented by Cheung et al. [
4]. The model was developed using experimental data obtained from an 8 kW R410A dual-unit ductless heat pump system. The final estimates for compressor frequency, refrigerant flow, and outdoor unit power were predicted within an 8% margin of error.
All the referenced white- and grey-box models depend on system knowledge and component-level sub-modeling. In industrial and real-life systems, component-level data and datasheets may be difficult and even impossible to obtain. The data-driven approach does not take the physics of the process into account, but rather regards it as a black box [
21]. The approach generates a high-dimensional mapping model by learning the mapping relationship between the input and the output variables, allowing for future predictions to be obtained based on the next input. Data-driven methods have a natural advantage in solving highly nonlinear problems that are influenced by many uncontrollable factors [
22], such as building energy systems [
23].
In existing energy plants, a large number of operational data is constantly collected by the plant’s monitoring system. Typically, the data is solely stored in a database. From these data, artificial neural network (ANN) models can be developed for simulating plant operations [
19]. ANNs can be trained periodically with the latest data, thereby capturing plant degradation. Additionally, ANN models account for user-specific influences such as operational hours, person load, etc., which are challenging to describe accurately in a physics-based model [
18]. By comparing predictions from a previous ANN model with those of a subsequent model, the degradation of the plant could be evaluated. ANNs are easy to use, fast in response, and suitable for “off-line” and “on-line” applications [
19]. The authors responsible for the CO
2 heat pump model referenced earlier used datasets generated from the physics-based model to train ANNs to increase the speed and precision when utilizing the model within an optimization framework [
17].
Opalic et al. developed ANN models for an industrial cooling system [
24]. Their dataset was based on compressor polynomials for the various compressors in the system, and they used operating temperature, pressure, and compressors frequency to predict compressor power and refrigerant mass flow rate. The model made predictions with MAPE in the range of 5–12% in an operational case-study cooling system. Puttige et al. created models for ground source heat pump systems using a hybrid analytical-ANN approach [
25]. Both the hybrid analytical-ANN borehole heat exchanger model and the ANN heat pump model made predictions with mean absolute errors (MAE) of less than 5%. These studies highlight the potential of ANNs as a fast and accurate method to predict the performance of different cooling and heating systems under various operating conditions.
The drawbacks of using ANN are closely related to their advantages, namely the fact that they are highly dependent on the data they are trained on [
26]. If a model is used with inputs outside the bounds of the training data, the results may be erroneous. Thus, it is crucial to keep a close track of which input parameters the models have been defined for. Another challenge with ANN only based on operational data is that the model has no capability of determining whether the system operates at maximum efficiency. In other words, an ANN may be been trained with data from an inefficient system without capturing its true potential [
27]. An advanced physics-based model would allow determining the heat pump’s COP at a wider range of operational conditions, which could then be compared to ideal thermodynamic relationships, such as the Carnot [
28] or the Lorenz efficiency [
4].
J. Clauß and L. Georges presented an overview of simulation-based studies based on heat pump modeling [
29]. They observed that the following simplifications were often employed in heat pump modeling:
- (1)
the heat pump is assumed to have perfect modulation between 0% and 100% or is simply on/off;
- (2)
minimum duration and pause times in the heat pump cycle are not taken into account;
- (3)
there are no temperature limits considered for the condenser and evaporator temperatures, although heat pumps have a maximum supply temperature, as well as a minimum temperature at the evaporator side; and
- (4)
the heat pump model only takes into account steady-state operation at full load measured under standard rating conditions according to EN 14511—Air conditioners, liquid chilling packages and heat pumps for space heating and cooling and process chillers, with electrically driven compressors [
30]. Factors such as cycling losses or the change in the COP at part load are not considered.
In this study, we present two distinct ANN models for heat pumps, both only utilizing operational data. The selected heat pump of the study is an advanced machine, without availability of data from internal sensors and limited information on its individual components. The main novelty of this work is presenting models derived from a sophisticated, real-life heat pump system, offering researchers valuable insights into the challenges and complexities associated with data from such systems. We aim to investigate the ways in which Artificial Intelligence (AI) methodologies can be employed to gain insights into the functionality of an operational heat pump system, with emphasis on developing tools for industrial implementation.
Teng et al. advocate for a practical approach to developing AI-based energy-saving systems, emphasizing that researchers should prioritize realistic industrial implementations over abstract theoretical problems [
31]. In addition, the authors suggested that researchers should engage in “low-level” research tasks, such as data cleaning and preprocessing, to ensure that the data used to train AI models is of the highest quality and accuracy [
31].
This article highlights the importance of this so-called “low-level” research perspective and discusses challenges associated with processing and developing large and complex datasets. Though the academic literature on AI in energy systems is vast, the practical implementations are still limited [
32]. In a real-life system, the precision of any data-driven model depends on the available measuring equipment and the quality of the measured data. Sensors may have been specified without consideration for using the measurements within a data-driven framework. This is the case for the heat pump system analyzed in this work. Additionally, the internal sensors of the heat pump are not available to the user, and thus only external sensors are available for modeling purposes.
In this article, we address the intricacies of data capture and processing, data resolution, and potential errors and pitfalls that engineers looking to explore ANN for energy plants and heat pump systems may encounter. The drawbacks of the technique become apparent as the modelling results are presented. In the discussion section, the applicability of the models and suggestions for improving them are presented.
With this article, we aim to share the knowledge acquired through working with real-life systems, their datasets, and the challenges they pose, contributing to the research community and enhancing the understanding of heat pump systems and their practical applications.
2. Materials and Methods
2.1. The Heat Pump Study Case
The selected case study is the Triangulum Central Energy Plant (TriCEP) in Stavanger, Norway. The design principles, targets and energy results, including examples of suboptimal heat pump operations, are thoroughly described in a previous work [
33]. Developed as part of the European Smart Cities and Communities Lighthouse Project Triangulum, the plant has been in operation since 2017. It consists of sewage heat pumps, solar collectors, a biogas boiler, and greywater recycling. The heat pumps produce 90% of the thermal energy from the plant, approximately 1.8 GWh/year, with input energy of about 0.5 GWh/year.
The TriCEP was established to supply an existing building cluster with heating, cooling, and domestic hot water (DHW).
Figure 1 presents the architecture of the TriCEP, excluding the distribution loops and the DHW system. The two brine-to-water heat pumps produce simultaneous heating and cooling and are connected to a sewage thermal energy reservoir based on stainless steel heat exchangers. The heat exchangers are mounted directly in a main municipal sewage pipe.
The heat pumps have two operational modes: heating priority and cooling priority. The mode controls whether the heat pumps prioritize meeting the outlet temperature at the condenser (heat) or evaporator (cooling). On the evaporator side, the heat pumps are connected in parallel; on the condenser side, they are connected in series when prioritizing heat production, and parallel when prioritizing cooling. Thus, in heat mode, the first heat pump’s outlet temperature equals the second one’s inlet temperature. As a result, the second machine generally operates at a higher temperature level than the first one. This heat pump had significantly higher operational hours and was therefore selected for modeling.
Each machine was specified with the following design parameters:
Heat production capacity of 250 kW produced at the condenser with the following COP and temperature criteria:
- ○
Condenser outlet/inlet temperature: +46/+40 °C.
- ○
Evaporator inlet/outlet temperature: +5/+1 °C.
- ○
Heating COP > 4.0.
Cooling production capacity of 220 kW produced at the evaporator with COP and temperature criteria:
- ○
Condenser outlet/inlet temperature: +40/+33 °C.
- ○
Evaporator inlet/outlet temperature: +15.5/+10.0 °C.
- ○
Cooling COP > 4.5.
The heat pumps are to be able to produce at least +60 °C when the outlet temperature of the evaporator is +1 °C. The minimum allowed inlet temperature to the evaporator is −1.5 °C.
The refrigerant is R-1234ze.
Both heat pumps have four semi-hermetic, reciprocating compressors, where two compressors per heat pump have inverter control. The heat pumps can operate seamlessly between 10% and 100% capacity.
In heating mode, the setpoint temperature at the condenser outlet is correlated to the ambient temperature. The correlation curve is set manually from the control system.
In cooling mode, only a single temperature setpoint at the evaporator is set in the control system manually. The heat pump system, including free cooling from the reservoir, is the only cooling source in the plant.
2.2. The Perspective and the Challenges of the Plant Operators
The municipal operators monitor and control the plant using a building automation system (BAS), Citect SCADA [
34], and an energy management system (EMS), Gurosoft [
35]. The municipality of Stavanger is responsible for the heating, ventilation, and air conditioning (HVAC) systems of more than 200 municipal buildings, and the BAS is vital in the day-to-day operation.
For the TriCEP, the BAS has process flowsheet pictures with live updates of all plant sensors. In addition, historical measurements of the past 13 months are stored and available.
Figure 2 shows the heat pump and nearby sensors. Each heat pump is equipped with a thermal energy meter on the condenser side and an electric energy meter, providing a continuous measurement of the heat pump COP. In addition, temperature sensors are available on inlets and outlets on both the evaporator and condenser of the machines.
From the perspective of the plant operator, the heat pumps can be seen as black boxes with flows entering the evaporator and the condenser with specific temperatures and the same flows exiting with decreased and increased temperatures, respectively. The machines were custom built, and no standardized simulation tool providing information about energy production and consumption at various operational points is available. Before the machines were set in operation, little to no information about operational conditions outside the design points was known. Operators and designers would greatly benefit from a tool to help identify and evaluate the most efficient operational conditions for a given demand.
Figure 3 shows a simplified sketch of the internal piping and instrumentation diagram (P&ID) of the heat pumps and a picture of the control panel. The data from the internal sensors are not accessible to operators in the BAS. These measurements would provide valuable insights beyond the limited information offered by the current black box configuration shown in
Figure 2, particularly regarding compressor control strategy and part-load conditions. However, based on the authors’ experience and investigations into other heat pump plants in the municipal BAS, the availability of internal heat pump sensors is generally limited.
2.3. The Heat Pump Process and Benchmarking Parameters
To aid in defining the model setup and selecting appropriate input and output parameters, it is important to establish clear definitions of key terms related to heat pumps. Domain knowledge can play an important role in this process, as Singh et al. have noted [
36]. Additionally, even basic system knowledge can help simplify and specify model development, as suggested by Mahbub et al. [
37].
The Coefficient of Performance (COP) is a crucial metric for an electrically driven heat pump, as it relates the compressor power
in kW to the useable thermal power
generated [
28]. COP is defined as
The useable heat generated by a heat pump depends on the specific target of the operation. For heat production, the useable thermal power
is represented by the condenser heat dissipation, while in a refrigeration process,
represents the evaporator heat extraction. In a combined heating and cooling process,
is the sum of heating produced at the condenser and cooling produced at the evaporator utilized in the system. The evaporator heat extraction
, condenser heat dissipation
, and compressor power are correlated by the following expression [
38]:
Within the models presented in this study, heat dissipation is defined as energy production (EP) and work as energy consumption (EC).
The operational COP is influenced by the temperature levels of the system [
28], especially the temperature lift from evaporation temperature,
TE, to condensation temperature,
TC, has a significant impact on the COP. As the temperature difference increases, so does the pressure difference that must be overcome by the compressor, resulting in a reduction in heat pump efficiency and a lower COP. The refrigerant and the properties of the thermodynamic cycle can also have a major impact on heat pump performance. These factors can influence the allowable temperature range of operation, the part load characteristics, and the overall efficiency of the heat pump [
39].
COP is a dynamic relationship that is continuously influenced by factors such as flow rates, temperature levels, and compressor part-load conditions. In the operational phase, the operational COP can be compared to the design COP to evaluate the performance of the system. A negative deviation between the values can indicate issues that require further investigation. However, this strategy relies on an understanding of the expected COP at various operational points.
Another important metric for evaluating heat pump performance is the Seasonal Coefficient of Performance (SCOP), which represents the ratio between the annual heat energy output and the annual electric energy input. The SCOP is influenced by a variety of factors, including the COP, local climatic conditions, and the heat pump’s integration with the building energy systems [
40]. The definition of the SCOP incorporates the utilization time (τ) of the heat pump [
38]:
where
and
are the heat pump energy production and consumption over the utilization time in kWh/
. The utilization time is most commonly a year, and the
SCOP is used to benchmark systems from year to year.
The net heat transfer
from a mass flow due to temperature change inside a control volume is given as [
41]
where
in kg/s is the momentaneous mass flow rate of the fluid entering and exiting the control volume,
, kJ/kg K, is the specific heat capacity of fluid and
and
, in K, are the inlet and outlet temperatures, respectively. Thus, there is a linear relationship between the outlet temperature and the heat production for a given inlet temperature and flow.
2.4. Method—Artificial Neural Networks
An artificial neural network (ANN) is a machine learning (ML) technique that emulates the biological neural networks found in the human brain [
42]. Comprised of interconnected artificial neurons, ANNs can receive inputs, process data, and generate outputs helpful in predicting the behavior of the modeled system. ANNs consist of interlinked neurons arranged in layers and offer versatility, power, and scalability, making them well-suited for large and complex ML tasks [
42]. After an ANN has been trained, it is easy to use, and it consists only of simple equations that can be programmed in any computer language for automatic operation. Since ANNs do not require an iterative solution to predict outputs, they are quick to respond and can also be used for on-line applications.
During a supervised training process, an ANN acquires knowledge from a dataset [
43]. The synaptic weights between the interconnected neurons are the adaptive parameters of the ANN that are adjusted during training to store the knowledge contained in the data. The ANN is a statistical tool used for data modeling, and it can create a nonlinear functional relationship between a set of input parameters and a set of output parameters during the training process [
43].
The diagram in
Figure 4a shows that the inputs to the artificial neuron are sourced from the neurons in the preceding layer [
42]. The standard structure of an ANN is made up of two layers, the input layer and the output layer. However, the model’s performance can be enhanced by incorporating additional hidden layers between the input and output layers.
Figure 4b demonstrates a multilayer perceptron with two hidden layers [
44]. This model has four inputs, eight neurons in the first hidden layer, six in the second hidden layer, and two outputs. The number of neurons required in the input and output layers is determined by the number of inputs and outputs required to model the system.
In a fully connected network, every unit in a layer is connected to every unit in the next layer [
42]. When inputs are introduced to the network, they are multiplied by weights that connect them to the layer of hidden neurons on the right. A bias term is added to the sum of the inputs [
43]. The resulting weighted inputs are then summed and transformed as they pass through the hidden neurons. The outputs of each hidden layer are used as inputs for the next layer, and this process is repeated in a forward direction, layer by layer until the network outputs corresponding to the applied inputs are calculated in the output neurons. The functional relation represented by the network structure with
n inputs,
k hidden neurons, and
m outputs shown in
Figure 4 can be expressed as follows:
where
is a weight connecting input
i to the hidden unit
j, and
is the bias for the hidden unit
j, corresponding to the fixed input
equal to 1. Similarly,
denotes a weight connecting hidden unit
j to the output unit
m, and
is the bias for the output unit
m, corresponding to the fixed input equal to 1.
and
g(.) represent the transfer function of the hidden and output neurons, respectively [
43].
During the supervised training process, the goal is to minimize an error function by adjusting the weights,
and
, which represent the connections between the input and hidden layers and between the hidden and output layers, respectively. The error function is defined as the difference between the predicted outputs,
, and the target outputs. Errors are first calculated in the output layer and then propagated backwards through the network. Based on the calculated errors, the weights are updated, and this process is repeated until the error is reduced to an acceptable level. This algorithm is referred to as backpropagation. After training, the weights are fixed, and the network is ready to predict outputs based on new data that was not used during training [
43].
Measurements from building automation and energy management systems, electricity and thermal energy meters, weather and climate stations, utility bills, national reports, and surveys are the most common data sources for training data-driven models [
45] in building energy systems. Measurements represent the most reliable data sources, provided that the quality of measurements is validated.
Hyperparameter Optimization with Bayesian Method
In ML, hyperparameters are parameters that are not learned from the data during training but are instead set before training the model [
42]. Hyperparameters are often specified by the user and control the behavior of the ML algorithm, the training process, and the structure of the model. Examples of hyperparameters for an ANN model include the learning rate, number of hidden layers, number of neurons in each layer, and activation functions [
42].
To achieve the best performance, the user sets the hyperparameters either through prior knowledge or by searching over a range of values to determine the optimal set of hyperparameters that result in the best model performance on a validation or test set. The options of hyperparameters for an ANN with a maximum number of 3 layers are presented in
Table 1. The optimizer is the type of optimization algorithm employed during training and the learning rate determines the magnitude of change in the weights in each iteration. The number of options for hyperparameters alone is of the order of 10⁹, even without considering the various possibilities for the learning rate [
42].
Hyperparameter tuning is an important aspect of the machine learning workflow, and it can be conducted manually or through automated methods such as grid search, random search, or Bayesian optimization [
42]. However, a naive force approach such as a grid search, where all possible combinations of hyperparameters are tested, is not practical for such a vast domain. A random grid search, where combinations are selected randomly, is quicker, but it is not always reliable. This work uses a Bayesian optimization algorithm to perform a more guided search for the optimal hyperparameters [
46].
Bayesian optimization is a technique used for globally optimizing noisy black-box functions by following a sequential design strategy. The process involves building a probabilistic model of the function to be optimized and refining the model as evaluations of the objective function are gathered through a Bayesian inference-based process. Bayesian optimization is a highly efficient way of solving complex and costly optimization problems [
47].
During the hyperparameter optimization, the input arguments for the optimization function are the selection of hyperparameters, and the output is the accuracy of the trained network. However, evaluating the function requires complete training, making it a computationally expensive task. To speed up the optimization process, a surrogate model (such as a Gaussian process model) is employed to represent the objective function. The associated acquisition function helps determine the next sample point to evaluate the objective function. This approach is more efficient as finding the maximum of the acquisition function requires fewer steps and is less time-consuming than the original optimization problem, reducing the number of evaluations required to determine a set of hyperparameters close to the global optimum [
46].
2.5. Model Configurations
In the study, ANN models for a specific heat pump are developed using measured data from the plant’s control system available to the operators. The dataset was obtained manually from the TriCEP BAS. Two distinct model structures are presented, each designed for a specific purpose, which will be elaborated upon in the following sections.
2.5.1. Model A—Setpoint-Based Model
Model A (
Figure 5) takes the flow rate through the condenser (
), inlet temperatures on both side of the heat pump (
and
at condenser and evaporator, respectively), and the temperature setpoint (TSP) for the operation as inputs, and predicts outlet temperatures (
and
at condenser and evaporator, respectively), energy production (
EP) and energy consumption (
EC). The model’s primary objective is to provide clear and precise predictions on the ways in which the heat pump responds to setpoint changes at various operational conditions. In addition, since the temperature setpoint is the only controllable parameter that the operator can directly adjust to influence the heat pump’s operation, it is considered a potential input in a future MPC.
2.5.2. Model B—Compressor Map Model
In Model B (
Figure 6), the temperature setpoint is removed from the inputs, and the outlet temperatures are moved from output to input. Consequently, the model obtains more comprehensive information regarding the heat pump’s outputs and loses its capacity to forecast the heat pump’s response to inlet conditions and a specified setpoint. According to Equation (4), the energy production can be determined from the inputs. As the machine is custom built without an available performance model, the target of this structure is to develop a mapping of the amount of energy the compressors consume at various temperature conditions. Thus, Model B can be considered a tool to develop a compressor map for this specific heat pump, allowing evaluation of the machine at part-load conditions. As discussed in the Introduction section, the compressor map is limited to the dataset which the model was trained on. Additionally, Shin and Cho demonstrated that a similar approach could be used as a real-time performance monitoring tool [
48].
2.5.3. Thermal Energy Meter and Flow Rate
Within the present study, we employ two distinct models to predict thermal energy production based on measurements from thermal meters that comprise a flow meter, two temperature sensors, and a calculating device. The calculating device is calibrated to accurately measure accumulated energy production over a specified time according to Equation (4). While the heat pump system under investigation is designed to maintain a nearly constant flow rate across the evaporator and condenser at all operating points, minor variations may occur depending on whether one or two heat pumps are in operation. Still, the flow rate is close to redundant as a model input parameter as it does not convey unique information to the models. However, the flow rate is included as an input parameter in both model configurations to establish a generalized model structure. This structure allows for training models with similar structures from data from other heat pump systems, including those with variable flow rates across the evaporator and condenser. It should be noted, however, that the models presented in this study are specific for the machine under investigation and the defined dataset.
2.6. Data Janitoring
In line with Teng et al.’s [
31] suggestion that researchers should engage in “low-level” research or “data janitoring” tasks, observations and challenges from the data handling process are discussed. The intention with the discussion is to offer recommendations to researchers and industry professionals on establishing their data-driven models for energy systems.
2.6.1. Data Capture
Data obtained from the TriCEP plant BAS process view are utilized in this study. In the view, the user can access figures containing historical data for each sensor or measuring unit. The time scales and the number of collected measurements are chosen by the user [
33]. The data were manually captured by copying and pasting from the BAS to Excel.
The data collected covers a period from 1 January 2022, at 01:00:00 to 31 December 2022, at 23:55. This time was selected to ensure that one full year of operation of the system was included in the analysis. It is noteworthy that the BAS only retains recorded data for the preceding thirteen months, rendering any uncollected data irretrievable.
Data were captured at a sampling resolution of five minutes. This interval was chosen because it was deemed to accurately describe the process while averaging out some measurements that lagged, as discussed in
Section 2.6.2. Collecting data manually is a time-consuming process, and the higher the sampling resolution, the more time is needed. Balancing the number of data rows with the model’s accuracy is crucial. Moreover, reducing the amount of data can lead to a reduction in the training process time.
2.6.2. Sampling Resolution
Several sampling resolutions were evaluated while developing the dataset. The resolution should be high enough to capture all system actions for the model to be used in an optimization-based control scheme. After considering various sampling resolutions ranging from 1 sec to 60 min, a 5 min interval was ultimately chosen. This interval was deemed practical as it balances the need to capture system actions and the time-consuming nature of manual data collection.
Figure 7 and
Figure 8 illustrate the same 30-minute time interval from 30 June 2021, with 1-second- and 5-minute-based sampling resolution, respectively. With a 1-second resolution, the 30-minute interval results in 1800 values per feature, while with a 5-minute resolution, only 6 values per feature are collected.
During the 30-minute interval, the heat pump was in operation for about 12 min and shut off for 18 min. To capture the operational pattern, the sampling resolution should be less than 12 min to prevent the complete energy production and consumption from being averaged out over one observation. The chosen five-minute resolution captures the start-and-stop, averaging the energy production and consumption over four of the six observations within the interval.
With a one-second resolution, the compressor electricity consumption (grey curve between purple lines) is registered a few minutes before heat production (green curve). Similarly, the compressor stops a few minutes before heat production is no longer registered. This delay may be attributed to thermal inertia, and due to the available energy meters being primarily designed to capture the accumulated energy production, with less focus on exact momentaneous measurements.
Through an investigation of comparable operational patterns, it was determined that there is no consistent time lag between the compressor’s start and the heat production registration. Consequently, a shift in heat production cannot be carried out uniformly with a constant time interval. The temperature sensors at the condenser are calibrated against the flow meter and follow the energy production curve. On the contrary, the evaporator temperatures respond instantaneously to the compressor, exhibiting a decline precisely when the compressor initiates operation, followed by an immediate increase upon cessation of compressor operation. This observation is illustrated between purple lines in
Figure 7. Further exploration of external sensors on the condenser side, compared to the sensor linked to the thermal energy meter, may provide valuable insights.
Another observation is that the compressor power registration appears as a smooth curve in the one-second resolution, while the other measurements exhibit jaggedness to varying degrees. The potential cause of this difference is variable sampling resolution for different sensors. A one-second resolution may be too high for some sensors, which could result in this discrepancy.
By using the five-minute sampling resolution, the delay between energy production and consumption is smoothed out over the interval while retaining information on the heat pump’s starting and stopping time within the observation period. However, there is still one instance of delay between production and consumption in the example data. The final recorded production of 10 kWh/5 min happens with 0 kWh/5 min energy consumption. This scenario was considered when processing the dataset.
2.6.3. Data Processing
The complete initial dataset consisted of 105 108 rows with eight features per row. The data were controlled manually, and the following rows were removed from the dataset.
All rows with one or more missing features, a total of 4684 rows.
As described in the previous section, a delay between the registration of energy consumption and production still occurred with the five-minute sampling resolution. Therefore, all rows with COP > 6.0 were removed from the training data, a total of 3764. These rows represented less than 1% of the unprocessed dataset’s summarized energy production and consumption.
A delay of 20 to 70 min between registration of an actual switch between heating and cooling mode occurred randomly. The actual switch occurred as the rule-based control strategy intended. Rows representing this delay were removed, as the TSP input is incorrect; there was a total of 3576 rows.
Days with planned heat pump maintenance and the machines shut off were removed from the data, totaling 3603 rows.
Errors at the temperature sensors at the evaporator occurred, totaling 1728 rows.
Eight days were excluded from the data to be used as a visual test set, see
Section 2.8.
All removed data was stored. The final cleaned dataset consisted of 89,304 rows or 310 days of data, accounting for 85% of the year.
Figure 9 represents the eight input values used to develop the heat pump ANNs. Each feature was sorted into 50 equally sized bins. The vertical axis represents the number of observations per bin.
The inlet temperature to the condenser ranges from 46 to 54 °C, with most observations clustered around 50 °C. Conversely, the inlet temperature of the evaporator displays a wider range of variation, ranging from 0 to 17 °C, with most observations falling between +5 and +7.5 °C. Notably, in heat mode, the evaporator’s inlet temperature is highly dependent on the temperature of the heat reservoir, i.e., the sewage temperature. The flow across the condenser is close to constant, centered at 11.0 L/s. The temperature setpoint indicates that the heat pump primarily operated in heat mode throughout most of the year, set to produce temperatures between 50 °C and 58 °C at the condenser outlet. Cooling priority, with setpoints at either 0 or 10 °C at the evaporator outlet, was only observed 3.9% of the time.
Furthermore, outlet temperatures were observed to be shifted compared to their respective inlet temperatures, with increase observed at the condenser and decrease observed at the evaporator. Notably, energy production and consumption data displayed considerable variability, ranging from the heat pump being shut off to operating at maximum capacity. However, some data points were observed more frequently than others.
2.7. Visual Test Data
Three distinct periods of days were selected from the dataset to represent different operational conditions of the heat pump. The input values for the selected days were then used to evaluate the performance of the models. These days were not part of the training data.
The first set of test days (TD1) spans from 27 January 2022 00:00 to 29 January 2022 23:55, representing winter operation conditions. During this period, the heat pump operated with all four compressors at 100% capacity for some hours, while most hours involved three compressors running at 100% and the fourth operating between 0% and 100%. During the final hours of the third day, one of the compressors was out of operation due to a failure.
The second set of test days (TD2), covering 28 June 2022 00:00 to 30 June 2022 23.55, represented summer operation conditions. Variations in heating and cooling priorities characterized this period. Notably, the cooling demand was so low in some periods that the heat pump operated in a continuous “start–stop” cycle.
The third set of test days (TD3) spanned from 16 November 2022 00:00 to 17 November 2022 23:55, representing fall operation conditions. During this period, the heat pump produced heat continuously but with frequent changes in capacity, a typical operation mode during fall and spring. The data recorded during this period also captured unexpected compressor stops.
2.8. Model Development and Training
After the optimal configurations were determined, the ANNs were trained using backpropagation, which involves adjusting the network weights. The ANN was implemented using Python 3.8 [
49] and the deep learning API Keras [
50], which runs on top of the ML platform TensorFlow [
51]. The dataset was normalized to scale the data between 0 and 1.
During the training process, the ANN was fed inputs and corresponding desired outputs, and the weights and biases were updated using the difference between the predicted and expected outputs. The training continued until the model’s output was sufficiently close to the expected output. To avoid overfitting during the training process, cross-validation was performed on 80% of the data, while the remaining 20% was used to test the performance of the model. The training procedure was executed in batch mode, and Bayesian optimization was used to define other parameters, such as the learning rate and backpropagation optimizer. The set of optimized hyperparameters for the constructed models is presented in
Table 2.
5. Conclusions
In this study, two alternative heat pump model structures based on Artificial Neural Networks (ANN) are developed and presented. The strengths and limitations of the ANN are highlighted, and the importance of having accurate and sufficient data for developing and using the models is emphasized.
Model A predicts energy production and consumption with MAPE below 10% and outlet temperatures with MAPE between 2 and 5%, except during cooling mode. While there are some errors in Model A’s momentaneous predictions of energy production and consumption, a summation of the predictions to hourly values leads to a satisfactorily prediction of the operation with a MAPE of 3% or less. Model A rapidly identifies compressor failures and unexpected stops and can further be developed as a system-specific fault detection tool. Model B is an excellent predictor of energy consumption and COP, providing the industrialist with a tool to continuously improve design evaluations and building owners to monitor performance. Except during cooling mode, the MAPE is never above 5%.
The approach presented in this article is straightforward and provides the user with a fast method to develop system-specific models of heat pump energy consumption and COP when no knowledge of the internal heat pump configuration is available. This is information which is often only available from supplier software, often kept in house [
55], or, alternatively, demands advanced physics-based modeling. Though a physics-based model allows for more general evaluations, the ANN offers a quick and precise method to capture the dynamics of the available data. The most crucial factor for success is a sufficiently clean and synchronized dataset representing a selection of relevant operational conditions.
Emphasizing the importance of “data janitoring”, we also demonstrate that delays between measured energy consumption and production and limitations of energy meters and temperature sensors can be sources of uncertainty in the modeling. The main takeaway relevant for mechanical engineers responsible for thermal energy plant design is the necessity to consider the importance of accurate and synchronized data. For further improvement of the models, we plan to evaluate higher sampling resolutions and perform an investigation into using external temperature sensors at the condenser.
Implementing appropriate tools can enable operators of thermal energy plants to identify faults and errors in the system earlier than they do presently, and also enhance the system’s operation through mathematical optimization [
33]. The main target of this article was to present a method to develop a quick and precise heat pump model using readily available data. While the TriCEP study case has been deemed successful in meeting design targets for energy results, several operational conditions with potential for improvement have been identified. A smart controller based on the developed heat pump models could be employed to evaluate the following tasks [
33]:
Setting heating and cooling priority.
Reduce the number of start–stops of the compressor, especially when the machine is set to cooling priority, and the demand is limited/non-existent.
Determining when to prioritize heat pump or solar collectors for heating DHW.
Continuously evaluate and update the temperature setpoints of the heat pumps to consider influences beyond the ambient temperature, typically energy cost and weather forecast.
Determining degradation in the heat pump or the surrounding system.