Application of model predictive control to building design optimisation

. Optimisation algorithms offer a valuable tool for enhancing the energy efficiency of buildings by fine-tuning specific design parameters. Model Predictive Control (MPC) emerges as a compelling technology to address the rising need for improved efficiency and adaptable operation within building energy systems. A simulation study using MATLAB and EnergyPlus was conducted to examine the influence of MPC and building design optimisation (BDO) on wall insulation thickness and internal mass area. The focus was on their impact on heating energy use and indoor thermal comfort in an office room located in Brussels, Belgium. The study revealed that the sole implementation of MPC led to a 7.6% decrease in heating energy use, while the application of BDO resulted in a more significant reduction of 12.8%. Remarkably, the fusion of MPC and BDO yielded the highest energy savings, cutting heating electricity usage by 23.4% compared to the baseline model. Moreover, MPC effectively maintained indoor temperature within the desired thermal comfort boundaries. The optimal wall insulation thickness and internal mass area were also ascertained through BDO, both of which exceeded the levels set by the baseline model. BDO, in conjunction with MPC, demanded the maximum permissible insulation thickness of 320 mm for the external north and south walls. Interestingly, when BDO was combined with MPC, the requirement for the internal mass area reduced by 11.7 m 2 compared to utilising BDO alone. The study’s results underscore the potential of integrating MPC with BDO to elevate building energy efficiency. Furthermore, this strategy may be adaptable to optimising other building parameters at the early design stage, thereby augmenting overall building energy efficiency.


Introduction
Building design optimisation (BDO) involves using mathematical models and optimisation algorithms to determine the most energy-efficient design and operating strategies for buildings. Different optimisation algorithms can be used to optimise a single building system, such as heating, ventilation, and air conditioning (HVAC), or to optimise the performance of the building as a whole. Building energy simulation (BES) software, such as EnergyPlus [1], can be used in conjunction with BDO algorithms to evaluate the energy performance of different design and operating strategies [2].
Model predictive control (MPC) is a control strategy that involves using a model of the system being controlled to predict its future behaviour and optimise the control inputs accordingly. MPC can be used to optimise the operation of a building's HVAC and lighting systems to minimise energy consumption and improve indoor environmental quality [3].
Previous studies usually focus on the MPC design of HVAC systems for a given building (e.g., [4]). The building parameters, such as insulation level and thermal mass level, affect the heat gains of the building, which also have an impact on the MPC performance. The application of MPC to BDO can potentially lead to significant improvements in building energy efficiency. * Corresponding author: rui.guo@kuleuven.be However, to the authors' best knowledge, few prior studies investigated the integration of BDO with MPC. One reason for this research gap is the difficulty of automatically identifying black-box or grey-box models of buildings, which need expertise in control strategy development and are necessary for MPC design. The models built in BES software are white-box models, which describe the building dynamics from physical knowledge with a large number of equations. The nonlinear nature of these equations makes the implementation of white-box MPC more difficult [5]. Another challenge is the complexity of integrating MPC and BDO, which requires the development of sophisticated mathematical models and optimisation algorithms that can handle many variables and constraints involved in BDO.
For this research gap, a simulation framework is used to identify the grey-box model based on the EnergyPlus white-box building model and designs the MPC strategy to control the energy systems for the white-box model. Meanwhile, the genetic algorithm couples EnergyPlus to optimise the insulation level and thermal mass level of buildings with and without MPC.  1 shows the proposed simulation framework in this study. The optimisation involved three steps. First, the Input Data File (IDF) is used to construct the white-box building model in EnergyPlus, and the results are saved in a comma-separated value (CSV) text file. Next, a coupling engine in MATLAB is created to load the IDF data, modify the parameters based on the optimisation problem's decision variables, and send the modified IDF back to EnergyPlus for simulation. Finally, the genetic algorithm from the Global Optimization Toolbox™ [6] in MATLAB is used to find the optimal solution by repeatedly running simulations until convergence.
For the case without MPC, the optimisation process mentioned above is adopted to identify the optimal building parameters based on the white-box building model. For the case with MPC, a tool [7] built-in MATLAB is used to design the MPC controller and cosimulate it with the EnergyPlus model. Then the optimisation process is combined with MPC to find the optimal building parameters. The MPC design is elaborated on Section 2.3.

