Degradation-aware data-enabled predictive control of energy hubs

Mitigating the energy use in buildings, together with satisfaction of comfort requirements are the main objectives of efficient building control systems. Augmenting building energy systems with batteries can improve the energy use of a building, while posing the challenge of considering battery degradation during control operation. We demonstrate the performance of a data-enabled predictive control (DeePC) approach applied to a single multi-zone building and an energy hub comprising an electric heat pump and a battery. In a comparison with a standard rule-based controller, results demonstrate that the performance of DeePC is superior in terms of satisfaction of comfort constraints without increasing grid power consumption. Moreover, DeePC achieved two-fold decrease in battery degradation over one year, as compared to a rule-based controller.


Introduction
In 2021, the energy use in buildings represented 45% of the total energy demand in Switzerland [1].Mitigating the energy use in buildings, together with satisfaction of comfort requirements are the main objectives of efficient building control systems.It has been shown that improving energy storage in buildings by introducing batteries helps achieving these objectives [2].However, the operation of a battery is affected by time, use or operating conditions and the battery may degrade.The goal of this work is to devise an efficient control system for buildings taking into account battery degradation.
It is important to ensure efficient operation of the controller that can take into account the degradation of the battery over time.In this context, Model Predictive Control (MPC) has been shown to reduce energy usage while maintaining comfort and operational constraints [3].However, first principles models of buildings, and in particular of the effects of degradation, are costly to develop and difficult to maintain.Hence, to efficiently mitigate energy consumption over the whole lifetime of buildings, it is crucial to minimize degradation of the battery without an extensive modelling effort.In this work, we overcome the difficulties of first principles modelling by extending existing data-based approaches to capture the behaviour of a building affected by battery degradation.
Data-Enabled Predictive Control (DeePC) is used to investigate the performance of an energy hub comprising of a battery affected by degradation, and a heat pump.In contrast to classical MPC, DeePC computes an optimal control strategy for a linear time-invariant system using sufficiently rich input-output trajectories of the system.In this work, we extend the use of DeePC to long-term operation of building climate control considering nonlinear battery degradation.
The paper is structured as follows.In Section 2, we provide the theoretical background on DeePC, which outlines the basis for the problem formulation in Section 3. Models for the building, battery, and heat pump dynamics are summarized in Section 4, and results from the simulations are discussed in Section 5.

Preliminaries on DeePC
Consider a discrete LTI system at time k ∈ N 0 : where x k ∈ R n is the state of the system, u k ∈ R m is the input vector, and y k ∈ R p is the output vector.The system matrices are is full rank.Following [4], we have that T d ≥ (m + 1)(L + n) − 1. DeePC uses Hankel matrices constructed from persistently-exciting inputs and corresponding outputs in lieu of a model of the form (1) to find optimal trajectories of the system [4].We consider Hankel matrices H T ini +T f (u d ) and H T ini +T f (y d ), and a partitioning thereof, The Fundamental Lemma presented by [4] states that if the system (1) is controllable and u d is persistently exciting of order k +n, then any sequence col(u ini , y ini , u, y) ∈ R T ini +T f is a trajectory of the system, if and only if there exists g

