Microsoft Word - PRES22_0064.docx DOI: 10.3303/CET2294084 Paper Received: 08 April 2022; Revised: 27 July 2022; Accepted: 28 July 2022 Please cite this article as: Chen W.-H., You F., 2022, An Energy Optimization Model for Commercial Buildings with Renewable Energy Systems via Nonlinear MPC, Chemical Engineering Transactions, 94, 505-510 DOI:10.3303/CET2294084 A publication of CHEMICAL ENGINEERING TRANSACTIONS VOL. 94, 2022 The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Yee Van Fan, Jiří J. Klemeš, Sandro Nižetić Copyright © 2022, AIDIC Servizi S.r.l. ISBN 978-88-95608-93-8; ISSN 2283-9216 An Energy Optimization Model for Commercial Buildings with Renewable Energy Systems via Nonlinear MPC Wei-Han Chen*, Fengqi You Cornell University, Ithaca, New York, 14853, USA wc593@cornell.edu In this study, we develop a novel nonlinear model predictive control (NMPC) framework for climate control of buildings with renewable energy systems to minimize electricity costs. A nonlinear dynamic model of the building climate and renewable energy systems, including temperature, humidity, thermal comfort, geothermal heat pump, and solar panels, is first constructed based on mass and energy balance equations. The nonlinear dynamic model is then integrated into the proposed NMPC framework, which iteratively solves a nonlinear programming problem to generate the optimal control inputs, which minimize energy consumption and carbon footprints for sustainability. A simulation case study on controlling a building located on the Cornell University campus is conducted to demonstrate the capability of renewable energy sources to reduce building energy consumption using the proposed NMPC framework. The results show the NMPC framework could efficiently minimize total electricity cost and constraint violation for thermal comfort to 12.9 % with no more than 0.2 of violation on the predicted mean value index in different seasons. Implementing an electricity storage component could reduce the electricity cost by 19 %. The results indicate better sustainability for the smart building using sustainable energy sources and the NMPC framework. 1. Introduction One possible way to cut down energy consumption while ensuring thermal comfort for occupants is by implementing renewable energy sources (e.g., solar energy and earth source heat energy) with a model predictive control (MPC) framework (Chen et al., 2021). In a hybrid energy system (Gong et al., 2015), renewable energy sources (e.g., earth source heat energy and solar energy) are utilized to reduce carbon footprints (Taebnia et al., 2020). Since the soil temperature is nearly constant under sufficient depth, geothermal energy can heat the building in winter and cool down in summer (Self et al., 2013). Solar energy can be captured by photovoltaic (PV) panels and stored in battery systems (Ogunjuyigbe et al., 2016). The electricity generated from solar energy can then be used for lighting and heating in the building (Tian et al., 2022). By adopting the hybrid renewable energy system, electricity costs can be significantly reduced (Noris et al., 2014). Because the building climate is a multi-input multi-output system (Hu et al., 2022), MPC has advantages over other classical control methods to gain the optimal control inputs for multiple control actuators (Trigkas et al., 2019). Some current studies investigated building climate control with a sustainable energy system (Deng et al., 2011). However, their building climate dynamic model is considered linear instead of nonlinear. Since the building climate has nonlinear dynamics, a linear model is not able to predict the future environment as accurately as a nonlinear model, leading to sub-optimal control performance (Chu, 2015). They only consider controlling indoor temperature instead of a more sophisticated thermal comfort index such as the predicted mean value (PMV) index. Thermal comfort includes multiple factors (e.g., air temperature, humidity, and air velocity), and thermal comfort cannot be satisfied if the temperature is controlled only. A nonlinear MPC (NMPC) framework for building climate control on renewable energy systems can be adopted to tackle this issue (Chen et al., 2022). A comprehensive configuration of renewable energy systems, including PV panels, earth source heating, and electricity storage battery, can be adopted through this framework. In this work, we propose an NMPC framework for smart and sustainable buildings’ climate regulation to minimize the total electricity cost and maintain thermal comfort for occupants. Building energy optimization has been 505 shown to be effective in reducing carbon footprint (Sun et al., 2022). The control and renewable energy system configurations include heating, ventilation, and air conditioning (HVAC), geothermal heat pump, PV panel, and electricity storage battery. The nonlinear dynamic models of the building climate and sustainable energy systems, including temperature, relative humidity, thermal comfort, earth heating sources, PV panels, are first constructed using first-principal equations. The temperature dynamic model is built by the energy balance equations and multiple renewable energy models. A dynamic model for humidity is developed by using mass balance accompanied by the approximation of the respiration rate of humans. After constructing all dynamic models, historical weather data is gathered from the weather station. The upper and lower bounds for system states are set to ensure occupants’ healthy and comfortable environment. The upper and lower bounds for control inputs are determined according to the limitation of each control actuator (Chen et al, 2021). Lastly, a nonlinear optimization problem is formulated to minimize electricity consumption, leading to fewer carbon footprints. At each sampling time, the nonlinear optimization problem is solved to generate optimal control inputs for the sustainable building climate (Grüne and Pannek, 2017). A case study on controlling a real-world building with renewable energy systems is used to demonstrate the advantages of the proposed NMPC framework. 2. Dynamic model formulations Figure 1 shows the schematic of the NMPC framework for sustainable building climate using renewable energy sources. The system states are temperature, relative humidity, and PMV index. The control and renewable energy system configurations include HVAC, geothermal heat pump, PV panel, and electricity storage battery. The disturbances are from weather forecast errors. The dynamic models for indoor temperature and relative humidity are developed from mass and energy balance equations. The PMV index, which can better gauge the thermal comfort of occupants, is estimated from factors, including indoor temperature and relative humidity. Figure 1: The NMPC framework for building climate control with renewable energy sources 2.1 Temperature dynamic model An indoor air temperature dynamic model is required in the NMPC framework to control the indoor temperature better. Building thermodynamic models are often developed as a resistance-capacitance model, where building components are viewed as resistances and capacitances. In this work, we employ the Building Resistance- Capacitance Modeling (BRCM) MATLAB (version R2022a) Toolbox to develop the dynamic model for building indoor temperatures (Sturzenegger et al., 2016). The BRCM Toolbox generates the system dynamics tailored to the MPC framework through building geometry, structure, and materials (Shang et al., 2019). The system dynamics are given by: , 1 1 , ,( ) u k k u k k vu i k Tu i i i k n v kT AT B u B v B v B T u       (1) where Tk denotes the temperatures of rooms or wall/floor/ceiling, uk the inputs, and vk the predicted disturbances at time step k. A, Bu, Bv, Bvu,i, and Bxu,i are matrices of appropriate sizes. 2.2 Humidity dynamic model The humidity inside the building can be modeled by differential equations. The absolute humidity is first modeled by using the mass balance equation. The relative humidity is then calculated from absolute humidity and building 506 indoor temperature. The mass balance equation of water, including the net flow from ventilation, respiration of occupants, and the humidifier, is shown as, d d m i ven res hutV h m m m t     (2) where  is the water density, V is the air volume, ih is the absolute humidity, ventm is the water net flow from ventilation, resm is the water net flow from the respiration of the occupants, and humm is the water net flow from the humidifier system. When ventilation draws outdoor air into the building, replacing and removing indoor air, the moisture in the air is also removed. The water net flow of the ventilation is the difference between indoor absolute humidity and outdoor absolute humidity. The net flow can be represented as,  , maxvent a fan i o fanm C hu h u  (3) where ho is the outdoor absolute humidity and Ca is the air specific heat. The control input of the fan affects both the building temperature and the building indoor humidity, which shows the importance of optimizing multiple system states simultaneously. The absolute humidity model can then be converted into relative humidity using the equation as follows, ) 100 0.611 ( i i sat i h P H p T  (4) where iH is the relative humidity, P is the atmospheric pressure, and satp is the saturated atmospheric pressure. Eq(4) shows the dependence of the temperature and humidity models. 2.3 Ground source heating system dynamic model Ground source heat pump (GSHP) is the renewable energy source in this work. The heat extracted rate by the unit in the heating mode, 𝑄𝑒, can be modeled as (Ozgener and Hepbasli, 2007): , , ,( )out wa ie wa p wa n waQ m C T T   (5) The rate of heat rejection in the condenser is modeled as 2 3( )rcond efQ m h h   (6) The rate of heat transfer in the evaporator can be calculated by: 1 4( )revap efQ m h h   (7) The work input rate to the compressor is: , 1 , 2( )ref i comp m comp comp m h h W      (8) In case the mass flow rate on the refrigerant side is not measured, the space heating load, 𝑄𝑠1, is estimated by: ,,1 ,( )s air out air in rp air aiQ m C T T   (9) rair a iir am V  (10) where 𝑚𝑎𝑖𝑟 is the mass flow rate of air, 𝐶𝑝,𝑎𝑖𝑟is the specific heat of air, 𝑉𝑎𝑖𝑟 is the volumetric flow rate of air, ρair is the density of air, Tin,air and Tout,air are the average air temperatures entering and leaving the fan-coil units. The coefficient of performance (COP) of the GSHP can be calculated as: cond comp Q cop W    (11) 2.4 PMV index model Although some climate control studies evaluate thermal comfort only by temperature, occupants’ actual thermal comfort conditions can be better gauged using the PMV index. PMV index serves better by calculating occupants’ real feelings through the energy balance between the environment and occupants’ bodies. The factors considered in the PMV index include indoor temperature, indoor relative humidity, air velocity, mean radiant temperature, clothing insulation, and metabolic rate (Standard ASHRAE, 2010). The PMV index can be estimated by (Yang et al., 2018): ( )bM diffPMV ae c Q  (12) where M is the metabolic rate of a human being and Qdiff is the difference between the internal heat production and loss that occurs in a human body, and it can be calculated by, diff work r pes se en vasQ M Q Q Q Q     (13) 507 ( ) ( )res air vapQ dM g T hM g p    (14) 4 4( ) ( )nclo msens clo cr airlo co v cloQ jf T T f h T T    (15) ( ) [ ( ) ]work work v pvap aeQ k M Q l m n q M Q p       (16) where pvap is water vapor pressure, fclo is clothing factor, and Insclo is clothing insulation (1 clo = 0.155 m2-K/W), and the value of coefficients a, b, c, d, g, h, j, k, l, m, n, and q in Eqs(12)-(16) can be found in ISO 7730 by International Standards Organization (1994). In Eq, the cloth surface temperature can be estimated by: 4 4[ ( )] [ ( )]clo skin clo clo conv c air clo mrlo clo cloT T R f h T T Ins jf T T     (17) There are two nonlinear items, radiative heat transfer and water vapor pressure, pvap, in the PMV model, which require an NMPC framework to control. 3. Nonlinear model predictive control NMPC is used to control the building climate using renewable energy sources in this work. Due to its simplicity, the Euler method is adopted to discretize the building climate dynamic models (Butcher, 2016). The nonlinear system model can be expressed as the following after the discretization:  1 , ,k k k kx f x u v  (18) where system states xk include building indoor air temperature, relative humidity, and thermal comfort. Control inputs uk consist of entering signals to manipulate HVAC, geothermal heat pump (Lee et al., 2019), and electricity storage battery operations. Disturbances vk contain ambient temperature, ambient relative humidity, and solar radiation. f(∙) is the nonlinear function. The nonlinear building climate model in Eq(18) can then be shown compactly for a certain length of time step as:  0 , ,xx f u v (19) where x, u, and v are the system state, control input, and disturbance sequences vectors, x0 is the initial system states, and f(∙) is the nonlinear vector function. After constructing the dynamic model for sustainable building climate and renewable energy systems, we could then develop the nonlinear optimization problem to be solved at each time step of the NMPC system. The nonlinear optimization problem includes constraints on system states and control inputs. The constraints are defined for control inputs and system states throughout the prediction horizon H. The control inputs u should be between the minimum and maximum values umin ≤ uk ≤ umax. The minimum and maximum values for building climate are also required to ensure the thermal comforts of occupants. The regulations on system states and control inputs are shown as: min max 0: 1, k Hu u u k     (20) min, max, 1:, k k k Hx x x k    (21) where umin and umax are the lower and upper bounds for control inputs. xmin,k and xmax,k represent the lower and upper bounds for thermal comfort. The k subscript indicates that the lower and upper bounds may vary depending on the occupancy or different settings (Jia et al., 2020). The compact form of Eq(20)-(21) is given by , x x u u G x g G u g (22) where Gx, Gu, gx, and gu help define the compact form of system states and control inputs constraints. After the dynamic model and constraints are prepared, the nonlinear optimization problem can then be written out as:  0 0 min s.t. , , T u x x u u TJ x        cc u x f u v G G ε S g ε u ε ε x g (23) where cc is the electricity pricing, ε represents slack variables, and S is the penalty weight. The objective function is to minimize the total electricity cost. Electricity is used for multiple actuators, including water pumps and lightings. A vector of slack variables ε is added to the objective function because there are limitations on control inputs which could cause the nonlinear optimization problem to become infeasible. In order to penalize the constraint violation, the penalty weight S is added. Since the slack variables are always positive, the state constraints are softened (Lu et al., 2020). The receding horizon approach is adopted in this smart and sustainable building climate control NMPC framework. At the beginning of each time step, the data of current system states and the forecasted weather disturbances are gathered (Shang et al., 2020). The nonlinear optimization problem in Eq can be solved based on the information of current system states and weather 508 disturbances, given by x0 and v in Eq., to obtain the optimal control inputs. The first control input of the horizon is then implemented for the current time step, while the rest control inputs are discarded via an online implementation. In the next time step, the same process is repeated, starting from collecting the data of current system states and the forecasted weather disturbances. 4. Case studies on building with renewable systems In this work, a building on the Cornell University campus in Ithaca, New York, is simulated for closed-loop thermal comfort control under the proposed NMPC control framework using renewable energy sources (Tian et al., 2019). The dimension of this building is 43.28 m × 24.38 m. The system states controlled in this work is thermal comfort, a combination of temperature and humidity. Ambient temperature, relative humidity, and solar radiation are considered disturbances. The simulation is performed for one week in winter during January 1-7, 2020, one week in spring during 1-7 April 2020, and one week in summer during 1-7 July 2020. The weeks in winter and summer have extreme ambient temperatures, which can test the performance of the NMPC framework under harsh weather conditions. The weather forecast data from 1-7 January 2020, 1-7 April 2020, and 1-7 July 2020, are collected for the NMPC simulations. The actual measurement data at the same period are also collected to reveal the system states at the next time step. Figure 2 shows the combination of PMV index profile and total electricity consumption in winter during 1-7 January 2020. The lower and upper bounds are set as -0.5 and 0.5. When the PMV index is less than -0.5, the climate is too cold for the occupants. Due to the cold weather in winter, heat pumps operate most of the time to heat the building’s indoor environment. The PMV index is mainly maintained at the lower bound. However, constraint violations still occur sometimes due to forecast errors. As for the electricity consumption profile, there is a clear diurnal pattern throughout the week. The peak of the electricity consumption is around 70 kWh, and the valley is about 40 kWh. The peak occurs when the occupants are inside the building during working hours, requiring greater internal loads. The weather also affects the energy consumption profile, so each day would not be the same. Figure 2: The PMV Index and electricity consumption profile of the sustainable building on the Cornell University campus with renewable energy systems in winter during 1-7 January 2020 (left), and electricity consumption comparisons between winter, spring, and summer of the building on the Cornell University campus (right) Conclusions In this work, we developed an NMPC framework that could simultaneously control multiple system states for the indoor climate of a building with renewable energy systems. Energy and mass balance equations were utilized to generate nonlinear dynamic models for the building environment. Renewable energy sources such as PV panels and geothermal heat pumps were adopted to reduce non-renewable energy consumption. We presented a case study of simultaneously controlling the indoor temperature and relative humidity of a building on Cornell Campus. The sensitivity analysis on electricity storage capacity showed that the electricity storage component could reduce the electricity cost by 19 % and ensure better sustainability for buildings. References Butcher J.C., 2016, Numerical Methods for Ordinary Differential Equations, John Wiley & Sons, Chichester, UK. Chen W.-H., Shang C., Zhu S., Haldeman, K., Santiago, M., Stroock, A.D., 2021, Data-driven robust model predictive control framework for stem water potential regulation and irrigation in water management, Control Engineering Practice, 113, 104841. 509 Chen W., You F., 2021, Smart greenhouse control under harsh climate conditions based on data-driven robust model predictive control with principal component analysis and kernel density estimation, Journal of Process Control, 107, 103-113. Chen W., 2022, Semiclosed Greenhouse Climate Control Under Uncertainty via Machine Learning and Data- Driven Robust Model Predictive Control, IEEE Transactions on Control Systems Technology, 30, 1186-1197. Chen W., Mattson N.S., 2022, Intelligent control and energy optimization in controlled environment agriculture via nonlinear model predictive control of semi-closed greenhouse, Applied Energy, 320, 119334. Chu Y., 2015, Model-based integration of control and operations: Overview, challenges, advances, and opportunities, Computers & Chemical Engineering, 83, 2-20. Deng S., Dalibard A., Martin M., Dai Y.J., Eicker U., Wang R.Z., 2011, Energy supply concepts for zero energy residential buildings in humid and dry climate, Energy Conversion and Management, 52(6), 2455-2460. Gong J., You F., 2015, Sustainable design and synthesis of energy systems, Current Opinion in Chemical Engineering, 10, 77-86. Grüne L., Pannek J., 2017, Nonlinear Model Predictive Control: Theory and Algorithms, Springer, Cham, Switzerland. Hu G., You F., 2022, Renewable energy-powered semi-closed greenhouse for sustainable crop production using model predictive control and machine learning for energy management, Renewable & Sustainable Energy Reviews, DOI: 10.1016/j.rser.2022.112790 Jia R., You F., 2020, Multi‐stage economic model predictive control for a gold cyanidation leaching process under uncertainty, AIChE Journal, 67, e17043. Lee I., Tester J.W., 2019, Systems analysis, design, and optimization of geothermal energy systems for power production and polygeneration: State-of-the-art and future challenges, Renewable and Sustainable Energy Reviews, 109, 551-577. Lu S., Lee J.H., 2020, Soft-constrained model predictive control based on data-driven distributionally robust optimization, AIChE Journal, 66, e16546. International Organization for Standardization, 1994, ISO 7730: Moderate Thermal Environments-Determination of the PMV and PPD Indices and Specification of the Conditions for Thermal Comfort, Geneva, Switzerland. Noris F., Musall E., Salom J., Berggren B., Jensen S.Ø., Lindberg K., Sartori I., 2014, Implications of weighting factors on technology preference in net zero energy buildings, Energy and Buildings, 82, 250-262. Ogunjuyigbe A.S.O., Ayodele T.R., Akinola O.A., 2016, Optimal allocation and sizing of PV/Wind/Split- diesel/Battery hybrid energy system for minimizing life cycle cost, carbon emission and dump energy of remote residential building, Applied Energy, 171, 153-171. Ozgener O., Hepbasli A., 2007, Modeling and performance evaluation of ground source (geothermal) heat pump systems, Energy and Buildings, 39(1), 66-75. Self S.J., Reddy B.V., Rosen M.A., 2013, Geothermal heat pump systems: Status review and comparison with other heating options, Applied Energy, 101, 341-348. Shang C., You F., 2019, A data-driven robust optimization approach to scenario-based stochastic model predictive control, Journal of Process Control, 75, 24-39. Shang C., 2019, Data analytics and machine learning for smart process manufacturing: Recent advances and perspectives in the big data era, Engineering, 5(6), 1010-1016. Shang C., Chen W., Stroock A.D., 2020, Robust Model Predictive Control of Irrigation Systems With Active Uncertainty Learning and Data Analytics, IEEE Transactions on Control Systems Technology, 28, 1493-1504. Sun L., Kaufman M.F., Sirk E.A., et al., 2022, COVID-19 impact on an academic Institution's greenhouse gas inventory: The case of Cornell University, Journal of Cleaner Production, 363, 132440. Tian X., You F., 2019, Carbon-neutral hybrid energy systems with deep water source cooling, biomass heating, and geothermal heat and power, Applied Energy, 250, 413-432. Tian X., Zhou Y., Morris B., et al., 2022, Sustainable design of Cornell University campus energy systems toward climate neutrality and 100% renewables, Renewable & Sustainable Energy Reviews, 161, 112383. Standard ASHRAE, 2010, Standard 55-2010: Thermal environmental conditions for human occupancy. American Society of Heating, Refrigerating and Air Conditioning Engineers, Atlanta, USA. Sturzenegger D., Gyalistras D., Morari M., 2016, Model predictive climate control of a Swiss office building: Implementation, results, & cost-benefit analysis, IEEE Transactions on Control Systems Technology, 24, 12. Taebnia M., Heikkilä M., Mäkinen J., 2020, A qualitative control approach to reduce energy costs of hybrid energy systems: Utilizing energy price and weather data, Energies, 13(6). Trigkas D., Ziogou C., Parcharidis S., 2019, Energy management in an islanded multi-node microgrid based on nonlinear model predictive control (NMPC), Chemical Engineering Transactions, 76, 901-906. Yang S., Wan M.P., Ng B.F., 2018, A state-space thermal model incorporating humidity and thermal comfort for model predictive control in buildings, Energy and Buildings, 170, 25-39. 510