MPC optimizer
Coupling Engine

Baseline model
EnergyPlus 9.3.0 [1] was selected to build a northsouth facing office building. An office room in the middle with two windows was chosen as the case room for simulations, as shown in Fig. 2. It was worth noting that the internal partitions between the case room and adjacent rooms were set as adiabatic by assuming similar conditions in all adjacent rooms.  Table 1 shows the areas and U-values of each building element. The prescribed U-values were based on the building envelope requirements in Flanders, Belgium [8]. The thickness of the insulation material (EPS) in the external north and south walls is 150 mm. The window glass solar heat gain coefficient and visible transmittance are 0.85 and 0.508, respectively. According to EN ISO 13786 [9], the dynamic heat capacity per unit floor (cdyn/Afloor) can quantify the thermal mass level of buildings. Thus, cdyn/Afloor of the case room is 118.7 kJ/ (m 2 ·K). Note that the internal mass (concrete) area is 50 m 2 . The occupant schedules and internal loads for a single office room in EN 16798-1:2019 [10] were referred for setting the internal heating gains in EnergyPlus. Thus, 15 people with the heat of 120 W/person and 1.0 clo cloth insulation in winter and electric appliances (equipment and lighting) with 12 W/m 2 were set. The hourly operational schedules for internal heat gains were 1.0 during the occupied hours (10:00 -12:00, 14:00 -16:00) on weekdays and 0 for the other hours.
The simulation was conducted during a heating season from January 1 to March 1. The weather data of Brussels 064510 (IWEC) from the International Weather for Energy Calculations was used for simulations. An electric resistance heater was installed. The operative temperature heating setpoint was 22 ℃ during working hours (i.e., 10:00 -16:00) on weekdays and 16 ℃ during unoccupied hours, which were based on the indoor temperature ranges for hourly energy calculations in category II (i.e., 20 -24℃) and minimum operative temperature in occupied hours for the single office [10]. Mechanical ventilation with heat recovery was also installed for hygiene and energy-saving requirements. The sensible heat recovery efficiency was 0.75, and the outdoor airflow rate was 36 m 3 /(h·person) [10].

Model predictive control (MPC) design
As shown in Fig. 1, the grey-box model based on the white-box model in EnergyPlus should be identified first. The MPC controller that includes the optimiser, predictor and observer is then designed.
To minimise an objective function and meet certain constraints, such as comfort bounds and physical system limitations, the optimiser seeks to find the optimal control signals for the emulator model (i.e., white-box model). Meanwhile, the predictor forecasts future disturbances, and the observer estimates the actual states for the optimiser. After the control signals are sent to the building model for co-simulation to control the building's indoor climate, a measurement allows the observer to estimate the new state is returned. The process is then repeated, shifting the optimisation horizon one-time step.
In this study, the control signal computed by the MPC controller is the heat flux to the case room. As the heating system in the baseline model is an electric resistance heater, which is 100% energy efficient in the sense that all the incoming electric energy is converted to heat [11], the computed heat flux by MPC equals the electric power input from the heater.

