## 2 The Domestic Electric Water Heaters (DEWH) Load Scheduling Problem  
The DEWH load scheduling problem has been summarized into a mathematical programming problem, of which the objective is to minimize the consumers' electricity bill under flexible tariff structure and the constraints are about device limits and thermal comfort [18; 19; 20; 21]. The scheduling problem is built on the thermal dynamic model of a DEWH, which describes the process of the heating and coasting of water in the tank. Figure 1 shows the water temperature curve in a DEWH tank. As shown in Figure 1, there are two operation states for a DEWH, being \"switch on\" state and \"standby\" state. When the water temperature in tank drops to the lower threshold, then the water heater is switched on to recover the water temperature into comfort zone; when the water temperature in tank reaches the upper threshold, the water heater becomes standby. The thermal dynamic model is used to describe the behavior of a DEWH [11]. When only the standby heat loss is considered, there is  
\[\theta_{n+1}=\theta_{e,n}+X_{n}QR-(\theta_{e,n}+X_{n}QR-\theta_{n})\exp[-(t_{n +1}-t_{n})/(RC)] \tag{1}\]  
where \(\theta_{e,n}\) is the water temperature at the end of the day. The temperature at the end of the day is \(T_{e}\), and the temperature at the end of the day is \  
where \(\theta_{n}\) denotes the temperature of hot water in tank at the time \(t_{n}\); \(\theta_{e,n}\) denotes the ambient temperature/cold water inlet temperature at the time \(t_{n}\); \(X_{n}\) represents the on/off state of DEWH over period \([t_{n},t_{n+1}]\) (1-on; 0-off ); and, the constants \(Q\), \(R\) and \(C\) are equivalent thermal parameters, which represent the electric water heater capacity, thermal resistance, and thermal capacitance, respectively. Moreover, when the hot water demand is considered, Equation (1) is modified as  
\[\theta_{n+1}=\left[\theta_{cur}(M-d_{n})+\theta_{e,n}d_{n}\right]/M \tag{2}\]  
where \(\theta_{cur}\) is just the \(\theta_{n+1}\) calculated in (1), \(d_{n}\) is the water demand at the time \(t_{n}\), and \(M\) is the mass of water in the tank. Combining the two equations, one united expression is given to simplify the thermal model as follows:  
\[ \begin{array}{ll}\theta_{n+1}&=f(\theta_{n},\theta_{e,nt},X_{n},d_{n},\Delta t,Q,R,C)\\ &=\left(\prod\limits_{j=1}^{n}\partial f_{j}\right)\theta_{1}+\sum\limits_{i= 1}^{n}\partial^{n-i}\left(\prod\limits_{j=i+1}^{n}f_{j}\right)(1-\partial f_{ i})\theta_{e,i}+\sum\limits_{i=1}^{n}\partial^{n-i}\left(\prod\limits_{j=i}^{n}f_{j} \right)(1-\partial)U_{heat,i}\end{array}  \tag{3}\]  
Equation (3) calculates the water temperature in tank in each step straightforwardly. It lays the foundation for the DEWH load scheduling. The detail proof process refers to Appendix A. However, this temperature-driven running mode might be not cost-efficient under the flexible pricing schemes. The time-varying electricity price enable the DEWH load to operate more flexibly and cost-efficiently, motivating the DEWH to preheat the water in tank in the low electricity price periods and reduce the load in the peak-price periods [7]. So, when considering the time-varying prices, the DEWH load scheduling is modeled as follows. The objective function is to minimize the next 24-h total electricity expense and the constraints limit the water temperature under the consumers' setting zone. The states of the DEWH are the decision variables in the model, which should be solved for consumers as guiding schedules for the following day. Mathematically, the DEWH load scheduling can be formulated as [12]:  
Figure 1: The water temperature curve in a domestic electric water heaters (DEWH) tank.