# Household Energy Management
## 3 Elastic Energy Management
### Optimization Algorithm  
The possibility of occurrence of different power selection combinations for appliances (\(P_{A\_SEL}\)) by the proposed algorithms EEM1 and EEM2 causes the realized optimization task to be classified as annoteterministic polynomial time (NP problem). These are high complexity tasks for which metaheuristic algorithms perform better than classical algorithms, e.g., [15]. The Greedy Randomized Adaptive Search Procedure (GRASP) algorithm [34; 35] was used to perform optimization tasks in EEM1 and EEM2. This algorithm starts by creating vertices of graph that determine the possible selection of \(P_{A\_SEL}\) power setting for each of the appliances. All vertices of such a graph are connected with each other by paths. In the first phase of the algorithm's operation, the set of possible power settings for each smart appliance is determined in individual iterations (\(n\)). This means that for each selection of settings, the selected vertices are connected by paths and the value of the objective function is calculated. In the second phase, with the previous assumptions, it will be possible to resolve the situation in which the smart device would be turned on (turned off) or even reduce power at a time when there would be several devices with the same priority. The selection will be determined by the optimization criterion defining the target function \(F_{EEM}\) (6). In this case, due to the minimization of the \(F_{EEM}\) function, the selection of individual \(P_{A\_SEL}\) power settings will follow. In the \(P_{A\_SEL}\) settings you will define what will happen with the given smart appliance: turn on, turn off or modify the power consumed. Figure 8 provides examples of simulation test results for EEM1 and EEM2 algorithms specifying the value of the target function \(F_{EEM}\) (6) for each iteration \(n\), defining the power settings \(P_{A\_SEL}\) achieved for the smart appliances with the GRASP optimization algorithm. Figure 7: EEM2 block diagram. The test results presented concern three smart appliances, as described by (1):  
* Air conditioner (0; 2.2; 3; 2; 0),
* Boiler: (0; 1.5; 2; 1; 0),
* Dishwasher: (0; 2.3; 0. 2; 9),  
involved in the reduction of power. For the air conditioner, three power levels were adopted (\(k_{A\_1}\) = [0.7; 1.2; 1.7] kW) and for the boiler two additional power levels (\(k_{A\_2}\) = [0.5; 1.0] kW). It was also assumed that the EEM1 algorithm takes into account the ToU tariff with three time zones. For all considered cases, the priorities of the smart appliances are taken into account by the optimization process. In example (a) the EEM1 algorithm started (for a time zone with average energy costs \(t\_z\) = 2) optimization of power reduction at the moment of turning on the air conditioner with a nominal power of \(P_{1\_NOM}\) = 2.2 kW with the other two appliances turned on (\(P_{2\_NOM}\) = 1.5 kW and\(P_{3\_NOM}\) = 2.3 kW). The sum of the power consumed by the three appliances (\(P_{h}\) = 6 kW) was greater than the assumed \(P_{hmax}\) = 5 kW value for this time zone. For iteration \(n\) = 2, the optimization process has been completed, which resulted in the boiler power being limited to 1 kW and the air conditioner to 1.7 kW. The sum of the power consumed by the three appliances was 5 kW. In example (b), the EEM1 algorithm started (for the time zone with the highest energy consumption costs) to optimize power reduction when the air conditioner is switched on with the remaining two appliances already switched on (as in example a). The sum of the power consumed by all the appliances (\(P_{h}\) = 6 kW) was greater than the assumed \(P_{hmax}\) = 3 kW value for this time zone. The consumer did not agree to move the start of the dishwasher from this time zone (\(t\_z\) = 3) to the next time zone (\(t\_z\) = 1) with the lowest energy consumption costs. For iteration \(n\) = 12, the optimization process has been completed, as a result of which the boiler was switched off and the power of the air conditioner was limited to 0.7 kW.