Cost-Optimal Solar Microgrid Management : Exact versus Metaheuristic Optimization

Abd Alrahman Alfagia, Mohamed Alrayesb Imene Rahalc  , Zayed Khalifad

acd Faculty of Information Technology, University of Zawia

b Faculty of Information Technology, University of Tripoli

a Abd.alfagi@zu.edu.ly b mo.alrayes@uot.edu.ly c i.rahal@zu.edu.ly d m.zayed@zu.edu.ly

https://orcid.org/0000-0003-1242-8373      https://orcid.org/0009-0007-7009-0493

https://orcid.org/0009-0005-8983-3619      https://orcid.org/0000-0002-7590-2004

ABSTRACT:

Efficient energy management in solar microgrids is essential for ensuring reliable, cost-effective, and sustainable electricity supply, particularly in rural and off-grid environments. This study develops and evaluates a hybrid optimization framework combining an exact Mixed-Integer Linear Programming (MILP) model solved with IBM ILOG CPLEX and a tailored Genetic Algorithm (GA) to minimize daily operational costs while satisfying all technical and operational constraints. Ten real-inspired benchmark instances were constructed, each representing different hourly profiles of solar availability, electricity demand, and grid prices. Results show that CPLEX consistently obtained globally optimal schedules, achieving the lowest possible operational cost with full constraint satisfaction. The GA demonstrated strong convergence behavior, producing fully feasible solutions with zero violations and maintaining a cost deviation of only 11–16% from the optimal CPLEX benchmark. The analysis further reveals consistent energy-use patterns across instances, where both CPLEX and GA prioritize solar PV utilization and strategically coordinate battery charging and discharging to reduce grid dependency. These findings confirm the effectiveness of exact optimization for small- to medium-scale systems and highlight the GA as a scalable and computationally efficient alternative for larger microgrids where exact methods become intractable. The proposed dual-method framework provides practical insights for microgrid operators, policymakers, and energy planners seeking to optimize renewable-based systems under uncertainty. Future extensions will integrate multi-day horizons, stochastic weather forecasts, battery aging, and advanced hybrid metaheuristics.

Keywords:

Solar microgrid; Energy management optimization; Mixed-Integer Linear Programming (MILP); Renewable energy scheduling; Battery storage optimization; Metaheuristic optimization.

 Download Attachment
Share :