The dwindling reserves of fossil fuels have spurred the expansion of photovoltaic power systems, widely regarded as an alluring solution. Yet, a formidable challenge arises when it comes to optimizing the output of PV systems exposed to irregular irradiance stemming from external environmental factors. Consequently, this research endeavors to advocate the use of the Moth Flame Optimization (MFO) algorithm to search for the highest power output of a solar energy harvesting system. The distinctive behavior of moths proves instrumental in thorough searching of the feasible space, mitigating the risk of entrapment in local optima. To evaluate its efficacy, this algorithm's performance is validated by comparing its outcomes with those of the Butterfly Optimization Algorithm (BOA). Both algorithms are subjected to experimentation to search for the Global Maximum Power Points (GMPPs) of the PV system under two distinct Partial Shading Condition (PSC) scenarios: Case 1 and Case 2. The results indicate that BOA tends to produce outcomes with a broader data dispersion range relative to the mean, unlike MFO. Specifically, for Case 1, the standard deviation values for MFO and BOA are 2.327040E-02 and 5.777913E-02, respectively, while for Case 2, they are 5.0567340E-02 and 8.519362E-02, respectively. Hence, the proposed approach demonstrates faster and more precise convergence. (c) 2023 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). Peer-review under responsibility of the scientific committee of the 7th International Conference on Renewable Energy and Conservation, ICREC, 2022.