## 4 Results and Analysis
### Solution of the Stochastic Planning Problem
#### 4.2.3 Global Results and Statistical Analysis for the Stochastic Planning Model (Cases 1 and 2)  
In order to obtain conclusions that support the possible advantages of solving the microgrid planning problem with the stochastic approach, 800 microgrids were modeled (200 for each grouping of 1, 10, 20 and 100 clients), from Cases 1 and 2, considering for each one of them a simulation with three stochastic fault scenarios of 8 h. The objective of analyzing hundreds of microgrids is to capture the diversity of households, since, as previously mentioned, the diversity of household groups varies according to the number of residential households and the stochastic behavior of the energy consumption of each household. Results of the Stochastic Planning Model for Hundreds of Microgrids (Cases 1 and 2)  
The results for microgrids with reliability requirements, determined from the stochastic reliability cases, are presented in the boxplot diagrams in Figures 13 and 14, which measure the variation of investment costs per client, according to the number of clients. These results from the stochastic optimization problem also support the main conclusion of this research, related to the relevant value of community association for microgrid planning. This can be observed in the cases evaluated with reliability requirements, where for planning Case 1 they produce an average saving in investment costs due to the diversity of consumptions (21.6%, 23.1%, and 23.5% of costs reduction, respectively) and EoS (explaining up to 11.0% on average of the additional savings), for community microgrids with 10, 20 and 100 households, with regards to the average investment cost for one-client microgrids. Figure 13: Distribution of investment costs per household for microgrids determined from the stochastic approach, with reliability requirements (Case 1). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Scenarios** & **1** & **2** & **3** \\ \hline Panel power [kW] & 1.81 & 1.57 & 2.17 \\ Inverter technology & Hybrid & Hybrid & Hybrid \\ Battery capacity [kWh] & 1.67 & 0.35 & 5.69 \\ Investment cost [USD/year] & 211.0 & 167.3 & 303.3 \\ Cost function [USD/year] & 199.4 & 193.1 & 235.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Deterministic results for each scenario of the one-client microgrid (Case 1). In Case 2 with critical demand, these savings for community microgrids, due to the diversity, are equivalent to 11.5%, 14.2% and 15.8%, respectively, and 11.0% on average of additional savings by considering EoS. Additionally, based on the results of Table 9, it was affirmed as a hypothesis that the solution of the stochastic planning problem with reliability requirements is similar to the solution of the deterministic problem of the worst scenario of a residential household or group of households. Hence, the benefit of whether to solve the planning problem either in a deterministic way, considering the worst scenario, or to solve the problem stochastically (i.e., considering three scenarios) was assessed. For this purpose, the metric \"Percentage Difference of Cost Functions\" was established, which basically measures the percentage of error between the result of the objective function of the deterministic worst-case scenario of a microgrid, and the result of the objective function of the stochastic problem for exactly the same microgrid (Equation (43)). \[Error_{m,n,c}=\frac{(F.O_{\text{det},m,n,c}-F.O_{\text{sto},m,n,c})}{F.O_{ \text{det},m,n,c}}.100\% \tag{43}\]  
where \(m\) indicates the microgrid to be planned (m = 1, 2, 3,..., 100), \(n\) represents the number of clients per microgrid, that is, 1, 10, 20 and 100 clients, \(c\) indicates the case that you are considering for microgrid planning (Case 1 or 2). In total, 800 planning exercises with a stochastic approach were solved. The results are presented below.