**7. Conclusions**

This paper investigated the prospects of interlinking the cost of short-term flexibility managemen<sup>t</sup> of microgrid with the long-term optimal capacity planning models towards achieving a 100% green microgrid by using DRP and forecasting. The long-term capacity planning of energy systems involves the evaluation of the optimal size of each of the system component while the short-term flexibility options are implemented within the optimal energy managemen<sup>t</sup> strategies. The DRPs are incorporated as flexibility options to minimize the gap between demand and supply, thus minimizing the overall system costs. The forecasting provides an outlook of anticipated generated power proper scheduling for the effective implementation of one of the DRPs employed in this work. The suggested methodology, in this work, seeks to provide a sustainable and cost-effective transformative approach towards achieving a 100% renewable energy generation for Marsabit county microgrid at a reduced cost of investment by cutting down on excessive sizing of system components. This can serve as a benchmark for other under-served isolated regions all over the world.

For the interlinked multi-objective optimization procedure, credible scenarios were investigated considering two ESS technology-based configurations without and with the inclusion of the DRP. DRPs were applied to provide the required operational flexibility that involves shifting the operation of the FDRs from one period to another to minimize the gap between the generation and demand profiles. The two objectives of the techno-economic optimization procedure are the minimization of loss of load probability (LPSP), which is the system reliability criterion and the minimization of the net present value of the investment costs, which is the economic criterion. The forecasting for TADP DRP implementation was performed using the GBRT algorithm on scikit-learn in Python due to its precision and less computational requirement compared to other algorithms, and the MOPSO was adopted for the optimization procedure. The LPSP is set as the standard for economic comparison under each scenario considered in this work. At LPSP = 0%, i.e., maximum system reliability, the potential benefit of TADP DRP outperformed the CPP DRP as reflected on the investment cost component. Also, for the ESS-type performance comparison, PHES was shown to be more cost-effective compared to

BESS due to its low cost per kWh of storage capacity and its resultant economic effect on the whole system configuration.

**Author Contributions:** conceptualization, M.K.K.; methodology, M.K.K., O.B.A. and M.E.L.; validation, T.S., P.M. and M.A.-A.; formal analysis and investigation, M.K.K., O.B.A. and M.E.L.; writing–original draft preparation, M.K.K. and O.B.A.; writing–review and editing, M.K.K., O.B.A. and M.E.L.; supervision, project administration and funding acquisition, T.S.

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

**Acknowledgments:** The authors wish to acknowledge the Japan international cooperation agency (JICA) for the support provided in the form of African business education (ABE) scholarship to the main author towards the success of this research work. The authors also wish to appreciate the effort of Hannington Gochi of REA, Kenya office for supplying the principal data needed for this project.

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