## 4 Case Study
### Results  
This subsection presents the obtained results from the process described in Section 4.2, where each sub-system has its own results. However, through TOOCC, the results of a sub-system have a direct impact on the systems that are dependent on its results in order to proceed with their execution. Thus, the following figures show the results of each sub-system. Firstly, the results regarding the scheduling made by NM using ERM will be presented. Then, it is possible to verify the obtained information from local energy management of Load 15, namely through SHIM and PLCMAS. At the end of the subsection, the results of the case study are discussed in a more comprehensive perspective of the problem, explaining how the results are related and the advantages of interoperability between those systems. Figure 7a,b allows one to understand what will be the origin of the energy, which will be used to supply the expected consumption of the microgrid. It is possible to observe that the largest source of  
Figure 6: Power demand and distributed generation forecast, for each hour of the day. used energy will be the DG (about 85%), except for the first hours of the day, where there is no sunlight and the wind speed is not enough to satisfy the entire energy demand. In these cases, it is necessary to obtain energy from external energy sources, namely from the electricity market (14%), the use of energy stored in batteries (1%), for example EV, and demand response (with negligible value). Throughout the day, when there is surplus production, it is possible to sell energy to other entities, as seen between 3 a.m. and 10 a.m., and at the end of the day, in a total of 9898 kW. By analyzing the energy consumption of the microgrid through Figure 8a,b, it can be seen that the two largest sources of energy consumption refer to EV charging (24%) and loads (69%), e.g., plugging in. In addition, there are no battery charges, so the surplus energy is all sold outside the microgrid. The graph shown in Figure 9 illustrates the scheduling done by NM for Load 15. Since this load simulates the operation of a house, its energy consumption profile differs with the generality of the microgrid. In addition, one can see how the results ranged between day-ahead, hour-ahead and real-time scheduling. The highest peak of consumption is in the evening (between 6 p.m. and 11 p.m.), something that is traditional in the domestic consumer's profile. It is also during this period that there is a greater demand response, where consumption is transferred to other periods with lower consumption, such as after 12 a.m.  
Figure 7: Real-time scheduling results for generation: (**a**) full overview; (**b**) production distribution. Figure 10 presents the local scheduling of Load 15, considering the ERM load limit per period. Here can be seen the cuts needed to meet the limits imposed by the NM and the shifting of consumptions for off-peak hours, in order to have a more uniform consumption over time and to take advantage of the hours when energy is less expensive. In order to protect some cut devices, the FM sets priorities, where those with the highest priority are not cut. In this case study, since it refers to the winter season, the HVAC and water heater devices have the highest priority since they are important to fight the cold. The home energy scheduling enables the real-time adaptation of the considered house to multiple events that occur at higher levels of the energy value chain. In particular, the effective control of the physical energy consumption devices is performed as a result of the intelligent energy management that takes into account the variations of local generation, energy prices and user preferences and habits. Moreover, the applied demand response and energy prices result directly from the energy resources management performed by the aggregator, which, in turn, considers the perspective of the whole aggregated area and respective players, in terms of generation, consumption and storage.