LSTM-Based Model Predictive Control for Optimal Temperature Set-Point Planning

The growing interest in saving building energy has increasingly motivated studies on model predictive control (MPC), where system operation proceeds according to a planned operation strategy. Data-driven models that perform learning using past operation data of buildings are favorable for MPC applications owing to their fast computation speed. However, it is difficult to apply MPC to buildings with insufficient operation data, as the prediction accuracy varies depending on the data used for learning. To address this, we propose a method that involves generating data through a detailed building energy model and utilizing a long short-term memory (LSTM) network that performs learning using the data as an MPC model. The model was verified through a comparison with the reference model using the same optimization algorithm. In the MPC of the objective function, which is to reduce electrical energy expenditure by optimizing the indoor temperature of the target building, approximately 35% grid energy consumption was reduced compared to a reference case, by increasing self-consumption of photovoltaic (PV) energy and avoiding PV curtailment. Further, the required computation time was reduced to approximately 30%, even including the data generation time for daily learning, thereby confirming the feasibility of the MPC model that employs LSTM.


Introduction
A considerable proportion of building energy is used for heating, ventilating, and air conditioning (HVAC) operations. Hence, the energy consumption of a building can be reduced through the optimal control of its heat source and HVAC systems [1,2]. In particular, the number of studies on model predictive control (MPC), in which system operation is performed according to a strategy planned in advance through building and system models, has been continuously increasing to improve building energy saving and the efficient operation of facility systems. Studies performing simulations [3][4][5] and various empirical studies for actual buildings have been conducted [6][7][8]. According to previous studies, the MPC method demonstrated the possibility of saving 15-30% energy, depending on various factors related to the thermal performance and renewable energy of buildings. The Automatic Control Laboratory in Zurich, Switzerland, likewise reported energy saving at a similar level through the OptiControl project, in which large-scale MPC research was conducted for two years [9]. The application of MPC to building control has a large potential for energy saving. The most important element that determines the performance of MPC is the prediction accuracy of the building model [10][11][12]. Detailed energy analysis software programs, such as EnergyPlus, TRNSYS, and ESP-r, can be used for building modeling. According to Privara et al. [13], however, it is difficult to directly use these methods for control, because they involve complicated models, a long computation time, and non-explicit expressions of parameters in many cases. Hoes et al. [14] also mentioned that the use of advanced control algorithms has limitations, because detailed analysis programs do not allow external access to all parameters for control. Studies were also conducted to directly apply control algorithms to detailed analysis programs [15][16][17]; however, the

Simulation Model
In this study, the SingleFamilyHouse-TwoSpeed-ZoneAirBalance.idf house example provided by EnergyPlus was used as the target building (reference). It represents a typical residential building and has been used several times in studies related to optimal building Sustainability 2021, 13, 894 3 of 14 control [31,32]. In this work, performance evaluation for a proposed method is achieved by means of simulation models, which are generally easier to predict the physical behavior than a real building case. However, the selection is done by the fact that the focus of the work is not to evaluate real performance values but to compare the methods under the same conditions.
The target building is a detached house with a floor area of 186 m 2 . It has living area, a garage, and an attic, and only the living area is subject to air conditioning. The factors related to heating are lighting devices (1000 W) and home appliances (500 W). There are three residents, and their occupancy varies depending on their schedules. The cooling temperature was set to 24 • C. Figure 1 shows the detailed building operating conditions and energy consumption according to the schedules. As for the weather data, the EnergyPlus weather (epw) data for the Incheon area provided by EnergyPlus were used. The latitude and longitude (37.4 • and 126.6 • ) of the Incheon area were also used for building location information.

