Proactive Energy Optimization in Residential Buildings with Weather and Market Forecasts

This work explores the development of a home energy management system (HEMS) that uses weather and market forecasts to optimize the usage of home appliances and to manage battery usage and solar power production. A Moving Horizon Estimation (MHE) application is used to find the unknown home model parameters. These parameters are then updated in a Model Predictive Controller (MPC) which optimizes and balances competing comfort and economic objectives. Combining MHE and MPC applications alleviates model complexity commonly seen in HEMS by using a lumped parameter model that is adapted to fit a high-fidelity model. Heating, ventilation, and air conditioning (HVAC) on/off behaviors are simulated by using Mathematical Program with Complementarity Constraints (MPCCs) and solved in near real time with a non-linear solver. Removing HVAC on/off as a discrete variable and replacing it with an MPCC reduces solve time. The results of this work indicate that energy management optimization significantly decreases energy costs and balances energy usage more effectively throughout the day. A case study for Phoenix, Arizona shows an energy reduction of 21% and a cost reduction of 40%. This simulated home contributes less to the grid peak load and therefore improves grid stability and reduces the amplitude of load-following cycles for utilities. The case study combines renewable energy, energy storage, forecasts, cooling system, variable rate electricity plan and a multi-objective function allowing for a complete home energy optimization assessment. There remain several challenges, including improved forecast models, improved computational performance to allow the algorithms to run in real time, and mixed empirical/physics-based machine-learning methods to guide the model structure.


Introduction
Worldwide solar power capacity has grown from 176 GW in 2014 to 486 GW in 2018 [1]. Alternative energy sources such as solar and wind power have inherent variability which has been shown to destabilize power grids as market penetration increases [2]. This destabilization is due to a temporal offset between peak supply of alternative energy and peak energy demand, creating a problem commonly known as the "duck curve" [3]. The move toward alternative energy and the associated problems have motivated development on predictive control methodologies for building energy management. Demand response optimization mitigates the problems by shifting demand to match production and shaving peak demand. Proactive and predictive methods also restore some grid stability, especially when coupled with energy storage technologies which act as buffers to the time variability of alternative energy sources [4]. In this work, a proactive demand response energy system management algorithm incorporates a reduced-order building model with model predictive control (MPC) and moving horizon estimation (MHE). Conventional energy management solutions currently in implementation are predominantly reactive, meaning that they only respond to external stimuli as they happen. The proposed system incorporates machine-learned forecasts of future conditions (e.g., forecast supply, demand, and price) to determine when to store, consume, or generate energy and modify the model dynamically based on system measurements in a specified past time horizon (MHE). While the research focuses on specific energy systems where data is readily available, the resulting approach has application at a wide range of scales including single homes and larger buildings such as apartment complexes.

Grid Stabilization
Due to the time dependency of solar and wind, when energy is used becomes as important as how energy is used, if not more so. Electricity is a commodity that must be generated and consumed simultaneously. Both solar and wind energy are inherently intermittent, causing issues with simultaneous production and consumption [5]. The introduction of intermittent energy sources creates a grid management problem that is currently being addressed with a reactive operating strategy: rapidly ramping fuel-fired power plants to accommodate ever-changing solar and wind [5]. This is an inefficient use of capital and energy. Reactive strategies create a practical limit to the amount of renewable power that is accommodated by grid infrastructure. Much of the variability in the grid is predictable given weather forecasts and knowledge of consumer habits [6]. While commercially viable storage technologies are emerging, none have been married to predictive energy management tools that leverage existing techniques for forecasting energy supply and demand. By implementing predictive algorithms that use machine-learned forecasts, energy systems are responsive, charging storage ahead of a shortage event to alleviate future demand.
Powell et al. demonstrate this concept in a paper demonstrating an energy system that uses energy storage systems to match energy production with energy demand, using a solar power plant as a case study [5]. The goal of the study is to proactively optimize the system to respond to changes in the environment rather than reactively responding to changes. Powell et al. demonstrate that proactive dynamic optimization increases the percentage of incident energy collected by the solar power plant in all scenarios, but most significantly on days when cloud cover exacerbates the intermittent nature of the power source. Powell et al. conclude that different weather conditions correspond with different optimal operating strategies, further demonstrating that proactive control using forecast data improves the efficiency of operation of renewable energy sources. This demonstrates how proactive energy management leads to increased grid stability.
Smart metering is another strategy for maintaining grid stability. Smart meters allow utilities to receive real-time data of consumer energy usage. When most consumers have smart meters, a smart grid is formed. Smart grids allow seamless integration of renewable energy sources due to increased knowledge of the system [7,8]. Utility companies react to changes because the smart grid provides real-time data on consumers' energy usage. If consumers generate power using solar or wind, then there is a reduced demand seen by the utility company. The use of smart meters allows the utility company to see this reduced demand in real time and make decisions accordingly. Smart metering also provides the opportunity for dynamic energy pricing. Dynamic energy pricing allows the utility to manage the electricity on the demand side. With variable utility rates, residential and industrial consumers can react to changing electricity prices. This leads to an increase in grid reliability and efficiency as it reduces peak loads [9]. An important observation is that these pricing strategies often do not reduce the amount of energy consumed during the entire day, but instead, smooth out the demand throughout the day.

Demand Side Management
Heating, ventilation, and air conditioning (HVAC) systems are among the largest electrical energy consumers and large contributors to peak demand in the United States [10]. One major topic of recent research is demand side management or demand response optimization. Demand response optimization focuses on control strategies for consumers of electrical energy, often responding to dynamic pricing structures set up by utility companies. Sheha and Powell show that a HEMS with a photovoltaic (PV) system along with battery energy storage can be economically feasible if coupled with the right utility rate structure [11]. Sheha and Powell also review how rate structures can incentivize or deincentivize energy storage and other peak shaving technologies [11]. With the right rate structure, consumers can implement strategies to reduce their electricity consumption and reduce costs. Simultaneously, this demand side response helps the utility company and enhances grid stability by smoothing out energy demand throughout the day and reducing peak demand, often through energy storage.
Multiple review articles have been published on demand response [12][13][14][15][16][17]. Aghaei and Alizadeh review demand response, showing how demand response leads to greater grid stability with renewable energy penetration [12]. Shariatzadeh et al. review demand response implementation and methods and suggest how demand response may be implemented in smart grids [16]. Wang et al. and Brahman et al. review and describe methods for integrated demand response in smart energy hubs. These hubs combine local energy generation sources (i.e., solar power, natural gas turbines) and energy storage (thermal energy storage, battery) and allow them to manage sources of consumed power, acting as semi-independent energy systems interacting with the grid [17,18]. Good et al. describe the barriers to implementation of demand response including regulatory barriers, market design, physical network barriers, anthropogenic barriers, and other human factors such as lack of understanding [13]. O'Connell et al. review many of the challenges to demand response such as lack of experience, inherent system uncertainty (i.e., weather and occupancy), reliable control strategies, and market frameworks [19]. Paterakis et al. review demand enabling technologies for demand response and provide an overview of the global status quo of demand response implementation [14]. Yoon et al. investigated the effects of using a demand response controller (DRC) to control the temperature set-points in a home to reduce peak load and energy cost. They demonstrate that the DRC can decrease the peak load by 24.7%, annual electricity HVAC uses by 4.0%, and cost of electricity by 7.7% to 10.8% based on the pricing structure [10]. This study shows that there is potential for manipulating home energy consumption by adjusting temperature set-points. Controlling set-points with the addition of market and weather forecasts is predicted to provide even better reductions in cost, consumption, and peak loads.