DeePC for energy management
In this section the data-driven optimization problem for the optimal operation of the energy hub and the building is presented.The main objective is to minimize the energy consumption from the grid while satisfying operational constraints.We consider an energy hub comprising a heat pump and a battery that is used to supply the thermal demand of a five zone building.
The measured output y e ∈ R 7 includes the temperatures of all zones in the building, y s ∈ R 5 , the output power of the heat pump, y h , and the voltage of the battery, y b .The input vector u e ∈ R 22 constitutes the control inputs u s ∈ R 9 to the building, the power input to the heat pump u h , the battery current u b , and the disturbances, v s ∈ R 11 .The inputs u i s , i = 1, . . ., 5 describe the input to the radiators in each of the five zones, and u i s , i = 6, . . ., 9 describe the blinds openings available in four rooms.The disturbances v s in are assumed to be known exactly from an accurate forecast.
The DeepC controller computes the setpoints and we assume that low level controllers ensure that the setpoints are reached.The key advantage of DeePC is that we work directly with data, thus avoiding the need to model these low-level controllers.The resulting DeePC optimization for the optimal energy hub control over a prediction horizon T f is formulated as: min ue,ye,g where p k is the energy imported from the electricity grid at time k and c k is the price of energy imported from the grid.The cost function (5a) comprises of the linear cost of the electricity over the prediction horizon T f , in addition to the quadratic penalization on the power coming from the grid to improve numerical properties of the optimization problem with β = 0.01.The cost also includes a regularization on the norm of g with the parameter λ g = 1000 to avoid over-fitting and improve robustness [5].The slack ρ on the comfort constraints is also penalised quadratically by the parameter λ ρ = 10.The DeePC control strategy is incorporated in the constraint (5b) in order to optimize the room temperatures in the buildings.The inequality constraints (5c) limit the radiator and blind inputs of the building, and (5d) is the comfort constraint that ensures that the temperatures of the five zones remains within the time-dependent maximum and minimum temperatures, y k s,min and y k s,max .The temperature is between 10°C and 40°C between 23:00 and 5:00 when the building is unoccupied, and between 21°C and 25°C during regular hours.A slack variable ρ on the comfort constraints ensures that the problem remains feasible for all disturbances v k s .The constraints (5e) and (5f) limit the current u k b ∈ [−22, 22] A and voltage y k b ∈ [63, 68] V of the battery so that the battery is charged or discharged at a maximum C-rate of C 4 based on the capacity of the battery, and that the battery voltage operates in the nominal region.The static model of the heat pump is incorporated using (5g) and (5h) with the coefficient of performance C h = 3, and (5i) relates the output power from the heat pump to the heating power of the five radiators, where α i are the coefficients corresponding to conversion factors with α i = 11.9 for i = 1, 2, 3, α 4 = 27.77,α 5 = 7.58.
Finally, (5j) is energy balance equation for the electricity in the hub, i.e. the power coming from the grid and the battery must be equal to the power going into the heat pump.Since both the voltage and current of the battery are decision variables, it would result in a bilinear equation that is difficult to solve.As a result, the battery voltage of 66V is used as an operating point in order to linearize this constraint.

Energy hub Modelling
The performance of DeePC is tested on a simulated building and energy hub model, created using the energy hub component modelling (EHCM) toolbox [6] in MATLAB.

Building
In this work, we use an office building with five rooms (zones).The building is modelled using the Building Resistance Capacitance Modeling (BRCM) Toolbox which describes the building's thermal dynamics as a continuous time system, bilinear in the inputs: where the states of the systems, x s ∈ R 113 , include the temperatures of each room and the temperatures of the layers of the building elements i.e. floors, roof, and inner/outer walls that connect the zones of the building.The input vector u s ∈ R 9 constitutes the control inputs, including the heating power of the radiators installed in the five zones (W m 2 ), and inputs for the position of the four blinds on each facade of the building.The disturbance vector v k s ∈ R 11 comprises of the internal gains in the five rooms (W m 2 ), ambient temperature (°C), ground temperature (°C), and the global solar radiation on the four sides of the building (W m 2 ).The model thus considers external heat fluxes going into or coming out of the building including internal gains due to occupancy, lights and equipment, heating power from the radiators, and disturbances from ambient and ground temperature and heat gains by global solar radiation.A detailed description of the model and the matrices A c , B u , B v , B vu , C c can be found in [6].

Battery
A lithium-ion battery is considered for the energy hub modelled using a nonlinear Shepherd's model, which describes how the terminal battery voltage changes with the input current [7].The output of the model, y k b , is the battery terminal voltage computed as , and R 0 is the internal resistance of the battery [Ω].The internal resistance of the battery is affected by degradation.Battery degradation is modelled as ageing defined as the number of full cycles, i.e. the number of times the State-of-Charge (SoC) goes from zero to 100% and back to zero.The battery with parameters 12.8 V 40 Ah is implemented using the battery block in Simulink that includes the effects of cycling.

Heat pump
Heat pump uses electricity to generated heat to satisfy the building heating demand.The EHCM toolbox uses a static model of the heat pump where the input and output at each time step related through the Coefficient of Performance (COP) as given in (5h).

Results
The controller from Section 3 has been implemented in the case study from Section 4. All simulations were performed in MATLAB/Simulink 2022a with YALMIP [8] and Gurobi [9].The total simulation horizon was chosen as one year, T all = 8760 h.The controller was implemented in a receding horizon fashion, with prediction horizon of T f = 24 h.The parameter T ini = 30 h was chosen to minimise the prediction error between Y p and the true output over the prediction horizon T f , at a fixed sampling time of T s = 1 h.The code is available in [10]

