# A Thermal Discomfort Index for Demand Response Control in Residential Water Heaters
## 4 The Proposed Approach for Defining a Discomfort Index
### Defining the Thermal Discomfort Index  
The proposed index is conceived to capture the thermal impact that a user suffers due to an intervention by the electrical company in the electric water heater. The TDI is defined using the defined water use forecasting model and the temperature model. Since every forecast has uncertainty, the index is defined in terms of the expected value of the difference of the aforementioned temperatures, as expressed by Equations (4) and (5). \[TDI(I,u,w)=\int_{t_{\text{ini}}(u)}^{t_{\text{end}}(u)}(T_{n}(t,w)-T_{\text{ int}}(t,w))dt+\rho\int_{t\in\tau}(T_{\text{conf}}-T_{\text{int}}(t,w))dt \tag{4}\]  
In Equation (4), \(TDI(I,u,w)\) represents the discomfort index of an interruption \(I\), a water utilization \(u\), and a realization \(w\) that defines a single scenario of water use and temperature evolution. The values \(t_{\text{ini}}(u)\) and \(t_{\text{end}}(u)\) are the starting and finishing time of utilization \(u\). For every realization \(w\), \(T_{n}(t,w)\) is the temperature curve without interruption and \(T_{\text{int}}(t,w)\) is the temperature curve with interruption. Both curves are obtained using the temperature model described in Section 4.3 for the realization \(w\). Finally, \(T_{\text{conf}}\) is the lowest water temperature that does not produce discomfort to the users, and \(\tau\) represents the time interval in which \(T_{\text{int}}(t,w)\leq T_{\text{conf}}\). The value \(\rho\) is a parameter that acts as a penalty over the area below the comfort temperature. \[TDI(I)=E_{w}\left[\sum_{u\in U(w)}TDI(I,u,w)\right] \tag{5}\]  
In Equation (5), \(I\) denotes the interruption of the electric water heater by the electric company. In turn, \(E_{w}[\cdot]\) represents the expected value of the expression inside parenthesis with respect to the random variable \(w\). Each realization of the random variable \(w\) generates a different forecast of water use. Therefore, a forecast of the temperature obtained using the model described in Section 4.3 is also generated. \(U(w)\) is the set of water utilization intervals in the analyzed time horizon associated with the forecast generated by \(w\). Figure 7 presents a visual representation of \(TDI(I,u,w)\). Two temperature curves are represented on the upper graphic. The full black line represents the water temperature when no interruption occurs. In turn, the dotted black line represents the water temperature when an interruption occurs at time \(t^{*}\). The green area between the curve of water temperature without interruption and the curve of water temperature with interruption (defined by the polygon PQRTU) is computed by the integral \(\int_{t_{\text{ini}}(u)}^{t_{\text{end}}(u)}(T_{n}(t,w)-T_{\text{int}}(t,w))dt\). This area represents the heat loss due to the interruption. In turn, the red area below the comfort temperature (defined by the polygon RST) is computed by the integral \(\int_{t\in\tau}(T_{\text{conf}}-T_{\text{int}}(t,w))dt\)  
Figure 6: Graphic representation of \(c_{\text{cool}}\) (**left box**), \(c_{\text{heat}}\) (**middle box**), and \(c_{\text{size}}\) (**right box**). and weighted by the penalty \(\rho\). Introducing the penalty term \(\rho\) is interesting to provide the model the flexibility for adjusting the weight of the red area below the comfort temperature with respect to the whole area of temperature reduction (PQSU). The expected value of TDI, as defined in Equation (4), is computed by applying a Monte Carlo (MC) simulation method. First, the MC method samples 100 realizations of the value \(w\), with a normal distribution \(N(0,1)\). Then, for each value of \(w\), the following procedure is applied:  
* The next 12 h are forecasted using the model described in Section 4.2. Six iterations are applied, considering that the Extra Trees regressor is defined for a period of two hours (120 observations).