# Household Energy Management
## 3 Elastic Energy Management
### EEM1 Algorithm  
First step of the EEM1 algorithm (Figure 6) is the reading of the current time zone value (\(t\_z\)) for the tariff applied in the household.  
Figure 5: Example of situations where the EEM1 algorithm is run when \(\mid\Delta Ph(i)\mid\geq\Delta P_{\textit{H}s}\).  
If \(t\_z=1\) (the time zone with the lowest energy price), then the EEM1 is terminated. However, when \(t\_z>1\), the EEM1 starts optimizing the power reduction of appliances. For the EEM1 algorithm, the optimization criterion defines the target function specified by the following formula:  
\[F_{EEM}=(F_{DSO}+F_{A}-F_{RES})\cdot\Big{(}1-\frac{U_{SEL}-U}{U}\Big{)}, \tag{6}\]  
where:  
* \(U=1\)--is the optimal value of the household's demand for capacity for its supply in this household,
* \(U_{SEL}\)--current value of power demand for its supply, calculated by the EEM1, based on selected values of appliance power, using the following equation: \[U_{SEL}=\frac{\sum_{j=1}^{N_{A}}P_{A\_SEL_{j}}}{\sum_{i=1}^{N_{ \text{RES}}}P_{\text{RES}_{i}}+P_{h\_max}},\] (7)
* \(F_{RES}\), \(F_{DSO}\), \(F_{A}\)--components of the objective function related to RES, DSO and A, defined by formulas: \[F_{\text{RES}}=\sum_{i=1}^{N_{\text{RES}}}C_{RES_{i}}\cdot P_{ RES_{i}},\] (8) \[F_{\text{DSO}}=C_{DSO}\cdot\sum_{j=1}^{N_{A}}P_{A\_SEL_{j}},\] (9)  
Figure 6: The EEM1 block diagram.  
\[F_{\text{A}}=C_{\text{\it{DSO}}}\cdot\sum_{j=1}^{N_{\text{A}}}\Bigl{(}P_{\text{ \it{A\_NOM}_{j}}}-P_{\text{\it{A\_SEL}_{j}}}\Bigr{)}, \tag{10}\]  
* \(i,j\)--indices of appliances (\(A\)) currently turned on in the household,
* \(N_{\text{\it{RES}}}\), \(N_{\text{\it{A}}}\)--number of RES and \(A\) in the household,
* \(C_{\text{\it{RES}}}\)--cost of obtaining 1 kWh for a given RES,
* \(P_{\text{\it{RES}}}\)--value of power obtained from a given RES,
* \(C_{\text{\it{DSO}}}\)--cost of purchasing 1 kWh from DSO,
* \(P_{\text{\it{A\_NOM}}}\)--nominal value of the power with which \(A\) works,
* \(P_{\text{\it{A\_SEL}}}\)--power value after reduction for the same \(A\),
* \(P_{\text{\it{hmx}}}\)--maximum sum of the power of all enabled consumers in the household after the reduction process by EEM1, determined individually for respective time zones by the energy consumer.  
The objective function (6) takes into account the electricity costs and the consumer comfort resulting from:  
* smart appliance parameters defined by the vector (1),
* \(P_{\text{\it{hmx}}}\) power value determined by the consumer,
* \(U\) and \(U_{\text{\it{SEL}}}\) value, which counteract redundant power reduction.  
In the case of excess energy originating from a RES in a given household (\(\Delta P\geq 0\)), EEM1 will attempt to use it inside the given household, and in case of its excess, for sale the energy to the DSO.  
In the case when \(\Delta P<0\) or RES are not installed in the household, the task of EEM1 will be to determine the value of the power reduction in the relevant consumers. The power reduction will be carried out taking into account the values of the parameters, defined by vector (1), assigned to the appliances accordingly. The power reduction for priority 2 and 3 loads requires the user to interact with the algorithm as part of the \"User Confirmation\" subprogram. The user may knowingly allow or reject a power reduction proposal to the selected \(P_{\text{\it{A\_SEL}}}\) level. If, however, the user does not want or cannot respond to such a message from EEM1, then after a set period of time, automatic consent to power reduction will occur. The choice of the automatic consent option is based on the assumption that users are aware of the need to use EEM1.