Forecasting Methodology
Forecasting is one of the most important tools for proactive energy management systems. Proactive systems inherently require predictions of future system behavior to mitigate foreseen issues rather than reacting to them. A significant amount of research has been done to optimize and forecast HVAC systems as they are the largest consumer of building electricity and consequently cause most peak loads [20][21][22]. Weather forecasting is also an active research topic because of the increasing penetration of renewable energy sources and the inherent dependency on weather conditions for power generation. It is crucial to incorporate weather and HVAC forecasting because they are intrinsically interrelated. For example, if it is a hot and sunny day, solar energy generation increases, and the HVAC system requires more energy to cool the home. The energy management system may sub-cool the home or allow the temperature set-point to increase if there is insufficient solar power with peak energy prices. The energy management software may also reduce energy consumption at peak energy price times to sell electricity back to the grid. This is the underlying reason proactive building energy management systems are useful.
A significant amount of literature has been published on the development of efficient and accurate forecasting algorithms [23]. Bilbao et al. present a machine-learning (ML)-based regression forecasting method using an artificial neural network (ANN) with Bayesian regulation back-propagation and test this method on a building at the University of New South Wales [24]. Daut et al. use a hybrid swarm intelligence algorithm and support vector machine to achieve superior performance for building electrical energy consumption forecasting [25]. Deb et al. perform a review of time series energy consumption forecasting for building energy optimization by comparing methods based on historical data (black box) to those based on first-principles simulation (white box) [26]. Tanveer et al. and Wei et al. both review data-driven methods for prediction of large-scale building energy consumption with a focus on artificial neural networks, clustering, and support vector machines [6,27]. Wang et al. review artificial intelligence methods for building energy prediction with an emphasis on the difference between single and ensemble methods [28]. Foucquier et al. review first-principles physics-based building modeling and energy performance predictions [29]. Amasyali et al. review building energy consumption prediction methods with a focus on data pre-processing, data processing, and prediction itself [30]. Fumo et al. provide an overview of prediction models which work with entire building energy simulation software packages [31]. Lazos et al. review common forecasting methods, discussing the difference between the short prediction horizons typical of statistical or data-driven methods compared to the longer time horizons typical of physics-based methods [32].

Model Predictive Control in Building Energy Management
Although many control strategies are employed for proactive energy management of building energy systems, this work's scope is limited to MPC. MPC is a well-known control method which uses a process model to predict future values given a set of control moves over a future time horizon. The set of control moves over the future horizon is optimized using dynamic optimization methods which are well-documented in the literature [33,34]. When integrated with forecasting, dynamic optimization allows the control strategy to proactively mitigate for disturbances prior to their occurrence when they are predicted to occur during the future time horizon. MPC for building energy optimization has been an active topic for several decades, with multiple review articles written on the topic [35][36][37][38]. One important aspect of MPC is the model used for optimization and prediction. Model complexity has a significant impact on computational power and time required to solve the dynamic optimization problem, sometimes making online implementation of the control strategy infeasible. Several articles identify methodologies to reduce computational complexity of the building energy MPC problem. Picard et al. present a linear time invariant (LTI) state space model for the problem which allows the model complexity to be decoupled from the required computational time, although at the expense of system nonlinearities [39]. Ruiz et al. introduce a genetic algorithm (NGSA-II) as an optimization method in an effort to reduce the computational burden of the problem [40]. Sangi et al. suggest a model based on exergy (usable work) rather than on energy consumption and an agent-based hybrid model predictive controller [41]. Santoro et al. introduce a non-linear model predictive control (NMPC) formulation with a non-linear model to describe the building system [42].
Another important aspect of MPC in relation to building energy optimization and grid stabilization is the integration of energy storage such as thermal energy storage (TES) and batteries. Yu et al. conduct a comprehensive review of control strategies to integrate thermal energy storage to shift peak load and allow for greater renewable energy penetration in the grid, including an overview of MPC's space [35]. Khakimova et al. present a method for using MPC on a smart house equipped with photovoltaic (PV) power, thermal energy storage, and an HVAC system with the objective to minimize energy purchased from the grid [43]. Multiple objectives also commonly exist in building energy optimization as occupant thermal comfort and energy efficiency are typically conflicting objectives. This concern is inherently covered in all works in this space, but is more explicitly addressed by Ascione et al. [44]. Ascione et al. use a multi-objective dynamic optimization with a genetic algorithm, hourly set-points, and weather and occupancy forecasts to generate a Pareto front from which the user chooses an optimal solution based on comfort and efficiency preferences. Oldewurtel et al. developed a MPC framework for integrated room automation to control thermal comfort, maximize energy efficiency, as well as control luminance and room carbon dioxide levels [45]. Touretzky tackle the issue of timescales by implementing a long-timescale HVAC scheduling formulation with forecasts and a short-time scale model predictive controller to meet the proactive schedule [46]. Touretzky et al. introduce an economic MPC formulation for an overall economic objective in the same work. Afram et al. provides a review of for building energy optimization, addressing differences among literature in many aspects of MPC [36]. Killian et al. provide answers to many practical and technical questions regarding MPC for building energy optimization [37].