Simulation Model
In this study, the SingleFamilyHouse-TwoSpeed-ZoneAirBalance.idf house example provided by EnergyPlus was used as the target building (reference). It represents a typical residential building and has been used several times in studies related to optimal building control [31,32]. In this work, performance evaluation for a proposed method is achieved by means of simulation models, which are generally easier to predict the physical behavior than a real building case. However, the selection is done by the fact that the focus of the work is not to evaluate real performance values but to compare the methods under the same conditions.
The target building is a detached house with a floor area of 186 m 2 . It has living area, a garage, and an attic, and only the living area is subject to air conditioning. The factors related to heating are lighting devices (1000 W) and home appliances (500 W). There are three residents, and their occupancy varies depending on their schedules. The cooling temperature was set to 24 °C. Figure 1 shows the detailed building operating conditions and energy consumption according to the schedules. As for the weather data, the Ener-gyPlus weather (epw) data for the Incheon area provided by EnergyPlus were used. The latitude and longitude (37.4° and 126.6°) of the Incheon area were also used for building location information. Further, the Generator_PVWatts.idf photovoltaic (PV) example model of EnergyPlus was applied for simulation of renewable energy. It is a model developed by the National Renewable Energy Laboratory (NREL) to calculate the energy production of a PV system connected to the grid based on simple input data. The example includes one 4 kW-class PV module (PV-1) and two 3 kW-class modules (PV-2 and PV-3). The weather data for the Incheon area were also used as with the building energy model. For the tilt angle of each PV module, the initial values designated by NREL were applied. The tilt angle was set to 20° for PV-1. In the case of PV-2 and PV-3, the tilt angle was set to 37° for the Incheon area, as it follows the latitude of the analysis area. Table 1 summarizes the parameters of the PV models. More detailed performance and relations of the PV modules can be found in the references provided by NREL [33]. Figure 2 shows a schematic of the systems in the target building, including the PV modules. Further, the Generator_PVWatts.idf photovoltaic (PV) example model of EnergyPlus was applied for simulation of renewable energy. It is a model developed by the National Renewable Energy Laboratory (NREL) to calculate the energy production of a PV system connected to the grid based on simple input data. The example includes one 4 kW-class PV module (PV-1) and two 3 kW-class modules (PV-2 and PV-3). The weather data for the Incheon area were also used as with the building energy model. For the tilt angle of each PV module, the initial values designated by NREL were applied. The tilt angle was set to 20 • for PV-1. In the case of PV-2 and PV-3, the tilt angle was set to 37 • for the Incheon area, as it follows the latitude of the analysis area. Table 1 summarizes the parameters of the PV models. More detailed performance and relations of the PV modules can be found in the references provided by NREL [33]. Figure 2 shows a schematic of the systems in the target building, including the PV modules.

LSTM Network
There are various deep learning models depending on the neural network structure for learning. Among them, long short-term memory (LSTM) models based on recurrent neural networks are known to be favorable for learning data with time-series characteristics or sequences [34,35]. In the building sector, various studies have also used the LSTM structure as a building load prediction model considering the time-series characteristics, in which the load occurrence pattern of the previous time affects that of the following time. The LSTM network consists of an input layer, multiple hidden layers, and an output layer. Its main characteristics lie in the memory cells of the hidden layers, and data are learned by maintaining or adjusting the status of the memory cells. A detailed description of the LSTM network can be found in previous studies [36][37][38]. The proposed LSTM model was constructed using the deep learning toolbox provided by MATLAB. For the LSTM structure, learning parameters that determine learning performance must be designated, and they are summarized in Table 2. The set values of the parameters were determined based on the values recommended by MATLAB and previous studies [39,40].

Data-Driven LSTM Model
In this study, a situation in which the measured building operation data were not sufficient was assumed, and data to be used for learning were generated by simulating the EnergyPlus reference building introduced above. As for the data acquisition process, 240 (24 h × 10) set-point temperatures for 10 days were randomly generated through the Randi function, which generates random numbers through MATLAB. Here, random numbers were generated only within the ±1.5 °C range at 24 °C, which is the reference cooling set-point temperature of the reference building model. The set-point temperature data generated from MATLAB were received by EnergyPlus. After performing an energy simulation for 10 days, the simulation results were transmitted back to MATLAB. This

