Co-Simulation of Electric Power Distribution Systems and Buildings Including Ultra-Fast HVAC Models and Optimal DER Control

: Smart homes and virtual power plant (VPP) controls are growing ﬁelds of research with potential for improved electric power grid operation. A novel testbed for the co-simulation of electric power distribution systems and distributed energy resources (DERs) is employed to evaluate VPP scenarios and propose an optimization procedure. DERs of speciﬁc interest include behind-the-meter (BTM) solar photovoltaic (PV) systems as well as heating, ventilation, and air-conditioning (HVAC) systems. The simulation of HVAC systems is enabled by a machine learning procedure that produces ultra-fast models for electric power and indoor temperature of associated buildings that are up to 133 times faster than typical white-box implementations. Hundreds of these models, each with different properties, are randomly populated into a modiﬁed IEEE 123-bus test system to represent a typical U.S. community. Advanced VPP controls are developed based on the Consumer Technology Association (CTA) 2045 standard to leverage HVAC systems as generalized energy storage (GES) such that BTM solar PV is better utilized locally and occurrences of distribution system power peaks are reduced, while also maintaining occupant thermal comfort. An optimization is performed to determine the best control settings for targeted peak power and total daily energy increase minimization with example peak load reductions of 25+%.


Introduction
Residential loads constituted 21% of the U.S. total annual energy in 2021 as compared to commercial at 18% [1].Within these communities, heating, ventilation, and air-conditioning (HVAC) systems are the dominant load at around 50% of total typical building loads.There is significant opportunity in leveraging distributed energy resources (DERs) like HVAC systems as energy storage solutions to shift or shape load over time through virtual power plant (VPP) controls [2,3].
Early studies from Sandia National Laboratory in 2017 defined the VPP concept as the coordinated control of decentralized DERs, which include renewable energy generation and energy storage.VPPs may be implemented in microgrids and in conventional electric power distribution system networks such that they behave as a single entity with dispatchable and responsive resources [4].Sandia National Laboratory also investigated object oriented VPP implementation through full state feedback and concluded that accurate physics-based modeling and accurate estimation of dynamic states in real-time is integral.Additionally, they asserted VPP will replace ancillary services, such as frequency regulation and grid disturbance responses, that are required by electric power utilities, ISOs, and RTOs.This assertion is due to faster response times compared to large fossil fuel power plants [5].Visual depiction of the novel co-simulation testbed including hundreds of CTA-2045 control compatible HVAC and building modules.Smart homes with physics-informed machine learning HVAC system models and distinct energy profiles for typical base load from human behavior are employed.Through the proposed testbed, individually unique house models for both electric power and indoor temperature may be simulated at the building and power system level for a representative community.Other DER types with controls, such as solar PV and battery energy storage (BES) systems, may be incorporated.
The VPP research field has grow significantly and wide spread efforts to summarize the development and previous control studies, including optimization, has been undertaken in review papers.Naval et al. summarized the types of optimization problems, heuristic methods, and mathematical approaches that researchers have proposed for VPP coordinated controls.Market schemes that employ mixed-integer linear programming and branch-and-bound-methods were found to be the most common from among more than 100 references [6].VPP optimization studies that incorporate economic objectives were typically formulated for day-ahead market predictions to minimize costs and operational risk while maximizing profit.
State-of-the-art resources considered as part of the VPP include gas turbines, wind power, solar photovoltaic (PV) systems, pumped storage and hydro electric systems, combined heat and power plants, boilers, energy storage systems, flexible loads, and electric vehicles.A limitation of the studies identified is that they were rarely applied to real cases where industrial processes such as the management of energy consumption and generation must be monitored and modeled, indicating future work in the field.The methodology proposed in this work is distinct from previous methods because realistic and representative modeling of HVAC systems as flexible loads is employed, and the optimization objective function is integrated with OpenDSS power system software to consider physical modeling of the distribution system, which is nonlinear to select optimal control start and end times.
The REV Demonstration for Clean VPP was an early initiative to implement this type of controls in the field, by Con Edison in New York.It included a platform for aggregated control of residential solar PV and energy storage to alleviate strain on night peaking distribution systems [7].Unfortunately, due to difficulty obtaining approvals with government agencies for the installation of batteries, the project was not able to be carried out [8].This highlights an important challenge for VPP implementation that may be alleviated with use of standardized energy control protocols and reduced additional equipment such as implemented in this paper.
Another field demonstration launching in 2022 to the public is the Shelter Valley VPP conducted by the SDGE Utility and EPRI in San Diego, USA.It includes initiatives to control thermostats, batteries, water heaters, and blinds in a vulnerable grid region to reduce outages [9].Additionally, a very recent industry report conducted for Google found that VPP could perform as reliably as conventional resources at a similar scale [10], if key barriers are addressed and program limitations such as how often and when programs may be called.Considering societal benefits, the potential of VPP was estimated to be negative net cost to the utility and approximately $15-35 billion dollars cheaper than alternatives for 60GW of power over the next decade.
Overall, controls for load manipulation are invaluable tools for utilities to manage the emerging smart grid and optimally utilize increasingly more prevalent and intermittent demand-side generators, such as behind-the-meter (BTM) PV systems [11][12][13].As a promising DER type, battery energy storage systems (BESSs) are effective for utility grid energy management although the challenge of increased cost still needs to be addressed.[13][14][15][16].They also require planning and coordination strategies through simulation to ensure adequate sizing for other DERs that may generate power intermittently [17].Such DERs can benefit greatly by co-location of BESSs in terms of grid interconnection and cost-effectiveness [18].
As an alternative to BESSs, HVAC and water heating systems that are already widely available offer similar functionality when operated as generalized energy storage (GES) with additional appliance-specific constraints that are typically associated with occupant comfort and weather effects.Control strategies can be developed and tested through co-simulation [12,19].They are an integral part of the smart grid, especially those that coordinate multiple types of DERs, such as solar PV and GES.The simulation testbeds themselves enable the development of VPP control schemes and in the planning of DER deployment through large-scale studies [20,21].
There are four main original contributions included in this paper.First, a methodology to synthesize representative communities of hundreds+ ultra-fast and distinct models for residential buildings employing EnergyPlus, machine learning, and minimal experimental data is proposed.This methodology is used in the second original contribution-a novel co-simulation framework between OpenDSS and python for real-time, time series modeling and controls of individual models for building and HVAC load as well as PV generation per node of electric power distribution system selected.An additional contribution is the demonstration of the benefits of gradual sequential controls and incremental HVAC temperature set point adjustments in simulations of the VPP through the co-simulation framework.Finally, the last main contribution is the development of an optimization procedure for industry standard based controls to select time windows for VPP operation while accounting for consumer comfort and physical behavior of the distribution system.
Further details of the of the main contributions includes that the novel testbed for co-simulation and holistic framework for control strategy development employs numerous GES systems, namely HVAC systems, and DERs based on the Consumer Technology Association (CTA) 2045 standard [22,23].This industry standard specifies a modular communications interface to streamline communications so that any residential device may connect to any type of demand response system.A physical communications module is specified to use the widely compatible RS-485 serial communication method with the appliance and then secure transport protocol such as Wi-Fi, ZigBee, etc. to any energy management system.Serial opcodes are also specified for demand response commands "load-up" to increase the energy use and "shed" to decrease the energy use.These commands are suitable for interoperable VPPs across communities with different device manufacturers.The development of CTA-2045 based controls with "load-up" and "shed" commands conducted in this paper at both the power system and individual building levels is enabled by the proposed framework, which is facilitated by a physics-informed machine learning modeling procedure that is must faster than conventional white-box implementations.
The advanced control methodologies utilized incorporate HVAC system sequential phasing in batches of houses throughout the community and more gradual changes in setpoint temperatures.Also, the multi-objective control optimization proposed has the objectives to minimize targeted power peaks and possible resulting increases in total energy use.Independent variables for the optimization include "shed" and "load-up" control times for the HVAC systems, which are command types based on the CTA-2045 standard and made possible by GES characterization that inherently considers occupant thermal comfort.
In section 2, the models for DER, including generators and energy storage, are established.Section 3 provides the operation of the DERs in aggregate at the power system level considering different control and distribution-side generation scenarios.Section 4 formulates the optimization of HVAC system GES control settings.The results of the optimization and preceding central composite and full factorial simulation experiments are discussed in section 5. Having determined a "best compormise" set of optimal settings, section 6 further explores the effects of the control on individual buildings and occupants, and conclusions are provided in section 7.

