## 5 Conclusions  
In this work, hundreds of residential microgrids have been optimally planned, demonstrating and quantifying the value of community association in the residential segment while establishing a precedent for the development of urban microgrids. In this sense, the conclusions obtained are robust, but only apply to community microgrids of residential customers. However, the models can also be used to analyze other segments, such as commercial, industrial and institutional loads. In total, 3600 microgrids were optimally implemented for different groups, households and case studies, allowing us to achieve strong and generalized conclusions. The models proposed, with deterministic and stochastic approaches, seek to compare the microgrids' infrastructure requirement to supply (i) the total load and (ii) the critical load during a fault. In the problem with a deterministic planning approach, different levels of reliability are proposed, so that the community can choose the level of protection based on their investment capacity, and how the grouping of households affects investment costs. In addition, to optimally plan microgrids capable of facing different main grid fault scenarios, a stochastic model was developed, considering the uncertainty related to the moment in the analysis horizon when a fault occurs. In this regard, three remarkable conclusions of this work are presented below:  
1. Since the realistic residential demands obtained from the CREST Demand Model tool are different between loads (as it happens in the real life), the planning models proposed in this research consider, among the most important factors, the formation of different groups of randomly selected residential clients, with which it is intended to collect the diversity in energy consumption due to the load aggregation (i.e., community creation). In the same way, the Economy of Scale (EoS) is considered when adding capacity in assets for the determination of microgrids. Based on this, it was possible to quantify the benefits of community microgrids, mainly represented by savings in investment costs for residential households (up to 35% on average), when the relevant value of the community is considered. From the 35% maximum reduction that was evidenced in the case studies, up to 15% can correspond to the effect of EoS, and the remaining 20% is produced by taking advantage of the diversity of the load profiles when forming hundreds of groups of 10, 20 and 100 residential households, for the determination of community microgrids. 2. Regarding the stochastic planning approach, besides the fact that microgrids are prepared to face several fault scenarios (8753 possible scenarios that are reduced to three representative scenarios, for faults of 8 h), it was found that in approximately 90% of the microgrids determined with the stochastic planning approach (Case 1), the optimization algorithm typically decides to prepare for the worst fault scenario  
Figure 16: Percentage difference between cost functions of the deterministic and stochastic problems, by groups of microgrids (Case 2). that the community may experience. (In Case 2, this percentage increases to 100% due to the similarities in the critical load consumption levels of residential users.) This is very valuable from a computational point of view when planning community microgrids. Therefore, for communities without access to computational resources and an optimization tool, solving the deterministic worst-case scenario is a good proxy to design their own microgrids. 3. Finally, in community microgrids, the total load profile tends to be more homogeneous compared to the load profile of a single residential household, which can present abrupt peaks during the day. It is precisely this reduction of diversity in aggregated load profiles (and added EoS) that can make the integration of renewable sources and energy storage systems in urban communities more viable, since it positively impacts the costs for their implementation (i.e., cost reduction for the microgrid community).