LSTM Network
There are various deep learning models depending on the neural network structure for learning. Among them, long short-term memory (LSTM) models based on recurrent neural networks are known to be favorable for learning data with time-series characteristics or sequences [34,35]. In the building sector, various studies have also used the LSTM structure as a building load prediction model considering the time-series characteristics, in which the load occurrence pattern of the previous time affects that of the following time. The LSTM network consists of an input layer, multiple hidden layers, and an output layer. Its main characteristics lie in the memory cells of the hidden layers, and data are learned by maintaining or adjusting the status of the memory cells. A detailed description of the LSTM network can be found in previous studies [36][37][38]. The proposed LSTM model was constructed using the deep learning toolbox provided by MATLAB. For the LSTM structure, learning parameters that determine learning performance must be designated, and they are summarized in Table 2. The set values of the parameters were determined based on the values recommended by MATLAB and previous studies [39,40].

Data-Driven LSTM Model
In this study, a situation in which the measured building operation data were not sufficient was assumed, and data to be used for learning were generated by simulating the EnergyPlus reference building introduced above. As for the data acquisition process, 240 (24 h × 10) set-point temperatures for 10 days were randomly generated through the Randi function, which generates random numbers through MATLAB. Here, random numbers were generated only within the ±1.5 • C range at 24 • C, which is the reference cooling set-point temperature of the reference building model. The set-point temperature data generated from MATLAB were received by EnergyPlus. After performing an energy simulation for 10 days, the simulation results were transmitted back to MATLAB. This process was repeated for 500 s based on the simulation time of MATLAB. Here, the time utilized for data collection and the energy simulation period could be extended to more than 10 days, because it is expected that the performance of the deep learning model can be improved as the number of datasets to be used for learning increases. Considering the MPC characteristics, which require that the operation plan for the following day is established rapidly, excessive simulation conditions for data collection were not set. The cosimulation toolbox provided by MATLAB was used for data communication between MATLAB and EnergyPlus. EnergyPlus transmitted and received data through an external interface. Detailed data communication through the external interface can be found in the materials provided by EnergyPlus [41]. Finally, the collected data were used as the input and target data of the LSTM model, as summarized in Table 3. The input data of the model included weather data, such as solar irradiance, the outdoor temperature, humidity, set-point temperature, and time of day (1-24 h). The output data were the energy consumption of the cooling coil.

MPC Simulation
Our MPC determines the optimal set-point temperature operation plan for a day that can minimize the grid electricity consumption considering the PV production on the following day, as shown in Equation (1).
Here, the grid electricity (E grid ) refers to the electricity consumption obtained by subtracting the PV production (E PV ) from the building electricity consumption (E consumption ) that occurs at a specific time. If E PV is larger than E consumption , E PV is regarded as the unused energy. The simulated building case does not consider the energy storage system (ESS) for surplus PV production as following a typical family house case. Thus, the reduction effect of the surplus PV energy is indirectly included in the objective function.
The proposed data-based model was applied for the MPC. An attempt was made to compare it with the detailed analysis program model, which is the reference model. In this study, an optimization algorithm was applied to the two developed building energy models, and the optimization results and simulation time were comprehensively analyzed.
The particle swarm optimization (PSO) algorithm was employed for the optimization algorithm. The PSO algorithm, an algorithm for finding the optimal solution based on the social behavior in a cluster, was first proposed by Eberhart and Kennedy [42]. According to Zhang et al. [43], PSO is one of the most commonly used optimization algorithms. It has been widely applied in numerous areas, owing to its simple algorithm and short computation time [44,45]. In this study, the PSO algorithm with relatively fast computation time was employed, considering the characteristics of MPC in which the operation strategy for the following day must be rapidly established. The swarm size, a main set value that determines the performance of PSO, was set to 2400. For the other set values of PSO, the values recommended by previous studies and MATLAB were applied.
It was also assumed that the PV usage and weather were perfectly predicted from previous studies [46,47]. In ASHRAE standard 55, the range of set temperatures for comfort is specified as 22.2 to 25.5 • C [48], and following this standard, the bounds of temperatures for applying PSO are set from 22.5 to 25.5 • C. Figure 3 shows the PSO process of the proposed two building models and the comparison process through simulation.
It was also assumed that the PV usage and weather were perfectly predicted from previous studies [46,47]. In ASHRAE standard 55, the range of set temperatures for comfort is specified as 22.2 to 25.5 °C [48], and following this standard, the bounds of temperatures for applying PSO are set from 22.5 to 25.5 °C. Figure 3 shows the PSO process of the proposed two building models and the comparison process through simulation. The simulation was performed for six days from 6 August to 11 August during the cooling period. The errors were analyzed using RMSE and CVRMSE, which are typical error evaluation methods expressed in Equations (2) and (3).