Models for PV Generation and Energy Storage
A novel framework for co-simulation of DERs and distribution systems is utilized as a testbed for control schemes, GES, and DER deployment (Fig. 1).The building models employed in the co-simulation framework consist of four components: residential rooftop solar PV systems, thermal building envelopes, HVAC systems, and base loads (i.e., other human behavior-tied electric loads).As a basis for the HVAC and building components, three houses ranging from conventional to near-net-zero energy (NNZE) performance, were modeled and calibrated in EnergyPlus [24,25] to represent a spectrum of energy efficiencies as seen in experimental residential communities.EnergyPlus is the U.S. Department of Energy's flagship physics-based, white-box simulator for whole-building modeling including the effects of building construction and weather on HVAC system energy calculations.
Through the new EnergyPlus Python plugin, the novel co-simulation framework and testbed was developed to synthesize hundreds+ of different house models by varying the input parameters of the base conventional EnergyPlus building model, such as internal HVAC and building construction characteristics.A normal distribution of key building characteristics spanning from the lower efficiency conventional house to highly efficiency NNZE house was used to ensure adequate and representative randomness between houses.Heating and cooling thermal energy capacities, air flow rates, and coefficients of performance (COP) are examples of the varied HVAC internal parameters to create the distinct synthetic community of houses.Additionally, examples of input building characteristics that are unique between individual houses in the study include specific heat, conductivity, density, and thickness of construction materials such as studs, insulation; associated air cavities for walls and roofing as well as for attic trusses and additional ceiling insulation; solar heat gain coefficients (SHGCs); and window U-factors.The next step in the proposed novel framework is to simulate the newly synthesized EnergyPlus models for an example location, time period, and subsequent weather; as a result, synthetic data of HVAC power and energy and indoor building temperature for an entire community of individual houses are produced and the training of ultra-fast models enabled.With this synthesized data, machine learning (ML) procedures may be applied to develop physics-informed new black and grey box versions that emulate the EnergyPlus and experimental data.Example methods used in the simulations through out this paper includes a hybrid ML model of k-means clustering to identify weather groupings, multiple linear regression (MLR), and specific heat conversions through thermodynamic equations as visualized in Fig. 2, [26].These methods may be updated in the object-oriented cosimulation framework as further improved methods are proposed.Furthermore, various sizes of communities may be synthesized following the ML procedure, and the individual models produced are satisfactorily accurate in estimating the heating and cooling thermal energy and electric power of the HVAC system, as well as the indoor temperature in the house based on external weather.Ultra-fast simulation that is up to approximately 133 times faster than EnergyPlus is enabled through the proposed framework as well as co-simulation with other software each timestep over time-series simulations of various lengths: daily, monthly, yearly, etc.
The ML models capture the thermal properties of the building and the HVAC system and their relationship with weather from the EnergyPlus training data.As a result, given a long enough training period with a wide range of weather combinations throughout a year, the ultra-fast ML models may not be exclusive to the location of the original experimental data and EnergyPlus models.If the operation of the HVAC system from heating to cooling demand is provided to the ML model in training, then the "V-curve", a method for correlating weather to HVAC power [27,28], and the typical performance is captured.
An example V-curve is illustrated in Fig. 3 from a building in the co-simulation framework.It shows the spectrum of behavior and trends for heating and cooling annually for the heat-pump system.The physical relationship shown in the V-curve along with other weather parameters such as humidity and irradiance may then, in principle, be used by the ML model for estimations of power and indoor temperature with weather from other locations of similar annual climate.It is promising that the advanced ML may be able to apply the physical trends per HVAC system outside the range of temperature, relative humidity, and irradiance in the training set as the performance is fairly linear.
It is important to calculate the building indoor temperature for tracking and prediction of occupant thermal comfort as this is integral for proper, representative HVAC control across different locations.The proposed framework is intentionally designed for VPP studies and comparisons between locations because the only inputs to the HVAC and building simulators are from human behavior/preference, weather, and the indoor temperature.Future work is recommended to conduct an in-depth VPP study at different locations where the benefit and improved grid resiliency from the controls may be quantified to determine optimal areas for infrastructure investment, such as [29] for EVs.Additional future work recommendations are describe at the end of Section 4. As part of the testbed, an HVAC and building simulator is custom-developed to utilize the ML models for co-simulation with a power distribution system and are assigned to appropriate circuit nodes (Figs. 2).Simulation processes and control logic for the HVAC and building simulator is provided in Fig. 4, where t d is indoor temperature deviation; t s , setpoint temperature; t i , indoor temperature; h m , HVAC mode of operation; h s , HVAC on or off status; t db , the thermostat temperature dead-band; t tol , the thermostat temperature tolerance; p h,kW , the HVAC electric active power [kW], t in , the indoor temperature of the next timestep; p f h , the power factor of the HVAC system; p h,kvar , the HVAC electric reactive power [kvar]; pv r , the rated power of the solar PV system [kW]; p pv , the electric active power generated from the solar PV system; p t,kW , the total electric active power of the building [kW]; p t,kvar , the total electric reactive power of the building [kvar]; p b,kW , the electric active power of the base load [kW]; p b,kvar , the electric reactive power of the base load [kvar].
Residential solar PV system modules may be assigned to the individual houses in the framework and simulated through physical equations based on input weather data (Fig. 1).This PV simulator portion of the framework determines generated solar PV power (p g,pv ) as follows: where γ, the solar irradiance [W/m 2 ]; p r,pv , the PV array rated power [W]; k p , the temperature coefficient of maximum power [%/ • C]; η pv , the efficiency considering losses due to the inverter, interconnection of modules with nonidentical properties, and dirt accumulation; t c , the temperature of the PV cells [ • C], which is calculated by: where t o is the outdoor ambient temperature [ • C] and t n is the nominal operating cell temperature [ Typical household appliances and plug-loads, unlike HVAC and PV systems, are not dominantly weather dependent and have more random behavior due to human choices.Therefore, random daily energy profiles of typical house loads, including electronics, water heaters, and lights, may be assigned to each individual house.Minutely household data sourced from the EPRI SHINES project was employed as daily schedules for the following studies [30].The original circuit has a peak load of 3.6MW, 1.3MVAr and is to be representative of a very large residential subdivision in the U.S. Distribution system total active power for the (b) baseline and control cases.This is an aggregation of all building loads minus the power losses across the distribution system without considering any contributions from PV generation.

Power System and DER Operation
To represent a large subdivision in the U.S., the IEEE 123 bus system was co-simulation with the proposed novel framework with representative building simulators based on the methodology described in Section 2. The testbed framework employs time series cosimulation of OpenDSS, a widely used open source power system simulation software, and python to enable geographical information system (GIS) power system modeling of the test system with the proposed optimized controls.To populate the IEEE 123 bus system with synthetic residential load and PV generation, an initialization procedure in the framework was performed to assign a building simulator with HVAC and PV modules to each bus node per 10kW of original peak load (Fig. 5a) [31].
Through this initialization 351 distinct buildings, 52 (15%) of which have a BTM solar PV system with typical power ratings randomly selected between 3 and 7.5kW, are co-simulated with the IEEE 123 bus system.The houses with BTM PV generation capability were distributed throughout the power system to represent gradual adoption patterns of the technology.The proposed methodology to synthesize hundreds of distinct representative homes into building simulators using EnergyPlus and ML was applied using three experimental smart homes from the Tennessee Valley Authority (TVA) with a parameters ranging from conventional to NNZE as described in Section 2. These buildings are then used in the initialization procedure to populate the distribution system.
Following the initialization of the framework, OpenDSS python API commands edit the load at each bus based on building simulator results at each time step before the power flow calculations are solved.In this formulation, the affects of the controls on the residential HVAC load and available PV generation per house is considered individually across the distribution system and at the aggregate level at the main feeder.This is an important contribution of the proposed co-simulation framework because it enables in control development and optimization the assessment and feedback of physical behavior across the distribution system such as load tap changer, voltage regulator, capacitor, and transformer operation; active power demand across lines and buses; and transformer and line power losses.
For the simulated example day, minutely solar irradiance and outdoor temperature data collected in the southeast U.S. is employed as input to the models (Fig. 6a).The baseline simulation case does not include any VPP control, and the HVAC systems operated as they normally would in accordance with their indoor temperature setpoints and associated building thermal properties.At the power distribution system level, the total power ramped up in the morning as both the solar irradiance and outdoor temperature increased (Fig. 5b).HVAC systems constitute almost half of the energy used by typical residences and use more energy as indoor temperature changes [1].As this change in temperature reduced in the midday, the HVAC systems settle into normal operation and maintain indoor temperature near setpoint.
Total system power ramped down as the sun set with a subsequent peak likely due to occupant arrival in the evening.This secondary evening peak is of particular interest as electric vehicle (EV) charging in scenarios of higher penetration may cause a significant system-wide power increase at this time [32].Additionally, the longer midday peak may invert as distributed solar PV becomes more prevalent, which further contributes to the concern of the secondary evening peak (Fig. 6).The reshaping of the residential load profile from higher DER penetration levels, including contributions from solar PV and EVs, may be alleviated by VPP control of other residential loads, such as HVAC systems.
In conventional HVAC control, accounting for occupant thermal comfort is a significant challenge due to the complex relationship between weather, HVAC power, and indoor temperature, which is unique for every building.Incorporating indoor temperature into VPP control schemes that leverage HVAC systems as DER is necessary to abide by occupant thermal comfort preferences.Improved control methods, for example, those utilizing the CTA-2045 protocol for DER demand response and GES operation through Energy Star definitions address the comfort issue by adopting energy storage capacity and equivalent state-of-charge (SOC) calculations [33,34].The equivalent HVAC energy storage capacity and SOC at time t may be calculated following: where the θ max and θ min are the maximum and minimum indoor temperatures, respectively; θ i (t), the indoor temperature at time t; e h,c , the input electric energy required for the HVAC system to reduce indoor temperature from θ max to θ min .
During simulation, the HVAC system and building models that are generally illustrated in Fig. 2 determine their corresponding e c,h (t) internally upon initialization based on their thermal properties and ability to maintain indoor temperature over time.The recalculation of e c,h (t) at multiple timesteps throughout simulation captures effects of weather on the system's, which is similar to self-discharge and changes in capacity of conventional electric BESSs.
When a CTA-2045 command is issued, such as a "shed" or "load-up", the controller adjusts individual building indoor temperature setpoints based upon their e c,h (t), which are determined by considering building thermal properties and typical ASHRAE standard occupant thermal comfort limits [34].Individual building characteristics are considered when re-calculating HVAC setpoints per house and timestep, thereby improving the prediction of the maximal available energy BTM while abiding by indoor temperature comfort settings.By incorporating the consideration of occupant thermal comfort directly into the controls, the degree to which occupant comfort is violated now correlates with the accuracy of the building e c,h (t) estimations and the θ max and θ min settings.

Optimal VPP Control of HVAC Systems
A VPP control scenario is proposed that employs the CTA-2045 command types to reduce the evening peak power.A "load-up" is planned before the evening to pre-cool the houses while they are the least occupied to provide a more sustained "shed" that will turn the HVAC systems off during the evening peak time window.In previous studies into HVAC controls, it has been established that large spikes in aggregate power occur if VPP signals are sent at the same time to hundreds of homes and that using phased deployment of a selected number of houses mitigates the spikes by spacing out the operational periods to not overlap within the control time window [34].With multi-speed HVAC systems as used in this paper, spacing out the setpoint temperature changes in time to gradually reduce from, for example 26C to 22C, further reduces the power spikes as lower speeds operate for a longer period resulting in less power draw per house at a given time.For these reasons in the case studies throughout this paper.The indoor temperature setpoint adjustments are issued incrementally over the first thirty minutes of the control period to provide a gradual change in power over time.
Additionally, these advanced controls employ phasing before and after active periods, by which batches of randomly selected HVAC systems are sequentially engaged and disengaged from the control as illustrated in Fig. 7a.The box-and-whisker format employed throughout is such that the box extends from the first quartile to the third quartile with a green line at the median.Whiskers extend from the box by 1.5x the inter-quartile range, and flier points are those past the end of the whiskers.
The improved control functionality prevents power spikes that would have occurred otherwise as illustrated with example case NP in Fig. 5b.In such a case, all of the HVAC systems engaged and disengaged simultaneously as soon as the "load-up" and "shed" controls were issued, thereby causing a large spike and steep drop in total distribution system power.Another power spike occurred in the evening after the "shed" control ended as the HVAC systems resumed cooling all at once (Fig. 13a).
To ensure best performance, the controls are formulated as a multi-objective optimization to minimize both the total distribution system peak power during the evening time period (p a,t=t ep ) and possible resulting increase in total system energy use (e d ) over the example day, which are formally defined as: 5) where n l , the total number of lines; w a,l,i , the active power losses over line number i; n x , the total number of transformers; w a,x,j , the active power losses at transformer number j; n d , the total number of loads; p a,d,i , the active power demand at load number i; t ep , the moment of maximum power in the evening peak time window of 5:30 to 9:00; n t , the total number of timesteps (minutes) in the day.
The aggregate peak power during the evening time between 5:30 and 9pm was selected as the first optimization objective, p a,t=t ep , because this is the time during the day where typically utilities are most vulnerable to strain and congestion on the distribution system as it corresponds to increased amounts of human behavior driven load following return from work during the business week, including EV charging.The optimization of the VPP controls is considered passed for this metric if the peak power in the evening is reduced by more than five percent to outperform estimates from conservation voltage reduction (CVR) [35], another proposed method for power shifting, in benefit the utility and grid resiliency.
A second objective, the daily total energy demand, e d , is included to prevent large increases in total energy use for marginal improvements in peak power reduction.For example, a positive e d value indicates that the energy used during the "load-up" command to pre-cool the homes through the HVAC systems is greater than that of the avoided energy use during the "shed" command.Such a scenario presents a trade-off between p a,t=t ep and e d as both are to be minimized and have importance in the usefulness of the controls to improve overall grid resiliency without environmental impact from large increases in total daily load demand that would be more difficult to offset with increased DER penetration.In this case, a Pareto set of best control design candidates is beneficial as part of the optimization to determine the optimal solution.
The independent variables of the control optimization include the "load-up" start time, the control transition time, and the "shed" end time.To establish independent variable bounds, a central composite and full factorial designs of experiments (DOE) with response surfaces were performed (Figs. 8 and 9).The response surfaces for both the central composite and full factorial suggest the minimums for e d and p a,t=t ep are achieved with "load-up" start, control transition, and "shed" end times of 8:00, 15:00, and 22:00, respectively.Based on the DOEs, p a,t=t ep is significantly less dependent upon "load-up" start time than the other independent variables.With HVAC systems having been characterized as GES, they may be employed as battery energy storage systems from the perspective of the power distributions system with special availability constraints.Availability for HVAC systems is associated with the thermal comfort of occupants and the assurance of service quality by the utility.Therefore, constraints on indoor temperature are incorporated into each individual building implicitly and are not explicitly applied by the optimization by having included an automatic thermostat control mechanism that disengages the HVAC system from the control command when an equivalent SOC bound is met.The equivalent energy capacities and SOC bounds are determined by minimum and maximum allowed temperatures, which are based on ASHRAE standards in this work, and they may be further customized by user application in real-world implementations.
The non-dominated sorting genetic algorithm (NSGA) III is utilized for the full optimization [36].Based on the CC and FF DOE, bounds were selected for each independent variable: 6:00-8:00 for the "load-up" start time, 15:00-17:00 for the control transition period, and 22:00-24:00 for the "shed" end time, respectively.Increments of five (5) minutes were   Table 1.Results of optimal designs from the Pareto set and the baseline cases, including the maximum power during the evening peak (on-peak) as well as total energy for the full day, the on-peak time window, and off-peak time window.allowed within these independent variable bonds for design candidates.Comprised of over 750 simulation cases, the optimization confirms the relationships established by the central composite and full factorial DOEs (Fig. 11).The dependency of p a,t=t ep on "load-up" start time is more evident in the full optimization and opposes the objective to minimize e d .Therefore, a Pareto front of eleven (11) best control settings is determined that showcases the inverse relationship between max power during the evening peak (p a,t=t ep ) and total day energy use (e d ) (Figs. 10a, 10b, and 11).
The approach taken in this work, assumed that all home owners in the distribution system would enroll in the VPP program and all were equipped with the CTA-2045 communication module on their HVAC systems.It also assumed that a financial system existed in the market to compensate the home owner for their increased air conditioning flexibility and potentially higher total daily energy usage.Further work could develop estimates for user participation rates and expectations for compensation.Additionally, the optimization enabled by the co-simulation framework with ML-based load modeling could be expanded to include higher diversity of building types, consumer preferences, and locations in different climate regions for comparative VPP studies.In the future, modules for EVs, BESS, and water heaters, second largest appliance, could be also be added for an optimization of GES.Table 2.The control time settings and resulting percent change with respect to the baseline case for all simulated cases in terms of maximum power during the evening peak (on-peak) as well as total energy for the full day, the on-peak time window, and off-peak time window.

