## 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)
Comparison of Results of the Stochastic Planning Approach vs. the Deterministic Approach (Case 1)  
Figure 15 shows histograms with the cumulative frequencies of the percentage difference between the cost functions of the deterministic worst-case scenario and the cost functions of the stochastic problem, for Case 1. According to the results, about 90 microgrids of 1, 10, 20 and 100 clients, the percentage difference between the respective cost functions is between 0% and 5%. This value represents what in stochastic programming is known as the \"expected value of perfect information\" (EVPI), and it means the loss of profits due to the presence of uncertainty. Therefore, the solution of the stochastic planning problem with reliability requirements, in approximately 90% of the implemented microgrids, is similar to the solution of the deterministic problem that is solved for the worst scenario of groups of 1, 10, 20 and 100 residential households. This is very valuable from a computational point of view, when planning community microgrids, considering stochastic programming. Given that, if computationally speaking there are not enough resources to solve the problem stochastically (with various scenarios) and there are reliability  
Figure 14: Distribution of investment costs per household, for microgrids determined from the stochastic approach, with reliability requirements (Case 2). requirements for a community, solving the deterministic worst-case scenario represents a better approach to solving the microgrid with a reliability requirement problem. Comparison of Results of the Stochastic Planning Approach vs. the Deterministic Approach (Case 2)  
The findings identified in Case 1 extend to Case 2 with critical demand supply, during the hours of fault in the main grid. According to the results shown in Figure 16, it is noted that the percentage errors between the deterministic and stochastic cost functions are reduced compared to the solutions obtained in Case 1 (i.e., this can be observed by comparing the horizontal axis). The stochastic and deterministic results maintained are really close; in fact, most microgrids determined from groups of 10, 20 and 100 households have differences between 0 and 4%. In microgrids with one residential household, the percentage difference compared to the rest of the groups is at most 7% difference for 100% of the microgrids. According to the results, the percentage difference between the respective cost functions is less than or equal to 5% in about 95 microgrids of 1 client. For the rest of the groups, 100% of the microgrids present an error between the objective functions of less than 3.6%. The difference between the cost functions narrows, showing that during the hours of fault, the critical demand (TV, refrigerator, personal computer and home lighting) tends to present consumption levels that are similar in practically all the microgrids (which depends largely on the time of the analysis horizon where the faults occur). In summary, when seeking to plan microgrids with critical load requirements, and to find the solution, the worst-case scenario is solved. This solution is even closer to the stochastic result, and therefore for communities that cannot solve the optimization problem from the stochastic approach (because they do not have sufficient computational resources), it is convenient to size their microgrids for the worst-case scenario. Figure 15: Percentage difference between cost functions of the deterministic and stochastic problems, by groups of microgrids (Case 1).