Accounting for Forecast Uncertainty and System Disturbances
MPC provides an effective means for proactive control and optimization of building HVAC systems to reduce energy consumption and maximize efficiency, all while enhancing grid stabilization. However, energy consumption and weather forecasts which allow for effective predictive and proactive control are often inaccurate, which leads to sub-optimal control [26,47,48]. In addition to uncertainty in building energy forecasts and weather forecasts, system disturbances can occur which could be unpredicted by the proactive controller [49]. There have been many methods presented to deal with these issues in the academic literature. Santoro et al. introduce system disturbances and model mismatch into their simulations with NMPC of a building energy system, accounting for uncertainty in model mismatch and demonstrating robust performance [42]. Oldewurtel et al. present a stochastic model predictive control (SMPC) approach to account for uncertainty in weather forecasts which outperforms the control in their study [45]. Vahid-Pakdel et al. use a stochastic mixed-integer linear programming (MILP) methodology to account for uncertainties such as in demands, prices, and wind speed in a smart grid optimization, reducing costs by 5% [50]. Kim et al. use adaptive MPC and multiple distributed simple system models to both alleviate computational burden and address system disturbances in building energy control [49]. Zhang et al. introduce randomized model predictive control (RMPC) which samples multiple possible scenarios within an uncertainty window to implement stochastic methods in the absence of a probabilistic disturbance model [51]. Kwak et al. introduce methods to incorporate real-time weather data and building energy consumption data into MPC to mitigate error due to uncertainty and inaccuracy in forecasts [48,52]. Ebrahimpour and Santoro develop a methodology for using MHE in conjunction with MPC with a simplified model to account for uncertainties and model measurement mismatch due to load and occupancy [53]. In this work we present a methodology to use MHE to incorporate real-time weather and building energy consumption data into MPC via dynamic parameter estimation.

Use of MHE in MPC
There are many benefits to using MHE in combination with MPC. Copp et al. show that under certain relaxed assumptions, the state of a system is bounded with bounded tracking error, thus MPC with MHE is a feasible method of non-linear system control [54]. Tenny

Contributions
The novel contributions of this work include the following: 1. A home energy management system (HEMS) that uses a combined MHE and MPC approach that estimates residential home building parameters and optimizes home energy in real time.
Mathematical building models are often very complicated and computationally expensive.
This work overcomes this obstacle by using a lumped parameter model that is adapted to fit a high-fidelity model. 2. A hybrid approach manages the on/off behavior of air conditioners as a continuous function using a mathematical program with complementarity constraints (MPCC). Discrete variables increase the number of potential solutions which require more computation resources and time. By using MPCC's, the discrete behaviors are converted into a continuous function that is solved with continuous optimization. 3. A combined renewable energy, energy storage, forecasts, cooling system, variable rate electricity plan, and multi-objective function residential house model is presented and tested on a simulated home in Phoenix, Arizona. This combination includes all major energy flows within a home as well as important outside disturbances. Accounting for these factors allows for a complete home energy optimization assessment with controlled conditions to assess the potential benefit from the HEMS approach.
This work provides a framework to develop and optimize a HEMS with forecasting. Figure 1 shows how each of the individual components fit together to form the complete HEMS framework. The process begins with simulated home data. This data is sent to the MHE application where the home parameters values are estimated. Simulation data is also sent to the forecasting models where future values are predicted. The home parameters and future predictions are sent to the MPC application where climate control, battery usage, and energy flows in the home are optimized. Optimized decisions are sent back to the simulation and implemented into the HEMS. This cycle repeats every 10 min to allow time for the optimizer to converge to a solution.
This work is useful to researchers and HEMS developers interested in home modeling, automation, forecasting, and energy usage optimization. The following sections of the paper describe the methods used to model and optimize homes using the energy management software. The concluding sections quantify and discuss the effect of implementing the optimization software. They also provide suggestions to improve and continue the work discussed in this paper.

Methods
This section discusses the reduced-order and physics-based (EnergyPlus) models, HVAC thermal and electrical systems, and weather forecast models. It also describes the mathematical formulation of MHE and MPC methods used. The results of the MHE and MPC applications are then presented and discussed.

Methods
This section discusses the reduced-order and physics-based (EnergyPlus) models, HVAC thermal and electrical systems, and weather forecast models. It also describes the mathematical formulation of MHE and MPC methods used. The results of the MHE and MPC applications are then presented and discussed.