Case Study and Discussion of Optimal Control Settings
The Pareto set of optimal control settings provides designs that reduce p a,t=t ep within a range of 24.45% and 28.75% by enacting the "shed" command (Tables 1 and 2).Such significant reduction in p a,t=t ep is in part enabled by the pre-cooling of buildings through the "load-up" command, which, in theses case, increased e d by 7.98% to 10.73%.Of the considered optimal control designs, P1 yielded the most reduction in p a,t=t ep at 1.03MW (28.75%) and experienced the largest increase in e d of 2.07MWh (10.73%)during "loadup" with respect to the baseline case.P10 represents the other extreme with a p a,t=t ep reduction and e d increase of 0.29MW (24.45%) and 1.54MWh (7.98%), respectively.The "best compromise" case of P6 achieved a p a,t=t ep reduction of 0.32MW (26.83%) with a e d increase of 1.63MWh (8.42%).The results of the two most extreme cases, P1 and P10, are emboldened, and the "best compromise" case, P6, is both emboldened and italicized in tables 1, 2, and 3.
If residential energy storage systems (RESSs) were to be utilized instead to realize the results of P6, each house would require an approximate RESS capacity of 5.2kWh, or 1.83MWh in total, based on the additional energy used in P6 during the "load-up" control window provided in Table 3.With a typical Tesla Powerwall as a currently available example RESS, which is rated at 13.5kWh in capacity [37], around 136 out of the 351 simulated houses would need to adopt the technology in order to achieve the same effect.Assuming a typical RESS round-trip efficiency of 86%, the RESSs would expend around 0.26MWh in total e d as losses [38].The e d increase of 1.63MWh for P6 may be recuperated over the following day(s) through specific controls, such as extended and more gradual "shed" commands.
From the utility perspective, the "load up" during midday is timed such that energy generated by solar PV may be better utilized locally.Considering distribution system configurations with high penetration levels of solar PV and utility-scale renewable generation, improved BTM PV utilization by loading-up midday would also reduce total associated carbon emissions even with increased e d as it would essentially replace higher carbon-emitting generation during the eliminated evening peak.
For the control and baseline cases at different levels of penetration, table 4 provides the BTM PV utilization factor, which represents the percentage of solar PV generation used BTM and not fed back to the utility.Generated energy begins to exceed the load demand and is fed back onto the transmission system once solar PV adoption surpasses 45% of the distribution system.Each of the control cases improved BTM solar PV utilization by approximately 3% to 8% across penetration levels.To further elaborate upon the features of the co-simulation framework as well as the effects of the optimal VPP controls at both the power system and individual occupant levels, P6, the "best compromise", is considered as the primary control case and discussed in further detail in the next section.

