## 4 Simulation Results  
To validate the effectiveness of the implemented control functions, a comparative analysis is made by considering a reference case study, characterized by the presence of fixed and variable loads, as well as of the air conditioning system, and without local distributed generation and energy storage systems. Simulations are performed to determine the consumption of electrical energy and the associated costs; in particular, in the MCS, stochastic variables are independently generated until the convergence of consumption and costs. Some of the simulation results are shown in the following figures. The case study is analyzed in a generic winter day, characterized by an assigned energy required by the conditioning system, shown in Figure 7, and by some electrical appliances. Figure 6: Hardware cost in economic model: (**a**) PV-Generator; and (**b**) energy storage system. The appliances considered in the simulation are dishwasher, washing machine and dryer, as shown in Figure 8. They have precise characteristics of power consumption and operating time. The sequence and time of their use are determined by user's choice. The electricity cost (\(C_{EGrid}\)) is calculated considering an energy real time tariff (\(T_{EGrid}\)) [21, 22] for domestic use, derived from the Italian electricity market in 2015, as shown in Figure 9.  
Figure 8: Load appliances energy consumption. Figure 7: Air-conditioning energy consumption in a generic winter day. The total daily cost \(C_{EGR}\) (\(C_{Grid}\) without grid-dependent additional cost components) is shown in Figure 10.  
In this case, the user's preferences are crucial for the operation of the air conditioner; in fact, the desired value of the internal temperature has been assumed equal to 22 \({}^{\circ}\)C, while the outside temperature varies as shown in Figure 11.  
Figure 10: Daily energy cost, \(C_{EGR}\). Figure 9: Energy real time tariff for domestic use (Italian electricity market, 2015). The action of shiftable loads modifies the operation time [24,26], as shown in Figure 12.  
Figure 8.0 Indoor and outdoor temperatures. Figure 8.1 Shiftable Loads Power: (**a**) without EMS; and (**b**) with EMS. The battery control unit continuously works and the EMS decides if the storage system can be enabled to work as load (as state of re-charging) or as a generator. When the storage system is re-charged, it absorbs energy from the grid or from the PV generator (see Figure 13). During the re-charging, if the energy is absorbed from the grid the EMS also performs a control action to constrain the maximum power consumption for residential users according to the contractual limit (typically 3 kW). Furthermore, the EMS monitors the State Of Charge (SOC) of the energy storage system to ensure the limit of the operating conditions such as the maximum and minimum charge level (for example SOC\({}_{\text{min}}\) = 20% and SOC\({}_{\text{max}}\) = 80%). To guarantee a long battery life, the system is dimensioned to perform one charge-discharge cycle per day (Figure 14). The PV generation is used to feed the electrical loads as well as to re-charge the battery. In some cases, the PV generation can exceed the amount of the maximum allowable electrical energy demand consisting of the local electrical energy demand, the battery storage capability and the thermal storage capability of the house. In this case, the EMS allows the PV Generator injecting electrical power into the grid as shown in Figure 8.2 This energy is sold under the contract \"Net Metering Service\". Figure 8.3 State Of Charge of the battery (SOC). Figure 8.4 Storage system power. The use of the energy produced by the PV generator is optimized by the EMS with the purpose of minimize the energy costs. This amount of energy is mainly used by the local electrical loads or stored in the battery [1].