Theory/Overview
A physics-based HVAC simulator (DOE's EnergyPlus) is used to allow practical and efficient control testing. This testing is sometimes referred to as Model in the Loop (MiL) testing. The equations that define the MiL model (EnergyPlus) are left out of this work. The simulator models building-wide energy systems and allows users to completely customize building parameters. The simulator also provides energy consumption data for the whole home including lights, plugs, appliances, heating and cooling. Using the simulator, users may manipulate time-step resolution, HVAC configurations, heat transfer calculation strategies, etc. Using the data from the simulator, an MHE is used to fit parameters in a heat transfer equation that makes a correlation between ambient temperature and the inside home temperature. This correlation is then combined with forecasts to optimize home energy flows by manipulating variables such as temperature set-points. In addition to changing the home temperature set-points, the controller makes decisions on whether to charge or discharge a battery used for energy storage and whether to buy or sell electricity to the grid. These decisions are determined by minimizing the total cost of the energy system. Profits can be gained at individual time steps if net metering is available and there is an excess amount of energy in the home system. Ultimately, the solver is minimizing and shifting energy loads which results in minimizing energy costs when properly using variable rate pricing structures. Figure 2 shows the results of an example simulation with a physics-based model (EnergyPlus). The blue line is the amount of electricity used by the HVAC system to cool the house and the red line is the ambient temperature outside of the home. A correlation is seen between the ambient temperature and the energy required by the HVAC system. As discussed in the introduction, air conditioning units are one of the main electricity-demand contributors. As a result, the initial focus is to build an energy management software that encapsulates the correlation seen in Figure 2 to reduce electricity costs. Summer months have the highest cooling demand and have the highest potential to improve energy usage. Consequently, this work focuses on optimization during summer months.

Initial Model
An accurate house model is needed to optimize the energy usage. A reduced first-principles-based model is developed to accurately model the thermodynamics of the house. The basis of the house model is derived from the total energy equation shown in Equation (1).

∂ ∂t
One of the main goals of this work is to develop a model that is accurate but also simple. Although Equation (1) does not include nuclear, radiative, electromagnetic, or chemical forms of energy, it is still too complex to be optimized efficiently in a real-time HEMS. Equation (1) is simplified with a few assumptions. The first assumption is that energy transfer is dominated by convective and conductive heat transfer. This assumption eliminates the last three terms of Equation (1). The next assumption is that there is no mechanical energy transfer. This assumption eliminates 1 2 ρv 2 from Equation (1). With these two assumptions the model is reduced to Equation (2).
Equation (2) is a simplified version of the total energy balance and contains the information needed for an effective house model. Next, it is helpful to switch Equation (2) from the internal energy form to a temperature form. This is done by first converting internal energy to enthalpy and then enthalpy to a function of temperature. The resulting equation is shown in Equation (3).
The final transformation to the energy balance is to lump the parameters together. Parameter lumping is helpful in simplifying a model because one parameter contains the information of many constant values instead of estimating each one individually. This concept is particularly helpful when estimating parameter values in an MHE application because it simplifies the solution and decreases the degrees of freedom. Equation (4) shows the final lumped parameter house model which closely resembles Newton's Law of Cooling. Equation (5) shows how the parameters are lumped.
Equation (4) is now applied specifically to the HEMS. To achieve a mathematical relationship between the outside temperature and temperature of the air inside the home, the house is divided into parts. These parts include the outside surface of the wall, the inside surface of the wall, and the air contained in the home itself. This is done because the transfer of energy and heat capacitance of these sections are different and must be separated to model the home accurately. Figure 3 shows a diagram of how the house is divided into different parts. The first part of the energy balance is the heat transfer through the outer wall which is represented by Equation (6). This equation is displayed in the same order as the generic balance equation seen in Equation (2). The left side of Equation (6) is the accumulation of total energy contained in the outer wall. The parameter A contains information about the density, heat capacity, and area of the outer wall. This value is estimated so the exact values of density, heat capacity, and area are not needed. The accumulation term also contains the time differential of the outside wall temperature. This allows the model to adjust for changes in the total energy in the outer wall over time. The right side of Equation (6) contains terms that account for the input and output flows to and from the outside wall. The first term is the flow of energy by convection due to the ambient temperature around the outside of the home. The second term is the flow of convection due to the inner wall temperature. If the difference in temperatures is positive, it means the energy is flowing into the home and vice versa for a negative difference.
Equation (7) describes the energy balance around the inner wall. The concepts are the same as the outer wall. Energy flows in and out by convection from the outer wall and the air inside the home.
Finally, the energy balance of the air inside the home needs to be developed. As before, there is a convection term that describes the energy flow between the inner wall and the air inside the home. Equation (8) includes a new term, Q HVAC , which is the amount of energy flow from the HVAC system. Q HVAC is positive for an air conditioner and negative for a furnace or heater. Lastly, HVAC I/O is whether the HVAC system is on or off. This is a binary variable represented as a 0 or a 1.
Equations (6)-(8) combine to form a reduced-order model capable of representing the principle temperature dynamics of the home. The energy balances neglect radiation and conduction influences. These are negligible compared to convection at ambient temperatures so they are eliminated from the energy balance.

Improved Model
A deficiency in the lumped parameter model described by Equations (6)-(8) is exposed when testing with the EnergyPlus simulator. The lumped parameter model above fits the house data well when the air conditioner is only on for short periods of time, but fails to capture the correct behavior if the air conditioner is on for extended periods. As a result, the optimizer is unable to predict the temperature of the home appropriately and a new model is developed.
The energy balance described in Equation (2) still holds true, but the model is augmented. The augmented model equations are shown below in Equations (9) and (10).
Two major additions are incorporated in this model which are the heat transfer effects of the ground temperature and an additional term for the HVAC system. The ground temperature influence is added because it improved the model accuracy when applying it to a variety of different climates.
The last term of Equation (9) is what ultimately improved the model. Equation (10) shows that HVAC Status is just the change in HVAC I/O . This allows the model to track what state the HVAC system is in. For example, when the air conditioner turns on, the status goes from 0 to 1 and results in a HVAC Status value of 1. On the other hand, if the air conditioner turns off, then the status goes from 1 to 0 and results in a HVAC Status value of −1. This is important to capture in the model because HVAC systems have different behaviors when the system turns on, has been on for a period of time, and turns off. With the combination of the terms C(HVAC I/O ) and D(HVAC Status ), the house model accurately represents these effects. Figure 4 shows the results of the change. The first subplot shows the original model. This model was developed when the air conditioner status was changed rapidly in a cyclic manner. This subplot shows the result when the status is more variable. There is significant deviation from the actual data even though the model seems to match the points of inflection. The second subplot of Figure 4 shows the results of the improved model. The fit is not perfect but does match the data closer than the original model. These subplots show that the improvement was critical to the success of the HEMS because the optimizer will not likely provide a cyclic solution. It is important to notice that the number of balance equations in the previous model is reduced from three down to one. The addition of Equation (10) complicates the model and increases the time to converge. This complication arises because the model is discretized over a long time horizon and is non-linear. To maintain fast and reliable solutions, the energy balance equations for T wall,inner and T wall,outer are removed by setting the inner wall, outer wall, and inside air temperature equal. The results and comparison of the models are discussed in more detail in further sections.

Air Conditioner Load Model
Another aspect of the system that needs to be modeled is the air conditioner load. Although the air conditioners used in this work are On/Off, power consumption varies based on the efficiency of the unit. This efficiency is a function of many external influences such as humidity, temperature, age of the unit, and so on. Through careful consideration of many of these influences, the ambient air temperature is found to have a dominating impact on the efficiency and that the other effects are negligible. As a result, Equation (11) is developed to model the load of the air conditioner unit. The constant A is obtained by using MHE. Figure 5 shows the accuracy of the model.
This is a crucial addition because it allows the optimization algorithm to perform better than if a constant load is assumed. This is especially true because the efficiency is worse during the middle of the day and results in a higher load as shown below in Figure 5. This is commonly when air conditioners are on and when energy prices are at their highest. Having a model that explains these trends is essential to finding the true optimum.

Battery Model
Energy storage supplements a HEMS. Having the ability to store and use energy at different times then when it is produced allows MPC to have more degrees of freedom to optimize the energy system. To be able to do this, an accurate battery model is needed so that the system can anticipate storage usage and efficiency.
The model used in this work is a commercial home energy storage battery system as seen in Table 1. Equations (12) and (13) convert the total battery unit into a system of lithium-ion battery cells. The individual lithium-ion cell properties are found in Table 1.
Equations (14)- (18) are the remainder of the battery model equations with nomenclature shown in Table 2. The first equation calculates the power going into or out of the battery after accounting for AC to DC, or DC to AC inversion losses. Equations (15) and (16) convert the power into the current in or out of the individual battery cells. Equations (17) and (18) track the battery state of charge (SOC).
The combination of Equations (12)-(18) allows the MPC to optimally select energy storage and discharge.

Ambient Temperature Prediction Model
The most important forecast variable is the ambient temperature. This is due to the major effect on the heat transfer to the home, and consequently, the power needed to keep the home within a comfortable range of temperatures. If ambient temperatures are predicted, the house model described above predicts when the air conditioner needs to run. The MPC optimizes the start time and duration of cooling load. Bad predictions cause bad solutions, even solutions that can have worse effects than no optimization at all.
This work uses an empirical forecasting model. One reason for choosing an empirical model is that weather data is widely collected and recorded which provides large data sets to train and validate a model. The data used for training the models in this work are from multiple years and only includes summer months. A forecast model is created for every time point in the MPC horizon. For example, if the MPC is optimizing a point 12 h in the future, there is a model developed specifically for predicting the ambient temperature 12 h in the future. This is found to be most effective because the data used to train the model had varying influences. For example, if the ambient temperature ten minutes from now is predicted, then the p-values for the data within the last hour are found to be the only statistically significant variables. However, 24-h predictions require the use of a model that contains temperature data from hours to several days in the past according to the variable p-values in the regression model. The models for predicting the temperature 10 min and 24 h ahead are discussed in more detail below. Other models are developed for each of the remaining MPC horizon points, but they are not included because the results are similar to the 10 min and 24-h models.
The general form of the models is seen in Equation (19) as a time series model. The inputs to the model areTa which is an array of historical temperature data and Hr which is an array to indicate the hour of the day corresponding to the point being predicted. As mentioned above, the historical data is reduced to the data that best captures the trends. This process is done by keeping the variables with significant p-values. The historical data array varies in size depending on how many parameters are found to be significant. The parameters are fit using linear regression in Python with the scipy.minimize package. Figure 6 shows the actual value versus the predicted value for ambient temperature 10 min ahead. The root mean square error (RMSE) is 0.0499. An accurate 10-min forecast is important for near-term directional weather predictions, but does not give the optimizer enough data about the system to be able store energy hours in advance if needed. The longer predictions are more critical for exploiting time-of-day pricing and making long-term proactive decisions. Figure 7 shows the result of the model that predicts temperature 24 h in the future. The fit matches the model well with a RMSE of 1.845. These values along with Figure 7 indicate that the model is valid and can be used for optimization. It is important to notice that predictions are more uncertain further into the future as explained by the figures and statistical values.
These models are used to send forecasting data to the MPC application. Using accurate models allows the MPC application to better predict the status of the home in the future and allows the optimizer to proactively manage the energy flows to accommodate changes in ambient temperature.

Miscellaneous Building Power Prediction Model
Another important process variable to predict is the miscellaneous building power requirement. Miscellaneous building power is a variable inside EnergyPlus that accounts for all the building power usage minus what is needed for the HVAC system. This includes the power used by lights, appliances, and electronics plugged into outlets. Although the individual components mentioned may have very sporadic usage and trends, the combination of all of them into one variable stabilizes the dynamics into repetitive trends. It is important to be able to predict this value because it has an impact on the energy demand of the home at different times throughout the day and affects how the HEMS optimizes the energy flow in the home.
An empirical model is fit to EnergyPlus simulation data which provide large data sets that are used to train and validate the model. As with the ambient temperature forecasting, a model is created for each time-step of the MPC application. The general model equations are also very similar to Equation (19), but with one major difference as shown in Equation (20).
Instead of using historical data to predict the future value, the model only uses the current miscellaneous power value and the hour indicator value. These are determined by examining the p-values associated with each variable included in the historical data sets and only keeping ones that are statistically significant. The prediction model for predicting 10 min and 24 h in advance are discussed in greater detail below.
The results for the 10-min-ahead model are seen in Figure 8. Most of the points are close to the identity line, but there are a few outliers. This is explained by the sporadic use of appliances and outlets. The fit has a RMSE of 57.7 Watts. This indicates that the fit does well at representing most data but some of the data points deviate from the model fit. Air conditioning loads are around 5000 to 7000 Watts so a RMSE of 57.7 Watts has a negligible effect on the overall optimization. The results of the model predicting 24 h in advance are shown below in Figure 9. The fit has a RMSE of 86.1. Both values are worse compared to the 10 min ahead model. This is most likely explained because the model must extrapolate further from the training data. An interesting observation to make is that there are many outliers below the identity line, indicating that those points in the model under-predict the amount of power usage. This negatively affects the HEMS because it does not account for the correct amount of energy consumption at those time steps which results in model mismatch. Model mismatch leads to sub-optimal solutions and reduced cost savings.
The models discussed above allow the MPC application to gain information about outlet and appliance power usage. The MPC can make informed decisions based on these energy flows and is able to optimize the system more fully.

Solar Power Production Prediction Model
Solar Power production varies in magnitude and timing throughout the day. The power production is largely influenced by the size of generation system and the time of day. Properly sized equipment has the potential to eliminate the need to buy electricity from the grid if managed appropriately. As a result, it is crucial that this variable is predicted as accurately as possible to enable maximum energy management benefits. The models created in this work are empirical models trained and validated by EnergyPlus simulation data. The general model equation takes a similar form to the ambient temperature model. The general model equation is seen in Equation (21).
The major difference between the solar power production model and the ambient temperature model is the historical data inputs. Solar power production relies on the surface area of the solar panels and the amount of solar energy. In this work the solar generation system size is a constant. The amount of light received from the sun varies but follows a diurnal trend. As a result, the model equation only needs the time of day to efficiently predict the maximum amount of generated power. This conclusion is also confirmed by looking at the p-values of each potential parameter used to train the regression model. The prediction results for ten-minute and twenty-four-hour forecasts are discussed in detail below. Figure 10 shows the result of the model fit for the 10 min ahead predictions. The fit has a RMSE of 33.5 W. The graphical fit in Figure 10 indicates a good model fit.
The results of the model predicting 24 h in advance are shown in Figure 11. These results have a RMSE of 183.4 Watts. Compared to the 10 min ahead model, this fit is worse and has a larger spread from the actual values. This is due to the outliers seen in Figure 11. This model is trained on more than 54,000 data points and most of the points lie along the line which give a low RMSE but the increased number of outliers cause a larger RMSE. As with the other prediction models, this is explained by the predicted points being extrapolated further away from the training data.
The models developed for predicting solar power production are simple in that they only have one variable, but they fit the data well based on the statistical values and graphical fit. The MPC application uses these predictions to proactively reduce or shift energy flows to maintain home temperature comfort and lower energy costs.

Moving Horizon Estimation and Model Predictive Control Theory
MHE is an established parameter estimation method that uses dynamic optimization over a fixed time horizon of recent measurements to regress current model parameters [33]. This work uses the GEKKO optimization suite [34] for MHE to regress system parameters. Two common MHE objective function forms are the least squares objective and l 1 -norm objective. The least squares objective is influenced by bad data and outliers. The home system may experience issues with the sensors or incorrect data recording so the l 1 -norm objective is used instead to improve parameters estimates while eliminating outliers and measurement noise [33]. The general form of the MHE l 1 -norm objective is shown in Equations (22)- (30). The nomenclature for these equations is listed in Table 3. The l 1 -norm objective uses a dead band to avoid over-fitting the parameters to noise. The l 1 -norm objective also has other benefits such as a penalty for manipulating parameters when there is little or no benefit. MHE only adjusts the model parameters if they are outside of the dead band. This is particularly helpful if a system is at a steady state, when the parameters are weakly observable, or when there is no information content in the data that would necessitate a parameter adjustment.
MHE is often used in conjunction with MPC, which uses the current system parameters regressed by MHE to predict future values given a set of control moves [33]. Dynamic Optimization, MPC, and MHE have wide application across a broad range of industries including continuous chemical process optimization [62][63][64], cryogenic carbon capture [65,66,[66][67][68], energy system capacity planning [69], and drilling automation [70][71][72]. The optimal control over the future prediction horizon is determined by dynamic optimization. This work uses a MHE to determine current building model parameters to use with MPC. In conjunction with weather forecasting, the estimation provides a higher level of accuracy in the predictive control and is a contribution of this work. While these approaches are not individually new, the combination of all elements in a real-time demonstration with a high-fidelity simulator is novel.
Model predictive control seeks to optimize an objective such as minimizing energy consumption or maximizing profit by manipulating controllable system variables at discrete time points in a future time horizon. Dynamic optimization uses a system model, which in this work is an online MHE model. The MPC application in this work uses the control l 1 -norm objective function. The l 1 -norm objective form used by the MPC is seen in Equations (31)- (38). Terms in these equations are listed in Table 3. The control l 1 -norm objective shares many benefits as discussed above in the MHE l 1 -norm discussion. The major difference is that instead of bad data and outlier rejection, the objective form can add priority to different objective functions. This permits multiple objectives which are solved simultaneously in one optimization problem. That is essential for this work because cost and comfort are both objectives and are prioritized with a hierarchy.
0 ≥ e u , e L , c U , c L (30) min x,y,p,d Φ = w T hi e hi + w T lo e lo + y T c y + u T c u + ∆u T c ∆u (31) τ c dy t,hi dt + y t,hi = sp hi (35) τ c dy t,lo dt + y t,lo = sp lo (36) e hi ≥ y − y t,hi (37) e lo ≥ y t,lo − y (38)

Moving Horizon Estimation with Lumped Parameters
MHE calculates the model parameters for the home. The MHE horizon is 36 h long with a one-minute time step. Parameters are estimated by minimizing the difference between the predicted and measured values at 2160 time points that are solved simultaneously as a large-scale optimization problem (23,749 equations, 4 estimated parameters, 2.7 s average solution time). This long time horizon with fine resolution allows the estimator to fit the model to trends that happen daily while also capturing the short-term dynamics of heat transfer through the walls. Figure 12 shows the MHE solution of the system when the MPC is not active. Values for T air,ambient , T air,inside , and Q HVAC are obtained from the EnergyPlus simulator. During this period, a thermostat is controlling the temperature with a dead band. The air conditioner has cyclic on/off behavior as seen in Figure 12. The subplot on the top displays the temperatures of the ambient air, set-points, the air inside the home, and the predicted temperature from the MHE model. The second subplot displays when the air conditioner is on or off and the power consumption of the air conditioner. This plot shows that the MHE predictions match the actual indoor temperature as required to optimize the power consumption.
As discussed in the building house model section, the original model does not extrapolate when the air conditioner is on for longer periods of time. Consequently, a new model is created with extra terms to account for model mismatch error from heat transfer from the ground and the air conditioner on/off status changes (see Figure 13). The simulation results in Figure 13 are less cyclic and show the air conditioner behavior outside of the normal cooling cycles. This is important for the HEMS to predicted temperature for extended periods.

Model Predictive Controller with Forecasts
MPC includes the combination of weather forecasts, market forecasts, and an economic objective function while also updated in real time from the MHE application. The MPC horizon length is 24 h to predict over one full diurnal cycle (10,656 equations, 575 manipulated variable moves, 776 s average solution time). The air conditioner is a binary variable that is generally more difficult to solve than continuous variables. To avoid discrete variables, a hybrid approach is used in this study.
The key to the hybrid approach is to keep the HVAC I/0 variable continuous, but to force it to either be one or zero. Equation (39) and Figure 14 show a function that achieves this goal. In the equation, the parameter A is be adjusted to change the height of the parabola. In Figure 14, several different values of A are plotted. As A decreases, the height of the parabola decreases as well. This is important because Equation (39) is setting this function to be less than or equal to zero. With HVAC I/0 being bounded at zero and one, this expression is only valid when HVAC I/0 equals zero or one and therefore, giving us the discrete-like behavior needed. As a result, if A is too large, then the height of the parabola is too high, and the optimizer gets stuck at the value of zero or one. Alternatively, if A is too low, then the function fails to constrain HVAC I/0 and it can be any value between one and zero. A is consequently optimized to be at the value where it constrains HVAC I/0 to zero or one and so that optimizer effectively explores the design space. The constraint is included in the objective function so that the right side of Equation (39) is minimized. This minimizes the function successfully, but dominates the other objectives in the optimization. This causes results to be sub-optimal with respect to optimal energy consumption. As a result, Equation (39) is developed to use MPCC's to force switching behavior without affecting the other objective functions.
The next component of the MPC is the battery model as detailed in Section 4.6. This battery model is continuous and continuously differentiable even when the equations change between charge and discharge and the larger battery is simplified into a system of smaller battery cells. The battery and home models are connected with the total power demand as seen in Equation (40).
With negative demand, power is either sold back to the grid (if allowed) or charges the battery. With positive demand, the house is supplied with grid power or from the battery. The optimizer includes different sell and buy power prices with slack variables that are added to handle these complementarity constraints. The switching conditions are displayed below in Equations (41)- (45).
Grid buy = Demand − P battery + SV 1 (42) Equation (41) ensures that the power difference between what is purchased or sold from the grid and charged or discharged from the battery is always greater than the demand requirement. Equations (42)- (45) constrain the model to only buy or sell electricity. Equation (45) forces the product of the two-state variable to be less than or equal to zero. This is important for Equation (44) because it enforces complementarity. For example, if P battery − Demand is positive, then SV 1 = P battery − Demand and SV 2 has to equal 0 to obey the constraint in Equation (45). This observation is critical when looking at Equations (42) and (43). To continue with the example, if SV 1 = P battery − Demand, then Equation (42) reduces to Grid buy = 0. Alternatively, if SV 2 = 0, then Equation (43) reduces to Grid sell = P battery − Demand. Therefore, the model is successfully constrained to only buy or sell electricity. As a last check of consistency, P battery − Demand is set to be positive, indicating that the power in the system is greater than what is required by the home. As a result, this extra power is sold back to the grid which is explained by Equation (43) because it reduces to Grid sell = P battery − Demand.
Lastly, the end goal of the MPC application in the HEMS is to reduce costs and increase revenue if possible. To do this, the model relates energy to an economic objective as seen in Equations (46)- (48).
The MPC maximizes Pro f it as shown in Equation (48).
Cost = Grid buy Price electricity (47) The goal of the energy management system is to make proactive changes that account for weather and market forecasts. Forecasting models inform the MPC of changes to future load demand. Before each MPC solve, the forecasting models predict new loads to make proactive optimization decisions.
One of the MPC solutions is shown in Figure 15. The first subplot displays the predicted temperatures from the house air conditioning model. The second subplot shows when the air conditioner is on or off as well as the battery state of charge. In the third subplot, the pricing schemes for buying and selling electricity are shown. Lastly, the fourth subplot shows the predicted solar power produced and the predicted house power demand.
Validation is performed with a physics-based model to determine the effectiveness of the MHE and MPC in minimizing electricity cost with a reduced-order model. The above results indicate that the model works. First, when the air conditioner is on, the house temperature drops. Second, the price of electricity increases for a few hours during the MPC horizon and during this period, the MPC uses the air conditioning as little as possible in an effort to minimize costs, especially when costs are expected to be high. Last, when the amount of solar power production is greater than the demand of the home, the extra energy from the system is being sent into the battery and the SOC increases.

Case Study Results
The following case study shows the results of applying the HEMS to manage the energy in a home with battery storage and a PV system. These results are then compared to identical homes and climates so that the improvements are quantified.  show the results of a one-day simulation of a 3350 square foot home in Phoenix, Arizona. This house is equipped with a 5.0 kW crystalline silicon rooftop PV system, a 14,000-kWh battery based on commercially available home batteries, and a 5 ton central air conditioning system.

Base Case
For comparison, a base case shows the performance of a typical home control system. The first plot shows the ambient temperature, air temperature inside the home, and the temperature set-points. As expected, the air conditioner goes through repetitive cycles to maintain the temperature inside the home. During the hottest period of the day, the air conditioner stays on for a long period. This behavior is also seen in the second subplot which shows the status of the HVAC system. The third subplot shows the pricing structure for purchasing energy and for selling it through net metering. In the last subplot, energy flows are shown for the home. This includes the production of solar power, the amount of energy purchased from the grid and the amount of energy sent back to the grid. Energy on the positive half of the plot help reduce the optimizer objective function whereas the negative half will increase the objective function.
The first important trend to notice is that purchasing price is at its highest when the air conditioner runs the most. This is caused because energy prices are set higher during peak hours of the day due to the increase in demand. Therefore, the energy load is what ultimately drives the prices. Successful energy management software should shift or lower the load peak so that penalty for buying energy during high prices is minimized. This is accomplished by pre-cooling the home or using energy storage to run the air conditioner.
Another important trend to recognize is that the solar power production follows the same pattern as the changes in ambient temperature. Energy demand is usually at its highest during the hottest time of the day; however, with a solar kit, energy demand can be lowered significantly. It is particularly important for a house with no optimization because it helps lower energy costs without the need for process decisions. An optimizer, however, should be able to manage the energy production more effectively with the use of energy storage.

Optimized Case
Once the base case in Figure 16 is understood, it is easier to realize the improvements achieved due to the HEMS. Figure 17 below shows the plots of the optimized home. The simulation inputs are identical to those used in the base case. This means the house, weather data, occupancy data, and appliance schedules are all identical. The main difference is that the optimized case has the option to use a battery to store and discharge energy. To make sure that the net energy in both cases are equal, the battery is constrained to start and end with the simulation day with the same SOC.
The first subplot in Figure 17 shows the actual ambient temperature and temperature inside the home. It shows that the temperature in the home stays near the comfort range chosen by the user which is critical to the overall success of the HEMS. It is important to notice that around 4:00 p.m., the house temperature actually goes beyond the high comfort set-point. This results from balancing the multi-objective optimization problem. In this situation there is heavy weighting on the economic objective which allows the house temperature to rise above the set-point. The weight is adjusted to keep the temperature below this limit if that is the desired result.
The second subplot of Figure 17, shows the status of the air conditioner and the battery. This subplot is significantly different compared to Figure 16. In the base case, the air conditioner cycles on and off regularly. The optimized case has a more methodical approach to turning the air conditioner on and off. The main reason for this change is that a typical thermostat operates between a cooling temperature and a shutoff temperature whereas the optimized case has the freedom to move freely as long as it is within the comfort range set by the user. As a result, the air conditioner can turn on for longer periods of time and eliminate unnecessary cycling. Another difference is that in the optimized case, the air conditioner is scheduled to come on at better times. The price of electricity increases at 2:00 p.m. and as a result the optimizer starts to proactively cool the home to avoid the additional costs.
SOC of the home battery system is also displayed on the second subplot of Figure 17. The battery remains relatively inactive until the solar panels begin to produce power. At that point, the battery builds up its charge until the increase in price for electricity. If the air conditioner needs to be run during this high price period, then the battery discharges to lower the demand require by the grid. This allows the system to stay in the comfort limits at all times of the day while also reducing the cost of electricity. Lastly, there are important improvements seen in the fourth subplot in Figure 17. This plot shows the evidence that system changes make a difference. The power needed from the grid is not completely mitigated but it is reduced compared to the base case. The amount of energy sold back to the grid in both cases differs by only 1.21% different.
These results indicate that the savings come from scheduling appliances and reducing consumption rather than selling energy back to the grid for profit. This result may differ if the pricing structures changes, allowing the net metering to be more profitable.

Comparison to Base Case
The two competing objectives in the HEMS presented in this work are comfort and the cost of electricity. The previous sections show that the comfort constraints are maintained but give little information about the actual economic improvements. The cost of electricity for the base case simulation day is $5.12. On the other hand, the cost of electricity for the optimized energy system is $3.05. That equates to a savings of $2.07 or a 40% decrease in energy cost. The optimizer also reduces the number of times the air conditioner unit cycles on/off which decreases the amount of damage to the system. Decreasing damage will lower long-term maintenance costs; however, this is not explored in detail in this work. This is a significant improvement and shows that there is value in using a proactive energy management system to handle residential energy usage in Phoenix, Arizona.
These results are from a simulation run on one of the hottest days of the year in Phoenix. The results during other times of the year will vary. Phoenix, Arizona is warm year-round, which suggests that these improvements could be beneficial year-round.

MPC Only HEMS Case Study
To show the benefits of combining MHE and MPC, a simulation is run with the MHE model updates turned off. The MHE application is on for one hour before the MPC application turns on so that model parameter estimations are stable enough to be used in the MPC application. After the one hour, the MHE parameter estimates are held constant and remain static within the MPC application. The MPC uses those estimates for the remainder of the day to optimize the home energy system. The results of this simulation are shown in Figure 18.
The temperature subplot shows that the house temperature fluctuates often. This is due to the optimizer turning the air conditioner on and off repeatedly, and consequently, increases the amount of power consumption. The last subplot of Figure 18 has a significant amount of red compared to the green which indicates that there is more power being consumed than is being generated or saved.

Comparison to Full HEMS Application
To put the effects of removing the MHE application from the HEMS, it is helpful to compare the costs in the optimized and base cases. The HEMS without MHE increased the cost by 155% when compared to the HEMS with both MHE and MPC. Additionally, removing the MHE has an adverse effect on the cost savings that it increases costs by 41% when comparing it to the base case. These results are convincing that aligning the model parameters to the simulated home model is critical to the HEMS developed in this work. As discussed in the Introduction, there are HEMS applications that rely solely on MPC to optimize a home. This is done by developing a robust and comprehensive model. However, these models are more computationally expensive to optimize. This work uses a model that uses the benefits of MHE and MPC which allows the model to remain simple. This is accomplished as the MHE application dynamically changes the model parameters as the system changes. There are many thermodynamic properties that are temperature dependent such as density, heat capacity, etc. As the temperature in the home and the air outside the home change, these parameters also change. By using MHE, these changes are handled appropriately by making new parameter estimations. For the MPC only HEMS, equations would need to be included in the model to help account for these dynamics which explains the additional model complexity.
Another reason MHE is critical to the HEMS in this work is that it estimates parameters based on the system changes made by the MPC. When the MPC optimizes the system, changes to the system may be made. These changes cannot always be predicted and vary from time to time. The MHE application is running in synchronization with the MPC, so it adjusts to the model to match in real time to what the changes made by the MPC.

Conclusions and Future Work
This work demonstrates the ability to use MPC and MHE as a home energy management system in residential homes. The home energy management approach combines weather forecasts, energy consumption forecasts, solar production forecasts, a battery, an air conditioner, and house thermodynamics. All these models are combined to be used in closed loop optimization. MHE estimates uncertain house thermodynamic and air conditioner model parameters. The MHE application is developed to be able to solve for a variety of different homes and air conditioner units allowing for a broad range of applications. This minimizes the time needed to fit the models to every individual house. This work reaches optimal operation by considering all major elements of a home energy system simultaneously. Lower energy costs and improved grid energy use are achieved by automatically controlling air conditioner and battery usage.
Another innovation of this work is the use of MPCCs to model the on/off behavior of an air conditioning unit, allowing the system to be solved with gradient-based solvers. In most cases, gradient-based solvers are faster and more reliable than genetic solving algorithms or mixed-integer methods. Genetic solving algorithms are commonly used when solving a model with one or more discrete variables. This work shows that by using the MPCCs to change the on/off behavior from discrete to continuous, dynamic optimization is used to control a home energy system in close to real-time speeds.
EnergyPlus is used to simulate a 3350 square foot home in Phoenix, Arizona. The initial test uses a typical temperature control scheme with no energy management. Another test is run which implements the HEMS developed in this work. Results of the comparison between these two tests show a cost and energy reduction of 40% and 21% respectively. These improvements have a positive impact on grid stability and peak load because the energy consumption is spread out more evenly throughout the day. Computational speed and model accuracy are also considered in this work. For the above case study, there are 23,749 equations and 4 degrees of freedom for every MHE solution. The problem is large due to the 36-hour time horizon. The average solution takes 2.76 clock seconds and around 5 iterations to solve. These results are a direct impact of a simple model. The MPC application is much more complex due to the additional models and model interactions. The MPC has 10,656 equations and 11,231 variables to optimize over the 24-h horizon. The initial MPC solution time is 776 clock seconds and 3954 iterations. Subsequent MPC solutions average 318 seconds and 1735 iterations. There is a major difference because the first solution must completely initialize, and subsequent solutions use the previous solution to initialize the optimizer and converge to the new solution about 59% faster.
Lastly, the benefits of including both MHE and MPC in the HEMS are analyzed. For each MHE plus MPC solution it takes roughly 5.3 clock minutes. Each solution time step is 10 min apart so there is sufficient amount of time for HEMS application to run before the next system change. Using only MPC in the HEMS with the models developed in this work increase the costs of electricity by 41% compared to the base case or 155% when compared to the HEMS that includes both MHE and MPC. Using both MHE and MPC allows models to be simple while also flexible to adjust to changes to the system. Using this approach allows HEMS applications to solve quickly and retain enough accuracy to decrease electricity costs.
Future work should expand these methods to include the following: (1) additional testing in different climates and seasons, (2) additional testing on various pricing schemes, (3) more elaborate forecasting models by including additional parameters and non-linear terms, and (4) ways to investigate and improve solve time and solver reliability to access the viability of using on an actual home energy system. This work tests the optimization software on a residential home in Phoenix, Arizona. Future work should explore the benefits of applying the home energy management software developed in this work to different climates. Phoenix, Arizona is warm year-round and requires significant use of an air conditioner. Other climates have a smaller dependency on air conditioners which affects the total effectively of the software. This testing should also expand to testing during different seasons throughout the year for similar reasons. Future work can also benefit from incorporating a furnace model for colder climates so the energy consumption can be optimized for all weather conditions.
Pricing schemes vary based on location and utility. This work focuses on a basic on-peak, off-peak pricing structure. Future work should explore real-time pricing (RTP) schemes, more complex (TOU) schemes, and other pricing schemes to see which schemes are more conducive for the home energy management system efficiency. The research can be expanded to develop a more optimal pricing scheme that could be presented to utility companies.
The forecasting models in this work are accurate, but basic and location-specific. For example, this work trains the forecasting models to data specific to Phoenix, Arizona. Although these models can be re-trained for new locations, it is a tedious and time-consuming task. Future work can develop these forecasts to be more robust and flexible which would allow this software to be easily implemented into wider range of homes and locations.
Finally, these results need to be implemented and tested on a physical building in real time. Currently, these optimization algorithms have only been tested on a simulated house with a simulated time frame. Future work should expand the study to test the energy management system in an actual home to see if the results can produce similar findings to those found during simulation. Field testing would help determine if the energy management system developed in this work is accurate and flexible enough to be implemented into real residential energy systems.

Conflicts of Interest:
The authors declare no conflict of interest. USTAR had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.