**6. Conclusions**

The uncertainty in energy distribution planning is inevitable and can have minor impacts on the planning of electrical microgrids. This research quantified the uncertainty of the solar generation of an electric microgrid and validated the methodology using Monte Carlo simulations. The relative error of the uncertainty cost estimation function for the solar energy generation obtained values in the range between 7 × 10−5% and 0.0168%. In addition, the authors evaluated the effect of intraday markets in an optimization case of an electrical microgrid. It was found that the costs of uncertainty for the generation of the solar energy decrease when the number of intraday markets increases, thus considering symmetrical daily auction periods. For example, in the case of three intraday markets, the auctions are carried out every 8 h. The aggregator improved the economic managemen<sup>t</sup> of the network with a more significant number of intraday markets. Future works should evaluate other sources of clean energy such as micro-hydroelectric plants and wind turbines. Such studies must also assess the effect of the implementation of intraday markets with non-symmetrical daily auction periods on the costs of uncertainty.

**Author Contributions:** This research was carried out with the following contributions by the authors: conceptualization, D.A. and S.R.; methodology, J.G.-G. supported by Colciencias, Colombia, Call 785 for national doctorates; validation, S.R. and J.G.-G.; formal analysis, D.A.; investigation, J.G.-G.; supervision, D.A. and S.R.; writing—original draft preparation, J.G.-G.; writing—review and editing, D.A. and S.R.; funding acquisition, S.R. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Data Availability Statement:** The MG model is available online at: http://www.gecad.isep.ipp.pt/ WCCI2018-SG-COMPETITION/ by the group GECAD—Polytechnic of Porto (access date 16/03/2021).

**Conflicts of Interest:** The authors declare no conflict of interest.