Grey-box model identification
Using input data files and processed data from EnergyPlus, a linear state-space model of the thermodynamics of buildings is generated based on the well-established resistance-capacitance (RC) modelling framework [12]. The RC modelling framework simplifies heat transfer by using a lumped parameter equivalent circuit to represent partial differential equations. The following energy flux balance equation is applied at each node of the RC model: where Cn is the thermal capacity, and Tn is the temperature of node n, respectively. Qc combines the heat flux acting on the node due to conduction and convection, Qg is the flux from solar and internal gains, Qr is the flux due to radiation, and Qheating is the flux from the heating system acting on the node.
To obtain the RC model, the original heating system in EnergyPlus is removed, and one scheduled heat gain object in the room is added through the ExternalInterface:Schedule in EnergyPlus.
By running the EnergyPlus model once, the relevant results include thermal characteristics of the material, zones, surfaces, constructions, and data about internal gains and weather conditions are collected. Then the building is described as a set of thermal nodes with thermal capacities connected by thermal resistances. Each layer of each surface will form one node, and each zone also is described by one node. Thermal equivalent resistances are used to model thermal conduction, convection and longwave radiations. Finally, the linear state-space model of the building based on the results from EnergyPlus is discretised to obtain a model of the form below: xk+1 = Axk + Buuk + Bddk (2) yk = Cxk (3) where xk is the state vector (e.g., the temperatures of zones, surfaces, and internal nodes) at time step k, uk is the control input (i.e., heat flux) from the heating system, and dk is the weather (e.g., outside temperature and solar gains) and internal gains disturbance vector, yk is the operative temperature in the case room.

MPC optimiser
An economic MPC with soft constraints is considered in this study. The objective function is to minimise the heating energy use, as shown in Eq. (4). min J =∑ ‫ݑ|‬ ௧ | ேିଵ ௧ୀ (4) where N is the horizon length. Since the simulation time-step for EnergyPlus is 3, and the MPC prediction horizon is selected as 24 h [13]; thus the N is 3*24 = 72. The MPC control interval is set as 0.5 h.
The inputs and the outputs of the model are subject to constraints: umin ≤ uk ≤ umax (5) ymin ≤ yk ≤ ymax (6) umin and umax are the minimum and maximum electrical power of the resistance heater, which are 0 and 10 kW, respectively. ymin and ymax are 20 ℃ and 24 ℃ during working hours, respectively. During the rest of the period, ymin and ymax are 16 ℃ and 28 ℃, respectively.
To implement MPC controllers, it is necessary to know the weather, including solar gains, occupancy, and other internal gains by the predictor. It is worth noting that this study focuses on BDO based on the typical schedule of internal heat gains and historical data (TMY3). It therefore assumes that future predictions of disturbance (i.e., weather, internal heat gains) can be made with complete accuracy.
To address disturbance prediction errors and modelling mismatches and estimate the full state information of the building, the offset-free formulation [14] and Kalman filtering [15] are combined to create the observer. The MPC controller is implemented in MATLAB using the YALMIP toolbox [16] with the Gurobi optimiser [17].

Optimisation setup
The genetic algorithm was adopted to find the optimal insulation and thermal mass levels. Table 2 summarises the parameters to be optimised. The range for P1 corresponds to the external north and south wall U-value from 0.12 to 0.24 W/(m 2 ·K), while the range for P2 corresponds to cdyn/Afloor from 91.3 to 173.3 kJ/ (m 2 ·K). Based on the decision variables, the population size was 8, and the maximum number of generations was 50.