LSTM Model Verification
As previously mentioned, the proposed LSTM model learns the EnergyPlus simulation results for the past 10 days according to the arbitrarily determined set-point temperature. Here, if the energy use patterns for the past 10 days, which are the training data of the model, are similarly described, it can be expected that the accuracy of predicting the building energy consumption for the following day, which is the prediction target, will increase.
In this study, building energy models were developed for six days, from 6 August 2020 to 11 August 2020. The learning models learned building energy use patterns for 275 set-point temperature scenarios on average, over the simulation time of 500 s, and the learning error for six days was only 28 Wh (CVRMSE 3.7%). Figure 4 shows the results of comparison of the learning period with the largest error in learning performance and the period with the smallest error. For both models, most of the points were distributed on the diagonal line and errors of CVRMSE 5.3% and 2.8% were observed, respectively, resulting in no significant difference. Table 4 summarizes the learning errors of the proposed model. The simulation was performed for six days from 6 August to 11 August during the cooling period. The errors were analyzed using RMSE and CVRMSE, which are typical error evaluation methods expressed in Equations (2) and (3).

LSTM Model Verification
As previously mentioned, the proposed LSTM model learns the EnergyPlus simulation results for the past 10 days according to the arbitrarily determined set-point temperature.
Here, if the energy use patterns for the past 10 days, which are the training data of the model, are similarly described, it can be expected that the accuracy of predicting the building energy consumption for the following day, which is the prediction target, will increase.
In this study, building energy models were developed for six days, from 6 August 2020 to 11 August 2020. The learning models learned building energy use patterns for 275 set-point temperature scenarios on average, over the simulation time of 500 s, and the learning error for six days was only 28 Wh (CVRMSE 3.7%). Figure 4 shows the results of comparison of the learning period with the largest error in learning performance and the period with the smallest error. For both models, most of the points were distributed on the diagonal line and errors of CVRMSE 5.3% and 2.8% were observed, respectively, resulting in no significant difference. Table 4 summarizes the learning errors of the proposed model.    Figure 5 shows the results of predicting the daily building energy consumption for the proposed model. For model evaluation, the set-point temperature for 24 h on the following day was determined through the Randi function in MATLAB, and subsequently the results of applying the same set-point temperature to the reference and proposed models were compared. The proposed model described energy use patterns similar to those of the reference model for the six days of the test, and exhibited errors of RMSE 127 Wh and CVRMSE 14% each day on average. Considering that the peak energy consumption during the test period was approximately 3 kW, it appears that the proposed model can be sufficiently used as a building energy model for MPC. Most of the errors of the model occurred in the early morning when energy consumption was low, and the error was only 10% from 07:00 to 18:00, which is the time zone for main energy use. Table 4 summarizes the prediction performance of each model.    Figure 5 shows the results of predicting the daily building energy consumption for the proposed model. For model evaluation, the set-point temperature for 24 h on the following day was determined through the Randi function in MATLAB, and subsequently the results of applying the same set-point temperature to the reference and proposed models were compared. The proposed model described energy use patterns similar to those of the reference model for the six days of the test, and exhibited errors of RMSE 127 Wh and CVRMSE 14% each day on average. Considering that the peak energy consumption during the test period was approximately 3 kW, it appears that the proposed model can be sufficiently used as a building energy model for MPC. Most of the errors of the model occurred in the early morning when energy consumption was low, and the error was only 10% from 07:00 to 18:00, which is the time zone for main energy use. Table 4 summarizes the prediction performance of each model.    Figure 5 shows the results of predicting the daily building energy consumption for the proposed model. For model evaluation, the set-point temperature for 24 h on the following day was determined through the Randi function in MATLAB, and subsequently the results of applying the same set-point temperature to the reference and proposed models were compared. The proposed model described energy use patterns similar to those of the reference model for the six days of the test, and exhibited errors of RMSE 127 Wh and CVRMSE 14% each day on average. Considering that the peak energy consumption during the test period was approximately 3 kW, it appears that the proposed model can be sufficiently used as a building energy model for MPC. Most of the errors of the model occurred in the early morning when energy consumption was low, and the error was only 10% from 07:00 to 18:00, which is the time zone for main energy use. Table 4 summarizes the prediction performance of each model.   side of the figure shows the learning performance, and the right side shows the prediction performance of the model. CVRMSE for learning was 6.9% and 16.9% for prediction, and the results are similar to the sample period as given in Table 4.
Sustainability 2021, 13, x FOR PEER REVIEW 8 of 14 Figure 6 shows the learning and prediction performances for an extended period of 1 August 2020 to 31 August 2020. This is achieved for further model verification. The left side of the figure shows the learning performance, and the right side shows the prediction performance of the model. CVRMSE for learning was 6.9% and 16.9% for prediction, and the results are similar to the sample period as given in Table 4.  Figure 7 shows the set-point temperatures and energy consumption derived as PSO optimization results. The proposed and reference models performed a planning of daily set-point temperatures that minimize the objective function through PSO and applied the results. First of all, the proposed model considered the PV power generation time on the third and fourth days of simulation, and showed cooling operation patterns, in which the set-point temperature was decreased during daytime when the amount of power generated was large and increased in the evening and early morning. On the fourth day, in particular, it yielded a scenario that reduced the grid electricity consumption by more than 4 kWh compared to the reference model. The two models did not also provide completely identical set-point scenarios in other periods. Based on the finding that the cooling coil energy consumption itself was similar for the two models as shown in the upper graph in Figure 6, it was confirmed that similar amounts of energy were used to handle the indoor heating load, regardless of the change in set-point temperature.  Figure 8 shows the daily grid energy consumption. In the figure, the bar graph labeled 'fixed-setpoint control' represents an EnergyPlus simulation in which a fixed-setpoint temperature of 24 °C was applied. There is no difference in the energy used by the  Figure 7 shows the set-point temperatures and energy consumption derived as PSO optimization results. The proposed and reference models performed a planning of daily set-point temperatures that minimize the objective function through PSO and applied the results. First of all, the proposed model considered the PV power generation time on the third and fourth days of simulation, and showed cooling operation patterns, in which the set-point temperature was decreased during daytime when the amount of power generated was large and increased in the evening and early morning. On the fourth day, in particular, it yielded a scenario that reduced the grid electricity consumption by more than 4 kWh compared to the reference model. The two models did not also provide completely identical set-point scenarios in other periods. Based on the finding that the cooling coil energy consumption itself was similar for the two models as shown in the upper graph in Figure 6, it was confirmed that similar amounts of energy were used to handle the indoor heating load, regardless of the change in set-point temperature.

