Model Predictive Control for Energy Optimization of HVAC Systems Using EnergyPlus and ACO Algorithm

: The deployment of model-predictive control (MPC) for a building’s energy system is a challenging task due to high computational and modeling costs. In this study, an MPC controller based on EnergyPlus and MATLAB is developed, and its performance is evaluated through a case study in terms of energy savings, optimality of solutions, and computational time. The MPC determines the optimal setpoint trajectories of supply air temperature and chilled water temperature in a simulated ofﬁce building. A comparison between MPC and rule-based control (RBC) strategies for three test days showed that the MPC achieved 49.7% daily peak load reduction and 17.6% building energy savings, which were doubled compared to RBC. The MPC optimization problem was solved multiple times using the Ant Colony Optimization (ACO) algorithm with different starting points. Results showed that ACO consistently delivered high-quality optimized control sequences, yielding less than a 1% difference in energy savings between the worst and best solutions across all three test days. Moreover, the computational time for solving the MPC problem and obtaining nearly optimal control sequences for a three-hour prediction horizon was observed to be around 22 min. Notably, reasonably good solutions were attained within 15 min by the ACO algorithm.


Introduction
Building operations account for approximately 28% of global CO 2 emissions, with heating and cooling systems as the two major energy consumers [1].Space heating and hot water systems represent approximately 12% of global energy and process-related CO 2 emissions [2], and space cooling, which is the fastest-growing end-use in buildings, is responsible for a significant amount of final electricity use in buildings [3,4].Hence, improving the efficiency of cooling and heating systems, together with improved building design [5,6], has the potential to significantly mitigate CO 2 emissions in the coming decades [7][8][9].
Nowadays, many buildings benefit from a building management system (BMS), also known as a building automation system (BAS), which is a computer-based control system that monitors and controls services within a building and allows automated control of energy efficiency and occupant comfort [10].The traditional control systems in buildings follow rule-based principles (e.g., on/off, setpoint resets).As such, a pre-defined rule set (e.g., "if-then-else" rules) is applied to buildings to better compute setpoints and/or improve scheduling (e.g., start/stop, pre-cooling schedules).These rule-based controllers are commonly used in buildings due to their simplicity in design and implementation, the clear physical meaning of their rules, and their low computational complexity.Prior studies have proven the energy-saving potential of these controllers.Zhang et al. [11] used Spawn Buildings 2023, 13, 3084 2 of 18 of EnergyPlus [12] to evaluate the energy savings potential of different control sequences based on ASHRAE Guideline 36 (G36).It was found that energy savings of 31% on average could be achieved.Bannister and Zhang [13,14] tested different supply air temperature (SAT) reset strategies and identified the optimized reset temperature setpoints in office buildings in different cities in Australia.In another study [15], a group control strategy was optimized using particle swarm optimization with the goal of maximizing energy savings for a refrigeration plant system.
Overall, the rule-based control strategies are effective [16]; however, they offer only limited energy savings capabilities because they lack prediction and optimization mechanisms to identify energy-optimized solutions [17].Moreover, there is evidence that the use of more flexible optimization-based control strategies can achieve significant savings for some building sub-systems [18,19].MPC controllers utilize predictive models to estimate a building's thermal performance over a finite time horizon.Their primary objective is to optimize the operational cost of the building while maintaining predefined comfort levels.Operating at a supervisory level [20], MPC controllers make high-level decisions to efficiently manage energy consumption, comfort, and various factors throughout the building, thereby optimizing overall building operations.They are able to solve nonlinear and multivariable building control problems with a set of constraints on inputs, states, and/or outputs.According to previous studies, MPCs can offer great energy-saving potential depending on various factors such as the number of control variables, MPC formulation, building model, and climate [21][22][23][24].The potential of MPC to enhance energy efficiency in buildings has been proven in many studies over the last decade [25,26].An MPC application on a university building in Prague showed energy savings of 17-24% [27].In Australia, Huang et al. [28] developed an artificial-neural-network-based MPC controller to identify an optimal start-stop control strategy for an HVAC system.Their results showed that a monthly energy savings of 10% could be achieved.They also developed a hybrid model predictive controller to minimize the cost and energy of running HVAC systems [29].Blum et al. [30] developed an MPC controller using Modelica and MPCPy for an office building in Berkeley, California.Their results showed that MPC could save approximately 40% of HVAC energy use during a two-month time period.
While the energy-saving potential of MPC controllers has been studied in numerous research studies, their commercial application is still very limited due to a number of challenges such as a lack of available IT infrastructure in buildings, high computational time, and uncertainty associated with the state of variables in buildings.These challenges have been discussed in a number of studies [25,[31][32][33][34].To address these challenges, different paradigms have been developed, which are discussed in the next section.

MPC Paradigms
In literature, MPC has been classified into three categories based on how a building model is developed: (1) physics-based models, also known as "white-box" models; (2) data-driven models, also known as "black-box" models; and (3) "gray-box" models.These paradigms have been discussed in [17,[34][35][36][37][38].In the following, the advantages and disadvantages corresponding to each of these modeling approaches are briefly discussed.
White-box modeling approach: in this approach, the building's response model relies on mathematical modeling and physics-based equations.The details of material properties, building components (e.g., walls and windows), and energy (sub) systems (e.g., chillers and pumping systems) are required to develop the model.Building simulation software tools such as TRNSYS or EnergyPlus can be employed to develop white-box models.One advantage of the white-box modeling approach is that a calibrated model with accurate parameters can be highly reliable and produce accurate results over a wide range of operating conditions.Due to explicit correlations between the model's inputs and outputs, the results are easy to interpret and physically meaningful.However, some key challenges exist in this paradigm.Expert knowledge is necessary to develop a model since the number of input parameters is often very large and the details of some parameters may not always be available.In addition, measurement data are required to develop a calibrated model, and yearly energy use may not be sufficient [25].Importantly, employing a white-box model with metaheuristic optimization algorithms may be computationally expensive, which can be particularly problematic, since these algorithms often require running a large number of simulations in an iterative process to identify the optimized decision at each timestep.This extensive computational time is often considered one of the main barriers.However, recent advancements in equation-based building simulation tools can improve computational costs [39].The application of MPC using the white-box modeling approach has been investigated in [40][41][42][43][44][45][46][47].
Black box modeling approach: These models are purely developed based on datadriven methods.In these models, system performance data under different operating conditions are collected, and linear or nonlinear mathematical functions are fitted to the data.Data-driven models can be applicable to buildings for which no prior knowledge of the building's details and/or its (sub) systems is available.Compared to the white-box models, these models can provide computational efficiency improvements.However, a sufficiently large data set covering a broad range of a building's operating conditions is required to train these models and achieve good prediction accuracy.Otherwise, the trained models may be under-or over-fitted, leading to unreliable predictions for operating conditions outside the range covered by the training data points (i.e., poor generalization).In addition, if a change occurs in a system and/or subsystem affecting their performance, the whole data collection and training process may need to be re-done to identify the new dynamics.Further, parameters in the model are not physically meaningful, and therefore the model may not produce easy-to-interpret solutions.However, due to the low computational cost, relatively fast simulation, and availability of BMS systems in many buildings, the application of these models has significantly increased recently in many research studies, and it is expected to grow in the future due to the availability of data and IoT in buildings.Some examples of the black-box modeling approach are given in [28,[48][49][50] in which [48] provides a review of studies applying black-box modeling.
Gray-box modeling approach: These models are essentially a simplified model of a system that is developed using physics-based methods.The resistance-capacitance (RC) network analogy is commonly used to build a simplified physics-based building model.The gray-box model requires a general understanding of the system structure.The unknown parameters of the model (model coefficients) are estimated using measured data and parameter estimation techniques.Parameter identification of RC models can be computationally expensive, and different methods, such as model reduction, are often used to improve the computational cost [20,51].Some examples of studies applying the gray-box modeling approach can be found in [52][53][54][55][56][57][58].Compared to white-box models, this method is computationally more efficient and may offer better generalization capabilities than data-driven models (the latter depends on the number and quality of training data).
A number of studies have been conducted to compare the performance of these modeling approaches in terms of computational cost, complexity, and prediction accuracy [59][60][61][62][63]. Overall, each modeling approach has its own benefits and disadvantages, and their prediction performance may differ in different case studies depending on a variety of factors such as the amount of data for either model calibration or model training, the quality of the data (e.g., time period of measurement data under a wide range of operating conditions), model complexity, simulation tool, and the number of control variables.
All modeling approaches have been widely investigated to explore new techniques in different building types; however, more experimental studies employed black-box and gray-box modeling approaches [21], and fewer experimental studies were conducted with the white-box modeling approach.This is partially attributed to the unavailability of a (calibrated) model and also to the high computational cost during the optimization process using stochastic algorithms.With the advancements in building simulation and BIM tools, building models are readily available, especially for new buildings, or can be easily extracted from building schematics.Nevertheless, the adoption of the white-box modeling approach for building applications faces a significant challenge due to its high computational cost.Importantly, the number of studies focused on the trade-off between computational cost and solution quality is limited.This gap largely results from the fact that most white-box studies have focused on the exploration of various energy-saving strategies.One potential solution to reduce computational costs is the implementation of computationally efficient optimization algorithms.Among these, ACO has demonstrated its efficiency as an optimization algorithm in building energy optimization problems [64,65].However, its application to MPC problems remains uninvestigated.Thus, this research aims to investigate the performance of ACO in MPC applications for buildings.This research contributes to knowledge through a comprehensive analysis of the energy-saving potential, computational cost, and solutions' quality of white-box MPC modeling using EnergyPlus and ACO.It is expected that the results will provide valuable insights for enhancing the practical implementation of white-box MPC in building applications.To this end, an MPC controller for a five-zone office building is designed.The MPC aims to identify the optimized setpoint decisions for supply air temperature (SAT) and chilled water temperature (CWT).These two control variables are given to the simulation model in EnergyPlus to estimate the building's energy consumption.Additionally, in this study, the MPC controller is benchmarked against an RBC and a base case model to better understand the energy saving potential of MPC.
The remainder of this research is organized as follows: Section 2 outlines the methodology, providing details of the MPC framework, including the MPC formulation, ACO algorithm, EnergyPlus-Matlab co-simulation-optimization platform, building model, and two rule-based energy-saving strategies.Section 3 offers a presentation of the MPC results and conducts a comparative analysis against baseline and rule-based scenarios.Finally, Section 4 conclusions are presented, and potential areas for future work are outlined.

Methodology
In this section, the MPC implementation along with two rule-based energy-saving strategies are stated.In addition, the building model, which is considered the case study in this research, is described.

Model Predictive Control
A model predictive controller is developed and applied to the HVAC system.The strength of MPC lies in using a feedback mechanism via optimization of the control over a prediction horizon for each time step.As such, the optimal operation of the HVAC system is periodically updated considering the following: (i) the current and/or previous states of the building; and (ii) the most recent prediction of disturbance (e.g., weather conditions, internal loads).Figure 1 illustrates the main components of the proposed control system.
The Disturbance prediction model aims to predict the potential disturbances (noncontrollable input) from the current time index n with a prediction horizon H.The disturbance sequence is denoted as Dn = dn+k|n |k = 0, . . ., H − 1 , where n represents the current time index and dn+k|n is the predicted disturbance vector at time index k + n given information up to the current time n.
The MPC controller consists of an optimization algorithm [64,66] and the building forecasting energy model.The motivation of this block is to achieve optimized trajectories for the control variables (i.e., Û n = ûn+k|n | k = 0, 1, . . ., H − 1 ) related to the HVAC operation with which the HVAC energy consumption is minimized.The two main inputs to the MPC controller are as follows: (i) the current states of the building, which is denoted as x n , and (ii) the prediction of disturbance variables (i.e., Dn ) As it is shown in the figure, the first element of the predicted optimized control strategy (i.e., u n = ûn|n ) is then implemented in the actual system.A building model is employed to characterize the building's actual energy consumption (i.e., ) for the time interval ,  + 1) given optimized solution  =  | .Note that at this time interval the whole building is influenced by actual disturbance (i.e.,  ).

𝐱
denotes the new state of building after the control input applied.
At each time-step, the candidate inputs-which are SAT and CWT setpoint trajectories in this problem-together with the predictions of the disturbances are given to a building energy forecasting model (EnergyPlus).The simulation is then preformed over a prediction horizon ().It is worth noting that the prediction horizon typically varies in a range of a couple of hours to days in building applications.The optimizer searches for input trajectories that optimize the cost function (e.g., minimization of energy consumption) over a prediction horizon.However, only a subset of the prediction horizon (m first time steps) is often optimized by an optimizer, which is called control horizon ( ), and the rest of the control sequence is kept constant (as shown in Figure 2).Regardless of the length of control horizon ( ≤ ), the first element of the optimized control sequence is implemented.The time index increments to n + 1 and the process is repeated with updated boundary conditions (the prediction horizon is shifted one step).A building model is employed to characterize the building's actual energy consumption (i.e., E n+1 ) for the time interval [n, n + 1) given optimized solution u n = ûn|n .Note that at this time interval the whole building is influenced by actual disturbance (i.e., d n ).x n+1 denotes the new state of building after the control input applied.
At each time-step, the candidate inputs-which are SAT and CWT setpoint trajectories in this problem-together with the predictions of the disturbances are given to a building energy forecasting model (EnergyPlus).The simulation is then preformed over a prediction horizon (H).It is worth noting that the prediction horizon typically varies in a range of a couple of hours to days in building applications.The optimizer searches for input trajectories that optimize the cost function (e.g., minimization of energy consumption) over a prediction horizon.However, only a subset of the prediction horizon (m first time steps) is often optimized by an optimizer, which is called control horizon (H c ), and the rest of the control sequence is kept constant (as shown in Figure 2).Regardless of the length of control horizon (H c ≤ H), the first element of the optimized control sequence is implemented.The time index increments to n + 1 and the process is repeated with updated boundary conditions (the prediction horizon is shifted one step).A building model is employed to characterize the building's actual energy consumption (i.e., ) for the time interval ,  + 1) given optimized solution  =  | .Note that at this time interval the whole building is influenced by actual disturbance (i.e.,  ).

𝐱
denotes the new state of building after the control input applied.
At each time-step, the candidate inputs-which are SAT and CWT setpoint trajectories in this problem-together with the predictions of the disturbances are given to a building energy forecasting model (EnergyPlus).The simulation is then preformed over a prediction horizon ().It is worth noting that the prediction horizon typically varies in a range of a couple of hours to days in building applications.The optimizer searches for input trajectories that optimize the cost function (e.g., minimization of energy consumption) over a prediction horizon.However, only a subset of the prediction horizon (m first time steps) is often optimized by an optimizer, which is called control horizon ( ), and the rest of the control sequence is kept constant (as shown in Figure 2).Regardless of the length of control horizon ( ≤ ), the first element of the optimized control sequence is implemented.The time index increments to n + 1 and the process is repeated with updated boundary conditions (the prediction horizon is shifted one step).

Cost Function and Constraints
In this study, the cost function of the MPC controller is to maintain thermal comfort criteria while minimizing HVAC energy consumption with respect to two control variables: (1) SAT and (2) CWT.The objective function can be written as follows: where E is the energy consumption relevant to HVAC system operation, H is the optimization horizon, E c k is the energy use for space cooling, k is the energy use for space heating (reheating) of the HVAC system, and y k is the outputs.The energy use associated with each term in Equation ( 1) is calculated by EnergyPlus.The notation x k represents the states of the building (e.g., building structure temperatures) at time k.At each time step, the previous thermal states of the building are identified by running the EnergyPlus software with the previous MPC solutions fed to the software.
Notably, y i,k denotes a vector of the predicted output (i.e., room temperatures) in room i at time k, and T and T are the upper and lower bounds of indoor air temperatures, respectively.e and e represent minor deviations, typically within a few decimal points, from the thermostat's temperature setpoints that are commonly tolerated or acceptable in buildings.Z is the set of indices for zones' temperature, which must be kept within a suitable range for the thermal comfort of occupants.Equation (4) allows small violations.In real-world building applications, small fluctuations around the setpoint temperature are generally neglected.To solve the optimization problem and handle Equation (4), a penalty term is introduced into the objective function.Thus, Equation (1) can be formulated as follows: where P k is the penalty term, i = 1, . . ., z denotes the room's number in the building, and M is a penalty factor.Equation ( 6) heavily penalizes the objective function when indoor air temperatures exceed the acceptable indoor temperature range to prevent any temperature violations.It should also be noted that the SAT is constrained by upper and lower bounds ( T sa ∈ [T lsa , T usa ]).This constraint is imposed as a result of a number of factors, such as CWT through the AHU coil, desired indoor thermal conditions, and physical characteristics of AHU coils.Likewise, CWT are limited to T cw ∈ [T lcw , T ucw ], where T lcw and T ucw are lower and upper bounds, respectively.

Ant Colony Optimization
Ant Colony Optimization (ACO) is a metaheuristic algorithm inspired by the behavior of ants [67].ACO is a global and stochastic optimization algorithm that can be employed to solve complex non-linear problems without using derivatives of objective functions.Initially, it was developed to solve discrete optimization problems and later evolved to address continuous variables, leading to the development of Ant Colony Optimization for continuous domains (ACOr).In this study, we employ ACOr to solve the MPC optimization problem (Equation (5).A key characteristic of ACOr is its reliance on a solution archive, where new candidate solutions are generated using a Gaussian kernel probability density function (PDF) and based on the solutions within the archive.These are organized in descending order of quality.During the optimization, the algorithm updates the archive to store promising solutions.Prior studies [65,66] demonstrated the high efficiency of the ACOr algorithm in terms of the quality of final solutions, convergence speed, and consistency for building energy optimization problems.In this study, the version of ACO algorithm employed in [64] is used.

EnergyPlus-Matlab Co-Simulation-Optimization Platform
In this study, MATLAB (R2022a) is used to implement the MPC controller, and an EnergyPlus model is employed to represent the real building response.EnergyPlus is text-based simulation software, that stores all information about a building in a text-based file (.idf).A co-simulation-optimization (EnergyPlus-MATLAB) platform was developed to connect EnergyPlus (E+) and MATLAB to each other.During the optimization process, the potential candidate solutions generated by the optimization algorithm are provided to the co-simulation platform to replace the original data in the EnergyPlus idf file.EnergyPlus evaluates the proposed solutions, and the output data (energy use and indoor air temperatures) are read by the co-simulation platform and sent back to the optimizer.Based on the evaluation of the outputs, the optimizer generates new solutions.This procedure will be repeated until the algorithm convergence criteria are met.
Assumptions: In this research, it is assumed that weather conditions for a short time horizon (three hours ahead) are known [43,68,69].This assumption is made on the basis of the growing application of the Internet of Things (IoT) in buildings and the possibility of acquiring reasonably accurate weather predictions for a few hours ahead [70,71].In addition, different prediction models have been recently developed based on machine learning algorithms and historical weather data, which can be used to provide reasonably accurate short-term weather predictions.
It is also assumed that the occupancy, lighting, and equipment schedules are perfectly known [72] and follow the National Australian Built Environment Rating System (NABERS) recommendations.In reality, however, these schedules may be uncertain and/or unknown [65].Therefore, with these deterministic assumptions, the performance of the MPC would be overestimated.

Case Study: Building Description
The case study in this research is a one-story office building including four perimeter zones and one core zone (Figure 3).The case study in our research is based on a sample case provided in the EnergyPlus example files directory.The building's floor area is 463 m 2 , with four windows on the facade (window-to-wall ratio is approximately 30%).The south and north facades have glass doors.Some modifications have been applied to this case study to better represent the common practices in Australia.The building's internal load schedules for occupancy, lighting, and equipment are based on NABERS recommendations.Conduction transfer functions and the TARP algorithm were employed for heat balance calculations and indoor surface heat transfer convection, respectively.Furthermore, the simulation time step was configured to 4. The HVAC system includes the central plant, which consists of one DOE-2 reciprocating chiller with a COP of 3.67.The performance curves of this electric chiller were taken based on the EnergyPlus data set for chillers (Chillers.idf).The EnergyPlus simulation time step per hour is 4. The primary-secondary chilled water pumping system is modeled for this building, in which the primary chilledwater loop has a constant-speed pump, circulating chilled water at a constant set point of 7.22 • C. The secondary chilled-water loop is served by a variable-speed pump delivering chilled water to the cooling coil in the air handling unit (AHU) using a variable-speed supply fan with an efficiency of 70% and a motor efficiency of 90%.All VAV terminal boxes are assumed to have electric reheat coils.All equipment is auto-sized by EnergyPlus.
The zone thermostat set points for heating and cooling are 21 • C and 24 • C, respectively.The building characteristics, construction details, and HVAC system are presented in Tables 1 and 2.
Buildings 2023, 13, x FOR PEER REVIEW 8 of 18 EnergyPlus.The zone thermostat set points for heating and cooling are 21 °C and 24 °C, respectively.The building characteristics, construction details, and HVAC system are presented in Tables 1 and 2.

Temperature Reset Energy Saving Strategies
Two rule-based control strategies (also known as heuristic control strategies) are applied to this building: (1) supply air temperature (SAT) reset; and (2) chilled water temperature (CWT) reset.These RBCs are feedforward control strategies, meaning that they are not given any detail in response to the building dynamics and are set according to a series of rules ("if condition, then action").RBC strategies are the current control practice in many buildings equipped with BMS systems and have proven to bring energy savings to HVAC systems if their rules are properly selected [11,73,74].In this research, ASHRAE Guideline 36 recommendations and [73] are followed to set RBC strategies.In the first strategy, the SAT is reset based on outdoor dry bulb temperature as follows: if the outside dry bulb air temperature drops below 16 °C, the supply air temperature is set at 18 °C, and if the outside air temperature exceeds 21 °C, the supply air temperature is set at 12.8 °C.When the outside air temperature falls in the range between 16 °C and 21 °C, it changes linearly between 12.8 °C and 18 °C.It is worth noting that the building uses a constant SAT of 12.8 °C in the baseline scenario.Lowering supply air temperatures reduces fan and/or pump energy use since a lower air flow rate is required to maintain the thermal

Temperature Reset Energy Saving Strategies
Two rule-based control strategies (also known as heuristic control strategies) are applied to this building: (1) supply air temperature (SAT) reset; and (2) chilled water temperature (CWT) reset.These RBCs are feedforward control strategies, meaning that they are not given any detail in response to the building dynamics and are set according to a series of rules ("if condition, then action").RBC strategies are the current control practice in many buildings equipped with BMS systems and have proven to bring energy savings to HVAC systems if their rules are properly selected [11,73,74].In this research, ASHRAE Guideline 36 recommendations and [73] are followed to set RBC strategies.In the first strategy, the SAT is reset based on outdoor dry bulb temperature as follows: if the outside dry bulb air temperature drops below 16 • C, the supply air temperature is set at 18 • C, and if the outside air temperature exceeds 21 • C, the supply air temperature is set at 12.8 • C. When the outside air temperature falls in the range between 16 • C and 21 • C, it changes linearly between 12.8 • C and 18 • C. It is worth noting that the building uses a constant SAT of 12.8 • C in the baseline scenario.Lowering supply air temperatures reduces fan and/or pump energy use since a lower air flow rate is required to maintain the thermal comfort level in buildings.However, it increases chiller energy use and the likelihood that reheating is required in some zones.It also reduces the operating hours of the economizer, especially in mild climates.On the other hand, higher supply air temperatures lead to higher fan and/or pump energy use but less chiller energy use.If humidity is a concern, the upper limit of SAT should be selected with caution.
The second energy-saving strategy is to reset the CWT based on the outside dry bulb air temperature.Higher chilled-water temperature setpoints save chiller energy but increase pump energy use since a higher amount of chilled water must be delivered to satisfy the same cooling coil loads.Fan energy use may also increase since more air flow rate must be blown over the warmer cooling coil in the AHU to meet the same cooling loads.In this research, if the dry bulb temperature of outside air is greater than 26.5 • C, the chilled water temperature is set at 7.0 • C, and if the dry bulb temperature of outside air is less than 15.5 • C, the chilled water temperature is set at 10 • C. When the temperature of the outside air falls between these two temperatures (i.e., 15.5 • C and 26.5 • C), the chilled water temperature changes linearly between 7.0 • C and 10 • C. Both SAT and CWT reset strategies have been displayed in Figure 4.In the baseline scenario, the building uses a constant chilled water temperature of 7.2 • C. The advantage of SAT and CWT reset strategies based on the outdoor air conditions is that they are rather easy to implement, and only one sensor is required to determine what SAT and CWT set points should be applied to the system.
Buildings 2023, 13, x FOR PEER REVIEW 9 of 18 comfort level in buildings.However, it increases chiller energy use and the likelihood that reheating is required in some zones.It also reduces the operating hours of the economizer, especially in mild climates.On the other hand, higher supply air temperatures lead to higher fan and/or pump energy use but less chiller energy use.If humidity is a concern, the upper limit of SAT should be selected with caution.
The second energy-saving strategy is to reset the CWT based on the outside dry bulb air temperature.Higher chilled-water temperature setpoints save chiller energy but increase pump energy use since a higher amount of chilled water must be delivered to satisfy the same cooling coil loads.Fan energy use may also increase since more air flow rate must be blown over the warmer cooling coil in the AHU to meet the same cooling loads.In this research, if the dry bulb temperature of outside air is greater than 26.5 °C, the chilled water temperature is set at 7.0 °C, and if the dry bulb temperature of outside air is less than 15.5 °C, the chilled water temperature is set at 10 °C.When the temperature of the outside air falls between these two temperatures (i.e., 15.5 °C and 26.5 °C), the chilled water temperature changes linearly between 7.0 °C and 10 °C.Both SAT and CWT reset strategies have been displayed in Figure 4.In the baseline scenario, the building uses a constant chilled water temperature of 7.2 °C.The advantage of SAT and CWT reset strategies based on the outdoor air conditions is that they are rather easy to implement, and only one sensor is required to determine what SAT and CWT set points should be applied to the system.

Results
The MPC controller is implemented in a small office building shown in Figure 3 to identify the optimized SAT and CWT setpoint trajectories for three days: Day 1 is the 17th of October, with mild weather and a maximum outdoor temperature of 26.6 °C; Day 2 is the 11th of January, with a warm day and a maximum outdoor temperature of 30.4 °C; and Day 3 is the 18th of October, with a hot day and a maximum temperature of 36.4 °C.These three days were selected from a typical weather file (IWEC) for the city of Sydney from the EnergyPlus website.In the implementation of MPC, the control horizon is considered to be three hours, which is equal to the prediction horizon [75].The choice of the three-hour prediction horizon is based on consideration of thermal mass.According to [35], the majority of MPC studies in the context of building applications have selected a prediction horizon ranging from 1 h to one day ahead, with a higher preference for a oneday horizon among these studies.For buildings with high thermal mass, a longer prediction horizon is beneficial since it allows the MPC controller to plan control actions that take advantage of the building's thermal inertia [17,72].On the other hand, buildings with low thermal mass tend to respond quicker to changes in external factors, and long prediction horizons may not necessarily offer a better control strategy, and lead to an increase in computational costs.Thus, in this study, a 3 h prediction horizon is selected since the case study is a small office building with a low thermal mass.At each time step (one hour), the thermal history of the building is defined by running the EnergyPlus building model over

Results
The MPC controller is implemented in a small office building shown in Figure 3 to identify the optimized SAT and CWT setpoint trajectories for three days: Day 1 is the 17th of October, with mild weather and a maximum outdoor temperature of 26.6 • C; Day 2 is the 11th of January, with a warm day and a maximum outdoor temperature of 30.4 • C; and Day 3 is the 18th of October, with a hot day and a maximum temperature of 36.4 • C.These three days were selected from a typical weather file (IWEC) for the city of Sydney from the EnergyPlus website.In the implementation of MPC, the control horizon is considered to be three hours, which is equal to the prediction horizon [75].The choice of the threehour prediction horizon is based on consideration of thermal mass.According to [35], the majority of MPC studies in the context of building applications have selected a prediction horizon ranging from 1 h to one day ahead, with a higher preference for a one-day horizon among these studies.For buildings with high thermal mass, a longer prediction horizon is beneficial since it allows the MPC controller to plan control actions that take advantage of the building's thermal inertia [17,72].On the other hand, buildings with low thermal mass tend to respond quicker to changes in external factors, and long prediction horizons may not necessarily offer a better control strategy, and lead to an increase in computational costs.Thus, in this study, a 3 h prediction horizon is selected since the case study is a small office building with a low thermal mass.At each time step (one hour), the thermal history of the building is defined by running the EnergyPlus building model over past weather data and internal loads with the previous MPC solutions fed to the software.The energy saving potential of MPC is compared against two benchmarks: (1) a base case scenario with SAT and CWT setpoints of 12.8 • C and 7.2 • C, respectively, and (2) an RBC scenario with two temperature reset strategies applied to SAT and CWT setpoints to improve HVAC operation (as stated in the previous section).It should be noted that while the MPC objective function aims to minimize only energy use, the impact of the MPC solutions on peak loads has been investigated as well.

Energy Analysis
Table 3 reports energy savings and peak load reductions achieved through the employment of MPC (with perfect knowledge of future disturbances) and RBC strategies each day.In Day 1, RBC reduces HVAC energy consumption by 8.9% and HVAC peak load by 34.2%, as shown.However, it fails to provide any energy savings in Day 2 and Day 3. The reason is that the outdoor air temperature is very high on these two days.That leads RBC to set the SAT and CWT setpoints to their lower bounds, which are very close to the setpoints in the base case scenario.With regards to MPC, both energy savings and peak load reductions are comparatively higher than RBC in Day 1, reaching up to 17.6% and 49.7%, respectively.Unlike RBC, the MPC solutions result in 7.6% and 3.7% energy savings, and 18.3 % and 2% peak load reductions in Day 2 and Day 3, respectively.In addition to that, the simulation was run for an entire year in order to further explore the potential of SAT and CWT reset strategies.Despite the poor performance of RBC for the second and third test days, implementation of RBC offers approximately a 24% HVAC energy reduction annually.5 shows the HVAC peak load for MPC, RBC, and the base case, and Figure 6 shows the cumulative energy savings for RBC and MPC strategies against the base case controller.As shown, the peak load for the first and second days happens earlier in the morning, whereas the peak for the third day occurs in the afternoon due to the high outdoor ambient temperature.The results show that the HVAC peak load for the base case in the first two days reaches 6.1 kW and 4.9 kW, respectively.This is attributed to the higher heating demands of west-facing zones, which are supplied through reheat coils in the morning.In contrast, the HVAC peak load occurs in the afternoon in the third day due to very high cooling demand.The cumulative energy savings for RBC and MPC compared to the base case are shown in Figure 6.The positive slope shows building energy systems consume less energy for the corresponding control strategy compared to the base case strategy, whereas the negative slope shows the base case strategy performs better.In the first two days, although both RBC and MPC perform better in terms of energy savings compared to the base case in the early part of the day, RBC shows poor performance in terms of energy consumption during these days.In contrast, MPC exceeds the RBC in energy savings through better performance during the day on all these days.It can also be observed from Figure 6 that the cumulative energy savings in the case of RBC fall slightly below the zero line in Day 2 and Day 3. On the other hand, MPC performs well on these days, with the continued positive slope indicating energy savings.
Figure 7 shows the MPC solutions between the working hours of 8:00 a.m. and 6:00 p.m. for the test days.These solutions include the optimized sequences for SAT and CWT setpoints, which are shown in red and green, respectively.The outdoor air temperature is also plotted in yellow in these figures.In the early mornings, MPC chooses a higher supply air temperature to reduce the energy required for reheating supply air.On the other hand, as outdoor temperatures rise, it chooses to lower supply air temperatures later in the day.Regarding CWT setpoints, in almost all instances, the optimized setpoint values found by MPC are higher than the baseline setpoint, which is 7.2 °C.It is worth noting that the MPC problem was solved ten times with different starting points during the optimization phase, and the other solutions found are plotted in light gray for SAT and in light blue for CWT.These results are discussed in the optimality section in the paper.With both MPC and RBC, the peak load is considerably reduced in Day 1.The reduction is more prominent in MPC.As can be observed in the case of RBC, the energy savings are mainly achieved through a reduction in reheat energy on the first day, and the base case and RBC graphs overlap with each other for the rest of the day.Importantly, RBC fails to make any improvement in the HVAC energy performance in Day 2 and Day 3 since temperature setpoints are set similar to the base case due to the high outdoor air temperatures.On the contrary, the proposed MPC strategies lead to a reduction in both peak load and energy use on the second and third test days.In the second day, MPC solutions resulted in an 18.3% peak load reduction.This is mainly achieved through the reduction in reheat energy in the morning.However, the peak load reduction is relatively low (only 2% on the third test day).Inclusion of other control variables, such as indoor temperature setpoints, in the MPC problem can reduce peak load on hot days (peak shifting).
The cumulative energy savings for RBC and MPC compared to the base case are shown in Figure 6.The positive slope shows building energy systems consume less energy for the corresponding control strategy compared to the base case strategy, whereas the negative slope shows the base case strategy performs better.In the first two days, although both RBC and MPC perform better in terms of energy savings compared to the base case in the early part of the day, RBC shows poor performance in terms of energy consumption during these days.In contrast, MPC exceeds the RBC in energy savings through better performance during the day on all these days.It can also be observed from Figure 6 that the cumulative energy savings in the case of RBC fall slightly below the zero line in Day 2 and Day 3. On the other hand, MPC performs well on these days, with the continued positive slope indicating energy savings.
Figure 7 shows the MPC solutions between the working hours of 8:00 a.m. and 6:00 p.m. for the test days.These solutions include the optimized sequences for SAT and CWT setpoints, which are shown in red and green, respectively.The outdoor air temperature is also plotted in yellow in these figures.In the early mornings, MPC chooses a higher supply air temperature to reduce the energy required for reheating supply air.On the other hand, as outdoor temperatures rise, it chooses to lower supply air temperatures later in the day.Regarding CWT setpoints, in almost all instances, the optimized setpoint values found by MPC are higher than the baseline setpoint, which is 7.2 • C. It is worth noting that the MPC problem was solved ten times with different starting points during the optimization phase, and the other solutions found are plotted in light gray for SAT and in light blue for CWT.These results are discussed in the optimality section in the paper.

Indoor Temperature Conditions
Table 4 shows the average indoor air temperature for all three control strategies.The indoor temperatures are reasonably maintained within the acceptable range defined by the thermostat, except for the early mornings of Day 1 and Day 2, in which a short time period is required for the HVAC system to bring the indoor air temperature up to the desired temperature.In addition, the average indoor air temperature is slightly higher (with a maximum of 0.3 °C higher temperature) in the early afternoon on day 3 under MPC strategies compared to RBC and the base case.

Indoor Temperature Conditions
Table 4 shows the average indoor air temperature for all three control strategies.The indoor temperatures are reasonably maintained within the acceptable range defined by the thermostat, except for the early mornings of Day 1 and Day 2, in which a short time period is required for the HVAC system to bring the indoor air temperature up to the desired temperature.In addition, the average indoor air temperature is slightly higher (with a maximum of 0.3 • C higher temperature) in the early afternoon on day 3 under MPC strategies compared to RBC and the base case.

Optimality of Solutions
Building and HVAC optimization problems are generally nonlinear and multimodal.Importantly, if building simulation tools such as EnergyPlus are employed to calculate the objective function, the optimization problem may have large discontinuities [66,76], all of which together make it difficult to use gradient-based optimization algorithms.In this research, the ACO optimization algorithm is employed in MPC to find the optimal setpoint trajectories of SAT and CWT.However, one of the main drawbacks of stochastic optimization algorithms is that they are neither able to guarantee finding a global minimum nor the optimality of final solutions in non-convex and nonlinear optimization problems.These algorithms can become trapped in local minima and may lead to poor suboptimal solutions.This, however, depends on the nonlinearity degree of the objective function, which can increase with search space dimensionality.Some techniques, such as running optimization problems with different initial starting points, as used in this research, can increase the chance of finding high-quality solutions that are reasonably close to the global optimum.This technique, however, is a major issue in the white-box modeling approach since the computational time of one optimization run per se is very high, and running optimization several times makes the computational time extremely high.It should be noted that black-box models are multimodal as well.However, this is not an issue due to the fast simulation capability of these models.To provide more insights into optimization algorithm performance, the MPC problem was run ten times for each prediction horizon with different starting points.
As shown in Figure 7a-c, the ACO algorithm found nearly similar solutions in most runs.In some cases, however, ACO converged to different local minima that were significantly different from the best solution found.In these figures, the best optimized solutions for SAT and CWT out of ten runs are shown with red and blue colors, and the remaining solutions are represented with light gray and blue colors.To assess the influence of the optimization algorithm on MPC's performance, Figure 7d compares the energy savings achieved by the worst and best solutions discovered through ACO.The narrow error bars depict the energy savings of these best and worst solutions.Notably, the difference in energy savings is consistently less than 1% across all three days.This indicates that the ACO algorithm consistently produces solutions that result in very similar levels of energy savings, meaning that the algorithm has the potential to serve as a relatively stable and reliable algorithm in terms of achieving high-quality optimized control sequences for MPC, particularly in the context of energy optimization in building systems.

Convergence Speed
Figure 8 illustrates the convergence trend and diversity of the normalized objective function values found by ACO based on ten different runs.This figure is indicative of the optimization convergence trend, taken as an example from day 2 at 11 a.m.For each iteration, the minimum, 25 percentile, median, 75 percentile, and maximum normalized objective function values are indicated in the box plots.The normalization was performed based on the energy use of the base case and the optimized solution.As illustrated, ACO was reasonably converged after 120 iterations (650 building simulations), and after approximately 80 iterations, an improvement of more than 90% can be achieved.The latter is important in the white-box modeling approach since computational time is a concern.The increased number of iterations and finding higher-quality solutions are only justified if significant energy savings are achieved.Table 5 summarizes the technical specifications of the system used to solve the MPC problem, along with the time taken by the MPC controller to identify an optimized control sequence based on a three-hour prediction horizon.As shown, it takes approximately 22 min on average for MPC to find a nearly optimized control sequence for the three hours ahead.However, as stated earlier, only the first element of the control sequence is applied to the HVAC system.Upon analyzing the optimization algorithm's convergence trend, it can be observed that, after approximately 15 min, the MPC algorithm yields optimized control sequences that are within an approx-imate 10% margin of the best solutions obtained.Furthermore, as illustrated, the MPC algorithm reaches a point where it produces optimized control sequences within roughly 20% of the best solutions after approximately 11 min.While shorter computational times are generally preferred in MPC applications for buildings, practical implementation of the proposed MPC strategy using ACO remains viable and can yield significant energy savings.From a practical perspective, one effective approach is to commence the optimization process ahead of the control time step, particularly in cases where reasonably accurate predictions of both the building's dynamic model and disturbances are accessible.This practice allows for the preparation of optimized control sequences in advance, enhancing the overall efficiency of the MPC strategy.
are generally preferred in MPC applications for buildings, practical implementation of the proposed MPC strategy using ACO remains viable and can yield significant energy savings.From a practical perspective, one effective approach is to commence the optimization process ahead of the control time step, particularly in cases where reasonably accurate predictions of both the building's dynamic model and disturbances are accessible.This practice allows for the preparation of optimized control sequences in advance, enhancing the overall efficiency of the MPC strategy.
Despite the benefits of using EnergyPlus software for white-box modeling, the high computational time is a major barrier to implementing the MPC controller in practice, especially for large, complex buildings.However, understanding the (i) energy-saving potential of MPC, (ii) quality of suboptimal optimized solutions, and (iii) optimization convergence trend can play a role in the implementation of MPC more efficiently.Tuning the white-box modeling approach to these factors, which aim to find high-quality local optima, along with some strategies, including search storing solutions under similar operating conditions to further reduce computational costs, can facilitate real-world applications of MPC using detailed building energy simulation for buildings.the first hour is only applied to the system).b Time required on average to identify a solution with significant improvement (i.e., 90%).

Conclusions
In this study, a model predictive control was developed to identify the optimal setpoint trajectories of SAT and CWT to minimize energy use in a simulated office building.Ener-gyPlus and MATLAB were used to develop an MPC algorithm.The MPC's performance Despite the benefits of using EnergyPlus software for white-box modeling, the high computational time is a major barrier to implementing the MPC controller in practice, especially for large, complex buildings.However, understanding the (i) energy-saving potential of MPC, (ii) quality of suboptimal optimized solutions, and (iii) optimization convergence trend can play a role in the implementation of MPC more efficiently.Tuning the white-box modeling approach to these factors, which aim to find high-quality local optima, along with some strategies, including search storing solutions under similar operating conditions to further reduce computational costs, can facilitate real-world applications of MPC using detailed building energy simulation for buildings.

Conclusions
In this study, a model predictive control was developed to identify the optimal setpoint trajectories of SAT and CWT to minimize energy use in a simulated office building.EnergyPlus and MATLAB were used to develop an MPC algorithm.The MPC's performance was assessed based on energy savings, solution optimality, and computational costs.
Comparing the energy-saving potential of MPC with two control scenarios-baseline and RBC-across three days representing mild, warm, and hot weather, MPC achieved energy savings of up to 17.6%, nearly double that of RBC (8.9%).Furthermore, MPC reduced daily peak loads by up to 49.7%, surpassing RBC's peak load reduction by 15.5%.
The ACO algorithm was used in MPC optimization, performing ten runs with varied starting points for each day.The energy savings comparison between the worst and best solutions consistently remained below 1% across three days.This suggests ACO's potential for generating high-quality solutions for MPC problems in buildings.In terms of computational costs, it takes approximately 22 min (to run 650 building simulations) on average for ACO to find a nearly optimized control sequence.It is worth noting that the proposed MPC algorithm has the potential to produce reasonably good solutions (within 10% of the best solutions) after 15 min.Although shorter computational times are typically desirable in MPC applications for buildings, it is important to highlight that the practical implementation of the proposed MPC strategy using ACO remains feasible and can lead to substantial energy savings.
HVAC systems are significant energy consumers in buildings.Advancements in IoTs and information and communication technologies have enabled the implementation of advanced control strategies, including MPC, for HVAC systems.This enhances the energy efficiency of buildings and paves the way to achieve net-zero buildings.Understanding the energy-saving potential of MPC, the quality of solutions, and the optimization convergence trend allows for a more efficient implementation of MPC using a detailed building model.The implementation of the white-box approach is relatively straightforward.Tuning it with consideration of these factors can reduce computational costs and facilitate real-world applications of MPC using detailed building simulation for buildings.In this research, we assumed perfect knowledge of disturbances and internal loads, representing an ideal scenario where the proposed MPC controller can achieve its maximum efficiency.However, in real-world applications, these factors are often uncertain.Therefore, future research directions should encompass imperfect predictions of these assumptions and assess the sensitivity of MPC to these predictions.Importantly, the tuning of MPC parameters, such as the prediction horizon and control horizon, directly affects the performance, stability, and computational costs of MPC.Future research should also concentrate on refining and optimizing these MPC tuning parameters.

Figure 1 .
Figure 1.Structure of the MPC controller.

Figure 2 .
Figure 2. Control horizon and prediction horizon in MPC.

Figure 1 .
Figure 1.Structure of the MPC controller.

Figure 2 .
Figure 2. Control horizon and prediction horizon in MPC.Figure 2. Control horizon and prediction horizon in MPC.

Figure 2 .
Figure 2. Control horizon and prediction horizon in MPC.Figure 2. Control horizon and prediction horizon in MPC.

Figure 4 .
Figure 4. Temperature reset strategies for supply air temperature and chilled water temperature.

Figure 4 .
Figure 4. Temperature reset strategies for supply air temperature and chilled water temperature.

Buildings 2023 , 18 Figure 5 .
Figure 5. HVAC energy use for three days using MPC (black line), RBC (red dash line), and base case (black dash line).Figure 5. HVAC energy use for three days using MPC (black line), RBC (red dash line), and base case (black dash line).

Figure 5 .
Figure 5. HVAC energy use for three days using MPC (black line), RBC (red dash line), and base case (black dash line).Figure 5. HVAC energy use for three days using MPC (black line), RBC (red dash line), and base case (black dash line).

Figure 5 .
Figure 5. HVAC energy use for three days using MPC (black line), RBC (red dash line), and base case (black dash line).

Figure 6 .
Figure 6.Cumulative energy savings of RBC (red dash line) and MPC (black line) compared to the base case.

Figure 6 .
Figure 6.Cumulative energy savings of RBC (red dash line) and MPC (black line) compared to the base case.

Figure 7 .
Figure 7. SAT and CWT setpoints identified by MPC for (a) Day 1, (b) Day 2, and (c) Day 3. (d) shows energy savings associated with each day (small error bars represent the energy savings of the best and worst solutions).

Figure 7 .
Figure 7. SAT and CWT setpoints identified by MPC for (a) Day 1, (b) Day 2, and (c) Day 3. (d) shows energy savings associated with each day (small error bars represent the energy savings of the best and worst solutions).

Figure 8 .Table 5 .a
Figure 8. Convergence trend of the optimization algorithm.Table 5. Technical specification of the system used to solve the MPC problem.Operating System Windows 11 (Pro) Processor 12th Generation Intel(R) Core i7-1260P (18 MB Cache, up to 4.7 GHz) Memory 16 GB (2 × 8 GB) Computational time 22 a min 15 b min a Time required on average to identify a control solution based on a three-hour time horizon (note:the first hour is only applied to the system).b Time required on average to identify a solution with significant improvement (i.e., 90%).

Table 1 .
Building construction details.

Table 2 .
Building geometry details and assumptions used for simulation.

Table 1 .
Building construction details.

Table 2 .
Building geometry details and assumptions used for simulation.

Table 3 .
MPC and RBC compared to base-case benchmark.
Figures 5 and 6 compare the performance of different control strategies for test days.Figure

Table 4 .
Indoor average air temperature under Base Case (BC), RBC, and MPC.