MPC performance demonstration
The baseline models with and without MPC were simulated during a winter week (January 15 to January 21) to compare the zone operative temperatures and the electrical power of resistance heaters to demonstrate the MPC performance. Fig. 3 shows the outdoor air temperature and direct solar radiation rate in a typical winter week. It can be seen that the outdoor air temperature oscillated between 0.5°C and 10.6 °C. Some days were cloudy without solar radiation. The maximum daily value of global direct solar irradiance was 564 W/m 2 , occurring during the midday hours on January 20.  The zone operative temperature without MPC followed the prescribed temperature setpoints (i.e., 22 ℃ during working hours, 16 ℃ during unoccupied hours). When MPC was adopted, the zone operative temperature fluctuated within the prescribed variable temperature constraints defined in Eq. (6), indicating that MPC worked properly. Due to the solar radiation in the midday hours of January 20 (see Fig. 3), the zone operative temperatures peaked (close to 27 ℃) in this period.
Compared to the baseline model without MPC, MPC tended to control the zone operative temperature close to the lower bound of the constraints during working hours. Therefore, the heater controlled by MPC had a lower peak power (see Fig. 5). On the other hand, MPC could turn on the heater in the early morning of some days (e.g., January 18) due to the lower temperature on the previous days to fulfil the temperature constraint (i.e., 16 ℃) at night. However, MPC overall contributed to lower heating electricity use. For the winter week, the heater with MPC consumed 26.3 kWh of electricity, 27.6 % lower than the electricity use (36.3 kWh) by the ordinary heater without MPC.   Table 3 lists the building parameters and heating electricity use during the simulation period (i.e., January 1 to March 1) in different research cases. It can be first seen that compared to the baseline case, the MPC case (based on the baseline model) can contribute to 0.13 kWh/m 2 (7.6%) heating energy savings. The BDO and the MPC + BDO cases required the highest allowed EPS insulation thickness (i.e., 320 mm, cf. Table 2) for both the north and south external walls and a larger internal mass. As a result, the BDO case saved 0.22 kWh/m 2 (12.8%) of electricity use compared to the baseline case. While the MPC + BDO case further reduced electricity use by 0.41 kWh/m 2 (23.4%). Fig. 6 and Fig. 7 compare the zone operative temperatures and the electrical power of resistance  Fig. 6 clearly shows that due to the higher thermal mass level in the MPC + BDO case, the zone operative temperature of this case dropped more slowly after the working hours than in the MPC case. Therefore, the resistance heater consumed much less or even no electricity to violate the lower bound (i.e., 16 °C) of the temperature constraint during unoccupied hours, as shown in Fig.7. Meanwhile, the increase in the insulation level reduced the indoor heat loss. Therefore, compared to the MPC case, the MPC + BDO case required less electrical power and maintained a similar zone operative temperature during working hours.

Comparison between the results of research cases
When comparing the BDO case and MPC+BDO case, the latter one not only saved more heating energy use but also required 11.7 m 2 (corresponds to cdyn/Afloor of 6.3 kJ/ (m 2 ·K)) less internal mass area. It indicates that MPC can effectively utilise thermal mass to save heating energy. It was worth noting that the internal mass areas of two optimal cases did not reach the highest allowed area (i.e., 150 m 2 , cf. Table 2). This means that more thermal mass is not better, but there is an optimal value based on the building and HVAC equipment performance.

Conclusions
This study proposed an integration of MPC with BDO simulation framework to investigate the impact of MPC and BDO in wall insulation (EPS) thickness and internal mass area on heating electricity use and zone operative temperature in a building. Compared to the baseline model, the results showed that using MPC and BDO resulted in a 7.6% and 12.8% reduction in heating electricity use, respectively. The combination of MPC and BDO achieved the greatest energy savings with a 23.4% reduction in heating energy use. MPC also maintained the zone operative temperature within thermal comfort constraints. The optimal EPS thickness and internal mass area were also identified through BDO, which were both higher than the baseline model. The optimal EPS thickness for the BDO case and the MPC + BDO case both reached the highest allowed insulation thickness (i.e., 320 mm) for the external north and south walls. However, the MPC + BDO case required 11.7 m 2 less internal mass area than the BDO case. MPC can effectively activate the thermal mass to save heating energy. These results highlight the potential of applying MPC to BDO at the building design stage to save on building energy use and building materials.
In future research, it is essential to consider various factors to obtain a more comprehensive understanding of the feasibility and potential return on investment of these strategies. These factors include dynamic electricity pricing, heat pumps with variable coefficients of performance, investment costs associated with implementing MPC, and the utilisation of different building materials for insulation and thermal mass. Incorporating these considerations will contribute to a more holistic evaluation of the proposed strategies.