Individual Building and Occupant Effects
As the individual buildings experience large changes in indoor temperature due to quickly increasing outdoor ambient temperature and solar irradiance as the sun rises in the morning, HVAC systems will use more energy to maintain indoor temperature setpoints (Figs.6a, 13a, and 12b).Once the transition into daytime is complete, the HVAC systems enter normal operation to maintain the indoor temperature, which requires less energy as the change in outdoor temperature is significantly lower.As shown in Fig. 6b, BTM solar PV generation exacerbates the additional peak in the evening.
The "load-up" and "shed" command types enact energy shifting rather than saving.They are useful for reducing total system power peaks and shifting energy in time such that BTM renewable energy may be better utilized.HVAC systems will increase energy use as the "load up" event decreases the setpoint temperature.This pre-cooling creates a larger range for temperature to increase during "shed", which allows for a more sustained and significant drop in total system power during the on-peak time window (Fig. 13a).Upon control issuance, HVAC systems respond independently to newly assigned indoor temperature setpoints that are based upon their own unique electric energy capacities and equivalent SOCs, which innately considers occupant comfort limits according to ASHRAE standards [34].Indoor temperatures change at different rates between houses due to differing thermal properties and construction until equivalent SOC reaches a maximum bound (Figs.13a, 13b).Since the equivalent SOC of the individual buildings is dependent upon their estimated energy capacities, indoor temperatures may deviate from thermal comfort bounds for a short time.Such violations may be mitigated by improving the energy capacity estimation or by implementing tighter minimum and maximum SOC bounds.

