# A Thermal Discomfort Index for Demand Response Control in Residential Water Heaters
## 4 The Proposed Approach for Defining a Discomfort Index
### Water Temperature Model  
#### 4.3.1 Overall Description  
The general formulation of equations for heating and cooling water in thermal tank devices, such as water heaters for domestic use, include a large number of variables. Existing models, even when they simplify the formulations, depend on several variables, including the insulation factor, the ambient temperature, the flow of water used, the time of use, and the tank volume, among other factors [26]. To overcome the difficulties of knowing beforehand all these variables, which are often difficult to determine in practice, the pattern similarity approach proposed for estimating water utilization is applied to define a linear temperature model, which provides a good approximation in order to estimate the TDI. The linear model provides a reasonable approximation, since the cooling and heating curves in this model are straight lines. Five parameters are defined to build the temperature model from gathered data about on blocks and water utilization:  
1. \(T_{min}\) is the temperature at which the electric water heater is turned on by the action of the thermostat when the water is cooling. 2. \(T_{max}\) is the temperature at which the electric water heater is turned off by the action of the thermostat when the water is heating. 3. \(c_{heat}\) is the slope of the line when the electric water heater is turned on. 4. \(c_{cool}\) is the slope of the line when the electric water heater is turned off and no water is being used. 5. \(c_{use}\) is the slope of the line when using water, whether or not water is being used. The considered parameters depend on several factors. In this article, a specific approach is proposed to compute a robust approximation for each parameter value, i.e., to guarantee that all possible temperature approximation errors always produce underestimated temperature values. Thus, the proposed model is conservative about comfort estimation, in order to not affect the quality of service provided to the user. The model assumes that the user sets the thermostat at a temperature value of \(60^{\circ}\), which is the suggested temperature not only to achieve energy efficiency in households, but also due to health concerns, such as avoiding the proliferation of Legionella bacteria [33; 34]. Without loss of generality, the variation range defined by \(T_{min}=55^{\circ}\) and \(T_{max}=65^{\circ}\) is considered. In any case, the proposed model is fully extensible to work with other values of \(T_{min}\) and \(T_{max}\). The use of this model in an industrial context should consider: (i) variations in the set point of the thermostat (e.g., values extracted from statistics or provided by the users via survey or web/mobile application), and (ii) variations in the temperature of the room, in the average water utilization, and in the temperature of supplied water. Variations are captured by recomputing the coefficients after variations occur. Since the model is estimated from on-and-off data of the water heater in real time, the variations of \(T_{min}\) and \(T_{max}\) should be updated frequently. After that, coefficients \(c_{heat}\), \(c_{cool}\), and \(c_{use}\) should be recomputed using the updated values of \(T_{min}\) and \(T_{max}\). These dynamics allow properly modeling different climate conditions and user preferences. Figure 5 presents a schema of the proposed model definition from on blocks and water utilization. The black line on the upper graphic is the water temperature. On the bottom, grey on blocks represents thermal recoveries, and on blocks caused by water utilization are marked in orange. The analysis of the water temperature curve indicates that the water cools with a slope \(c_{cool}\) until it reaches the value \(T_{min}\); at that moment, the electric water heater turns on. The heating phase starts with a slope \(c_{heat}\) until the temperature reaches the value \(T_{max}\). Then, another cooling phase occurs until a water utilization causes a much faster cooling with a slope \(c_{use}\).