Optimization Simulation Results
Sustainability 2021, 13, x FOR PEER REVIEW 8 of 14 Figure 6 shows the learning and prediction performances for an extended period of 1 August 2020 to 31 August 2020. This is achieved for further model verification. The left side of the figure shows the learning performance, and the right side shows the prediction performance of the model. CVRMSE for learning was 6.9% and 16.9% for prediction, and the results are similar to the sample period as given in Table 4.  Figure 7 shows the set-point temperatures and energy consumption derived as PSO optimization results. The proposed and reference models performed a planning of daily set-point temperatures that minimize the objective function through PSO and applied the results. First of all, the proposed model considered the PV power generation time on the third and fourth days of simulation, and showed cooling operation patterns, in which the set-point temperature was decreased during daytime when the amount of power generated was large and increased in the evening and early morning. On the fourth day, in particular, it yielded a scenario that reduced the grid electricity consumption by more than 4 kWh compared to the reference model. The two models did not also provide completely identical set-point scenarios in other periods. Based on the finding that the cooling coil energy consumption itself was similar for the two models as shown in the upper graph in Figure 6, it was confirmed that similar amounts of energy were used to handle the indoor heating load, regardless of the change in set-point temperature.  Figure 8 shows the daily grid energy consumption. In the figure, the bar graph labeled 'fixed-setpoint control' represents an EnergyPlus simulation in which a fixed-setpoint temperature of 24 °C was applied. There is no difference in the energy used by the  Figure 8 shows the daily grid energy consumption. In the figure, the bar graph labeled 'fixed-setpoint control' represents an EnergyPlus simulation in which a fixed-setpoint temperature of 24 • C was applied. There is no difference in the energy used by the cooling coil between the models, as the purpose of the energy is to handle the building load. However, if a plan is established to maximize the utilization of renewable energy, the energy actually used becomes different, as the grid electricity consumption can be reduced. the PSO optimization options for a day. The result provided a set-point temperature scenario that reduced energy consumption by approximately 43% compared to the initial reference simulation result. In this instance, the energy consumption pattern was very similar to that of the proposed model, as shown in Figure 9, and the grid energy consumption was also reduced by more than 9% compared to the proposed model. Similarly, when the Maxtime boundary was removed for the proposed model, the model gave a reduced energy consumption by 1.4% compared to the case without modified PSO conditions.  In the figure, the proposed model used less energy in all sections except for 6 August 2020. The error on 6 August 2020 was caused by the performance of the model. As shown in the previous model evaluation in Table 4, it was difficult to obtain meaningful optimization simulation results on 6 August 2020, because the performance prediction error of the model was relatively large. From 7 August 2020 to 11 August 2020, the operation scenario by the proposed model could save grid energy consumption by more than 35% (2.9 kWh) each day on average compared to the reference case. The MPC scenario increased self-consumption of PV energy and reduced PV curtailment.