Conclusion
A novel co-simulation framework is employed to optimize virtual power plant (VPP) controls that leverage heating, ventilation, and air-conditioning (HVAC) systems as generalized energy storage (GES) to reduce a targeted distribution system power peak, while better utilizing behind-the-meter (BTM) solar PV locally.The incorporation of HVAC system phasing and gradual setpoint change functions effectively prevents power system peaking or dropping from start or completion of controls.The minimization of on-peak maximum power reduction (p a,t=t ep ) and possible resulting total day energy use increase (e d ) can compete in certain scenarios.Therefore, the optimization produced a Pareto set of best designs with control settings that achieve a p a,t=t ep of 24.45% to 28.75% and experience an increase in e d of 7.98% to 10.73%.Each design yields improved BTM solar PV utilization by approximately 3% to 8% because of the "load-up" timing.
From among the best control designs, P6 offers a "best compromise" with a p a,t=t ep reduction of 0.32MW (26.83%) and an e d increase of 1.63MWh (8.42%).If residential energy storage systems (RESSs) were to be utilized instead to realize the same results as P6 with HVAC system control only, they would require a combined capacity of approximately 1.83MWh.Assuming a typical RESS round-trip efficiency of 86%, the RESS would expend around 0.26MWh in e d as losses.In contrast, the 1.63MWh increase in e d in P6 to achieve a more significant p a,t=t ep may be recuperated over the following day(s) through specific controls.For the P6 optimal control case, the individual building and occupant effects are observed, including indoor temperature and equivalent state-of-charge (SOC), which is made possible by the individual modeling of HVAC and building systems within the co-simulation framework.The ability to simulate individual effects in this way, which enables their incorporation into distributed energy resource (DER) control methodologies, is integral for consideration of occupant thermal comfort during HVAC system control events.

