This paper presents a study of an optimal sizing approach for the energy management of a hybrid renewable energy system (HRES) using the Particle Swarm Optimization (PSO) algorithm. The proposed system integrates photovoltaic panels, wind turbines, hydrogen storage, battery storage, a Data Center as the load, and the electrical grid. The principal objective of this study is to determine the optimal component sizes to ensure a reliable and cost-effective energy supply while maintaining system stability. The study utilizes MATLAB for system modelling and simulation, (employing real wind and solar input measured data, and the load profile is based on data from ENSAM of UMI). The results demonstrate that the PSO-based optimization achieves a fast convergence within 12 iterations, demonstrating its efficiency in the optimization process and effective sizing. The optimally sized system supplies 81% of the load demand from the renewable sources, confirming a strong reliance on clean energy. The achieved levelized cost of energy (LCOE) is 0. 27 /kWh, which compares favourably with similar studies. Over 8760 hours of simulation, the optimized configuration ensures both economic competitiveness and system reliability. A comparative analysis highlights the advantages of PSO over alternative optimization techniques. Additionally, the impact of the optimized system on Morocco’s renewable energy policies and energy transition is discussed. The study contributes to the field by offering an initial techno-economic evaluation and highlighting the importance of hybrid energy supply solutions in sustainable energy systems.
Hamza et al. (Sun,) studied this question.