Data collection
The first step in solving the problem (5) consists in collecting input and output data for the Hankel matrices in (5b).Measurements from the battery, the building and the heat pump were taken over T d = 4416 hours (184 days).The ageing effects on the battery were not taken into account in the data collection phase.For data collection, we used rule-based controllers (RBC) for the radiators and the blinds to ensure that the temperatures of the five zones stay within time-varying bounds: where δ k,i s is an auxiliary input disturbance, chosen as a pseudo-random binary signal (PRBS) with amplitude of 5kW, necessary to ensure the condition on persistence of excitation.The battery controller is based on State-of-Charge (SoC) and the time of day.From midnight to 4 a.m.we charge the battery with a 15A current up until its SoC reaches 90%.Then from 5 a.m. up until 23 p.m., the battery gets discharged.Then, when the SoC reaches 20%, we wait for the next charge during the night.To ensure the persistence of excitation, the applied current is also perturbed with a PRBS signal with amplitude of 15A.The rule-based controllers were then used to find u ini and y ini .

Prediction
The choice of parameters was validated by evaluating the absolute error between the predicted outputs y s obtained from solving (5) and the response of the building from simulation y s, sim at a given prediction hour, k = 1, . . ., T f .Let j = 1, . . ., 5 correspond to the room number, then the average error for each room for each prediction hour is given by k j = T all i=1 |y k s,i,j − y k s, sim,i,j |/T all , where T all = 8760 h is the complete simulation time of one year.Figure 1(a) shows the error for the five rooms as a function of the prediction time.For all the rooms the average error is below 0.5 • C which is considered acceptable [11].Moreover, the prediction error in the battery voltage remains below 0.5 V on average (Figure 1)(a) which is below 1 %. Figure 1(b) shows the output room temperatures and battery voltage obtained using DeepC and RBC over a selected day in January (24 h) and it shows how DeepC results in better temperature and voltage regulation.(5a) was focused only on the cost of operation of the energy hub, by optimising the input current to the battery and reducing its oscillatory nature, DeePC led to two times smaller age of the battery as the number of cycles, compared to RBC.The capacity loss was also reduced (0.3% in DeePC compared to 0.8% in RBC).Furthermore, DeePC enabled enforcing constraints on the battery voltage.Conversely, RBC adjusts only the battery current, which led to oscillatory behaviour contributing to the intensified ageing of the battery.

Long-term operation
Quantitative results for constraint violation are collected in Table 1.RBC violates the comfort constraints on average up to 5.5% of the year whereas DeePC violates the constraints up to 2.8% of the time and has smaller violations.At the same time, the cost is comparable in both RBC and DeePC, with DeePC cost being 0.9% lower.

Conclusions
In this work, we have investigated the performance of data-enabled predictive control for building energy management through a simulation that incorporates degradation processes that affect battery behaviour.A simulation setup with a single building and an energy hub comprising an electric heat pump and a battery was considered.A comparison between DeePC and the RBC showed that the battery ageing was reduced by over a factor of two under DeePC operation, as well as a reduction of constraint violations.The impact of the simplified model of battery degradation (no calendar ageing, no self-discharge, no influence of varying external conditions) requires further investigation, ideally in an experimental setup.Future studies also aim to investigate the performance of DeePC as compared to more realistic rule-based controllers and on larger energy hubs with uncertain PV generation and the influence of the battery, as well as to extend the proposed approach to multiple buildings in a district.
m and y d = (y d (1), ..., y d (T d )) ∈ R T d p denote the input and output trajectory of length T d .Let L, T d ∈ Z ≥0 and T d ≥ L. The input trajectory u d ∈ R T d m is called persistently exciting of order L if the Hankel matrix

Figure 1 :
Figure 1: (a) Average prediction error for the five room temperatures and the battery voltage using DeePC over the entire year.(b) Comparison of the room temperature and the voltage output using DeepC and RBC over a selected day in January (24 h).(c) Evolution of age and capacity of the battery using DeePC and RBC over the entire year.

Figure 1 (
c) shows the performance of the battery over the entire year.The oscillatory nature of the battery current in RBC led to intensification of battery ageing process quantified as the number of cycles (top) and loss of capacity (bottom).Even though the objective function from

Table 1 :
Performance comparison in terms of lower (LBV) and upper bound (UBV) constraint violations, and the overall cost.