Nomenclature
The following main symbols and abbreviations are employed in this manuscript: HVAC input electric energy required to reduce from θ max to θ min p a,t=t ep Total distribution peak power during evening period e d

DERs
Daily increase in total energy use n l , n x , and n d Total number of distribution system lines, transformers, and loads w a,l,i Active power losses over line number i w a,x,j Active power losses at transformer number j p a,d,i Active power demand at load number i t ep Moment of maximum power in the evening peak window n t Total number of time steps P1 -P11 Pareto front eleven points

Fig. 1 .
Fig. 1.Visual depiction of the novel co-simulation testbed including hundreds of CTA-2045 control compatible HVAC and building modules.Smart homes with physics-informed machine learning HVAC system models and distinct energy profiles for typical base load from human behavior are employed.Through the proposed testbed, individually unique house models for both electric power and indoor temperature may be simulated at the building and power system level for a representative community.Other DER types with controls, such as solar PV and battery energy storage (BES) systems, may be incorporated.

Fig. 2 .
Fig. 2. Visual depiction of the time-dependent HVAC and building simulator.Explicit CTA-2045 commands are issued, and Energy Star GES performance metrics, such as energy take, equivalent SOC, and electric energy capacity, may be estimated through the building simulator.

Fig. 3 .
Fig.3.Example HVAC "V-curve" and physical relationship between weather parameters and power captured by the ML model.In principle, the ML model may be applied with weather at different locations and employ the approximately linear trends to estimate the power demand.