Optimization Simulation Results
However, it can be interpreted that it was difficult for the reference model to find the optimal solution, even though it used the same PSO technique in this study. The reference model consumed approximately 100 min on average until the completion of simulation, because it performed co-simulation with EnergyPlus at every iteration.
In contrast, the proposed model yielded better optimization results in the process of executing it and obtaining the results despite the same PSO option, because it is a lightweight network model that can perform optimization simulation without communication with a separate external program after its construction. It consumed only approximately 30 min on average for the simulation, even including the process of extracting data from EnergyPlus for learning.
The bar graph added on 11 August 2020 in Figure 8 shows the result of performing the PSO optimization of the reference model by removing the Maxtime boundary among the PSO optimization options for a day. The result provided a set-point temperature scenario that reduced energy consumption by approximately 43% compared to the initial reference simulation result. In this instance, the energy consumption pattern was very similar to that of the proposed model, as shown in Figure 9, and the grid energy consumption was also reduced by more than 9% compared to the proposed model. Similarly, when the Maxtime boundary was removed for the proposed model, the model gave a reduced energy consumption by 1.4% compared to the case without modified PSO conditions. Figure 10 shows the simulation results and corresponding CPU time on 11 August 2020. according to limited and unlimited PSO conditions. As can be seen from Figures 8 and 9, the proposed model showed very similar energy simulation results to the modified PSO conditions cases. This means that optimization with the proposed model can sufficiently converge with the limited Maxtime condition. However, in terms of simulation time, it took only 22 min while other cases with modified PSO conditions needed more simulation time. This indicates that it will be difficult to actually apply the reference model to the test environment of this study with ensuring convergence, considering the characteristics of MPC in which the operation plan for the following day is established at 23:00 on the previous day, or real-time control is performed.    Figure 11 shows the unused PV energy, which is due to the surplus of PV production compared to required energy consumption. Thus, lower values mean higher efficiency of the proposed operating strategies. This can be an important factor to evaluate the MPC performance for typical houses without resorting to ESS. From Figure 11, the difference   Figure 10 shows the simulation results and corresponding CPU time on 11 August 2020. according to limited and unlimited PSO conditions. As can be seen from Figures 8-9, the proposed model showed very similar energy simulation results to the modified PSO conditions cases. This means that optimization with the proposed model can sufficiently converge with the limited Maxtime condition. However, in terms of simulation time, it took only 22 min while other cases with modified PSO conditions needed more simulation time. This indicates that it will be difficult to actually apply the reference model to the test environment of this study with ensuring convergence, considering the characteristics of MPC in which the operation plan for the following day is established at 23:00 on the previous day, or real-time control is performed.  Figure 11 shows the unused PV energy, which is due to the surplus of PV production compared to required energy consumption. Thus, lower values mean higher efficiency of the proposed operating strategies. This can be an important factor to evaluate the MPC performance for typical houses without resorting to ESS. From Figure 11, the difference  Figure 11 shows the unused PV energy, which is due to the surplus of PV production compared to required energy consumption. Thus, lower values mean higher efficiency of the proposed operating strategies. This can be an important factor to evaluate the MPC performance for typical houses without resorting to ESS. From Figure 11, the difference in unused PV energy between the reference and proposed model is about 1.8 kWh, so 3.7 kWh, the difference in E grid between models, attributes the reduction effect of the unused PV energy. The other effect is surely optimized indoor setpoint temperatures.
For the case of 9 August 2020, the MPC models utilized the produced PV energy at a similar level while the fixed-setpoint control used less PV energy. This can be interpreted that the MPC models maximize cooling load by lowering setpoint temperatures during the daytime. On average, the reference and proposed models consumed PV energy more than the fixed-set point control by 1.8 and 3.1 kWh, respectively, for a day. Table 5 summarizes the detailed simulation results, including grid energy consumption, average indoor temperature, unused PV energy, and simulation time. similar level while the fixed-setpoint control used less PV energy. This can be interpreted that the MPC models maximize cooling load by lowering setpoint temperatures during the daytime. On average, the reference and proposed models consumed PV energy more than the fixed-set point control by 1.8 and 3.1 kWh, respectively, for a day. Table 5 summarizes the detailed simulation results, including grid energy consumption, average indoor temperature, unused PV energy, and simulation time.

