## 4 Methodology
### PBLM Models  
PBLM models consider the physical laws of the loads and their environment to determine the behavior and changes in the appliance-environment system. The model defines an energy balance between heat gains and losses, heat generation, considering the storage capacity, and heat leakages (water flows). The control inputs of the model are changes in the setpoint of the thermostats, input/output water, or the control applied to the electricity supply. All these variables account for the service and state of the load at any time. The model needs to be tuned and validated through real submetering measurements or NIALM, including the response of the load to control strategies or other DR policies. According to the required flexibility for the load response (energy, balance, and ancillary services), the location of temperature sensors, and the size of the tank (80-100 L), the proposed HPWH model is a thermal-electrical equivalent model with three masses/zones or 3R3C (to reproduce heat losses and storage of the overall model [24; 25]). The model includes two heat (current) sources: the heat pump (main heat source) and the auxiliary resistor. Figure 3 depicts the HPWH model and its interaction with the environment (X\({}_{\text{P}}\), the temperature of the pipeline, and X\({}_{\text{d}}\), the temperature inside the dwelling). The capacity of the tank is divided into three zones to better represent the water stratification and its effect near temperature sensors without increasing the complexity of the model (Section 3). The three zones are the hot-water zone, WH1 (water outlet); the mixed zone, WH2; and the cold-water zone, WH3 (water inlet; Figure 3). The stratification effect is a phenomenon in which the hot water inside the tank raises to the top of the  
Figure 3: Thermal-Electric equivalent of PBLM for an elemental HPWH load. reservoir while the cold water remains down to the bottom after a draw occurs with a limited mix of flows in the short-term. The main features (and parameters) included in the model are:  
* Heat gains: Two heat sources, the heat pump (H\({}_{\rm HP}\)) and the auxiliary resistor (H\({}_{\rm R}\)). * Heat storage: From the specific heat of water inside each of three masses/zones being considered (Figure 3): C\({}_{1}\), (hot-water zone), C\({}_{2}\) (mixed zone), and C\({}_{3}\) (cold-water zone). This storage capacity depends on the tank size for each zone (WH1-WH2-WH3) and the specific heat of water (Ce). * Heat losses: Through the tank envelope (G\({}_{\rm Ex}\)), through the pipelines (G\({}_{\rm Cx}\)), and the heat losses in the exchange layer between the three zones of the tank (G\({}_{\rm L}\)) (where x = 1, 2, 3). * Water flows: Water flows are represented by dependent current sources (Ce q(t) X\({}_{\rm x}\)(t)), where q(t) is the flow extracted from the reservoir; at a specific water temperature, the flow extracted from the reservoir represents the service that customers obtain and require from this end-use). * Intrusive or non-intrusive control mechanisms: represented by smart thermostats or direct ON/OFF control of supply (compressor or resistors that independently drive m\({}_{\rm HP}\)(t) and m\({}_{\rm R}\)(t) switches, Figure 3). * State variables: they are the temperatures inside the tank, represented by the temperature in each zone of the tank/reservoir (hot/mixed/cold; i.e., X, X\({}_{2}\), X\({}_{3}\)). * System inputs: The temperature of the dwelling in which the load is located (X\({}_{\rm d}\)), the temperature of the inlet water, (X\({}_{\rm P}\)), and water flow q(t), which also determines energy flows. The state-space system for the model in Figure 3 is  
\[ \begin{pmatrix}\text{DX}_{1}\\ \text{DX}_{2}\\ \text{DX}_{3}\end{pmatrix} =