Fig. 4 .
Fig. 4. Flowchart for the HVAC and building simulator that employs ML HVAC models as well as the PV simulator.

Fig. 5 .
Fig. 5.The circuit diagram for (a) the modified IEEE 123-bus test system.The original circuit has a peak load of 3.6MW, 1.3MVAr and is to be representative of a very large residential subdivision in the U.S. Distribution system total active power for the (b) baseline and control cases.This is an aggregation of all building loads minus the power losses across the distribution system without considering any contributions from PV generation.

Fig. 6 .
Fig. 6. Results for the (a) distribution system total solar PV power generation and (b) total net power for the simulated 15% and estimated solar PV penetration cases of up to 100%.The variability in solar PV power generation is caused by variability in irradiance.

Fig. 7 .
Fig. 7. Simulation results for (a) individual on/off statuses for HVACs to show control phasing in the baseline case (top) and in case P6 (bottom) as well as (b) hourly average bus voltages for both the baseline and P6 cases.The "load-up" and "shed" event windows are shaded in light gray and purple, respectively.This format is replicated in following figures.

Fig. 8 .
Fig. 8. Resulting evaluation of optimization objectives for both the central composite (CC) and full factorial (FF) design of experiments (DOEs) with respect to the baseline case.The VPP controls are capable of reducing the maximum peak power as shown by the CC and FF results to the left of the baseline case, indicating that an optimization to select the control windows is justified and would be beneficial.