Conclusions
A long short-term memory (LSTM)-based building energy model, which learns the data obtained from a detailed building energy model, was proposed as a predictive control of a building. The operation scenario to reduce the grid electricity consumption on the following day was derived by applying the PSO algorithm to the proposed model. The LSTM-based building model was developed to predict the energy consumption of the building according to the set-point temperature and to establish the optimal set-point temperature plan that minimizes the use of electrical energy during the test period through a combination with the optimization algorithm. A verification test was conducted between the proposed and the reference building energy model. The energy consumption prediction performance of CVRMSE 12% was observed on average, indicating that the proposed model can be used as a building energy model for MPC.
The MPC simulation results showed that the proposed model could reduce the average daily grid energy consumption by approximately 30% compared to the reference model for most of the period. Partly, the proposed model utilized more PV energy produced, and it means that the model reduced unused PV energy.
A main advantage of the proposed MPC model is that it is possible to speed up the simulation for applicable MPC implementation. The average daily simulation time consumed was approximately 30 min for the proposed model, whereas it was approximately 100 min for the reference model. This means that sufficient optimization may not be achieved, depending on the computation time of the target model, even if the same optimization function is used. This may affect the performance degradation of MPC, which must establish the operation plan for the following day within a limited time.
For buildings with insufficient measurement data, MPC can be implemented through a well-fitted detailed building energy model. It is difficult, however, for the detailed model to achieve sufficient optimization within a given time, because it requires a long computation time for optimization, as seen from the results. The proposed model demonstrated better performance compared to the reference model. As the data-based model is significantly affected by the training data, training was performed by extracting daily model behavior according to the weather data and operating conditions for the past few days. If sufficient data for MPC are secured as the operation continues, however, there will be benefits in terms of model usability, as the appropriately trained model without sequencing may be used only for the optimization process, thus significantly reducing the time required.