Fig. 9 .
Fig. 9. Response surfaces for the CC (left) and FF (right) DOEs serve as a sanity check for the optimization by indicating the relationship between the independent variables and the optimization objectives.In application of the optimization on different distribution circuits, the CC and FF may be run quickly first to estimate the benefit of the VPP controls.

Fig. 10 .
Fig. 10.Resulting (a) objective evaluations and (b) a cropped view of all cases simulated during the NSGA-III optimization with respect to the baseline case and with the Pareto front of the eleven (11) best cases indicated.

Fig. 11 .
Fig. 11.Relationships between the two (2) objectives and the three (3) independent variables of control times for all simulated cases during the optimization.

Fig. 12 .
Fig. 12. Results for individual building (a) total energy use and (b) HVAC energy use only of the baseline and P6 cases.

Fig. 13 .
Fig. 13.Hourly average (a) indoor temperatures and (b) equivalent SOC, which is inversely related to indoor temperature, of all buildings for the baseline and P6 cases.

Table 3 .
Total energy during the "load-up" and "shed" time windows, which are different for each case based on the input time settings, with and without the controls active.

Table 4 .
The BTM solar PV utilization for the baseline and control cases at different levels of penetration.
Rated power of the solar PV system p pv Electric active power generated by the PV system p t,kW and p t,kvarTotal electric active and reactive power of the building p b,kW and p b,kvar Electric active and reactive power of the baseload