Python-Based Implementation of Metaheuristic MPPT Techniques: A Cost-Effective Framework for Solar Photovoltaic Systems in Developing Nations
Abstract
:1. Introduction
2. Design and Implementation of System in Python
2.1. The Two-Diode PV Model
2.2. System Integration
3. Python Implementation of Selected MPPT Techniques
3.1. Phyton Implementation of Algorithms
- Initialization of variables—The first function that base class performs is the initialization of variables. This includes setting the max epoch number, population size, default global best power, local best power, starting flag (to mark a starting reference, point), termination flag(as long as false, the loop will run), and sets multiple arrays of different size based on this information.
- Population—Every MhMPPT has agents in one form or the other. this function of the base MPPT class helps us to give generic numbers so that agents’ numbers can be easily passed to other MhMPPT functions.
- Agents—This array holds the details of every agent, such as its personal best, global best, as well as the current position. The positions of each agent are stored in the form of operating solar PV current and voltage.
- Power, Voltage, and Current data—Store data for the global best position and track different duty, voltage, and current values. This function also makes sure that basic physics laws, such as series current, should be the same, or operating conditions should not go into undesired(negative voltage and currents) or unrealistic conditions (such as imaginary values).
- Display of the output—This function is responsible for the display of various results such as variation of power, voltage, current, and duty with time. These are the outputs that are used to compare different MhMPPT algorithms.
- Variation of duty ratio—This function provides variation in the duty cycle produced for the buck converter and also discards the value that is undesired.
- Prevent from crashing—If the class receives irrational inputs or due to some other reason the program crashes, this function throws an error and prevents the function from crashing and freezes all the values before crashing.
- Termination—One of the most important functions is to decide when to terminate the algorithm. This is done either by deciding the maximum iteration or by the maximum time for which the algorithm is supposed to run.
3.2. PSO Based MPPT
Algorithm 1 PSO based MPPT Algorithm. |
|
3.3. ABC Based MPPT
Algorithm 2 ABC based MPPT Algorithm. |
|
4. Results and Discussion
4.1. Analysis of Solar PV Panel
4.2. Analysis of System Implementing PSO and ABC Based MPPT
4.3. MPPT Implementation Details for the Edge Devices
- CPU of 64-bit x86-64/ARMv8 (1+ GHz core)
- RAM: 1 GB total (512 MB allocatable to container)
- Storage: 2 GB free (base image: 900 MB + NumPy: 150 MB)
- OS: Linux (kernel ≥ 3.10), Win10 (WSL2), or macOS 10.14+
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
COP | Conference of Parties |
SDG | Sustainable Development Goal |
PV | Photovoltaic |
STC | Standard Test Conditions |
MPP | Maximum Power Point |
MPPT | Maximum Power Point Tracker |
CMPPT | Conventional Maximum Power Point Tracker |
AMPPT | Advance Maximum Power Point Tracker |
MhMPPT | Metaheuristic Maximum Power Point Tracker |
PSO | Particle Swarm Optimization |
ABC | Artificial Bee Colony |
HS | Harmony Search |
ACO | Ant Colony Optimization |
CPSC | Complex Partial Shading Condition |
Appendix A
Appendix A.1
- M = the number of harmonies
- N = the number of variables (or instruments)
- L = the number of possible values (or nodes)
- i = the number of optimal value (or note)
- = the optimum solution or note value of instrument (global best)
- = considering rate of harmony memory
Appendix A.2
References
- Shahbaz, M.; Raghutla, C.; Chittedi, K.R.; Jiao, Z.; Vo, X.V. The effect of renewable energy consumption on economic growth: Evidence from the renewable energy country attractive index. Energy 2020, 207, 118162. [Google Scholar] [CrossRef]
- Panwar, N.; Kaushik, S.; Kothari, S. Role of renewable energy sources in environmental protection: A review. Renew. Sustain. Energy Rev. 2011, 15, 1513–1524. [Google Scholar] [CrossRef]
- Roberts, B.J. India Solar Resource Data Enhanced Data for Accelerated Deployment. Available online: https://mnre.gov.in/en/annual-report/ (accessed on 8 September 2022).
- Vidyarthi, S.N.K.; Medlock, K.; Amick, P.; Sah, S.N.K. Carbon Capture, Utilization and Storage: Policy Framework and Its Deployment Mechanism in India. NITI Aayog Report. 2022. Available online: https://www.niti.gov.in/sites/default/files/2022-12/CCUS-Report.pdf (accessed on 9 March 2023).
- Ashraf, S.M.; Firdous, Z.; Tariq, M. Impact of COVID-19 on Sustainable Development Goals in India. In Proceedings of the 2022 2nd International Conference on Emerging Frontiers in Electrical and Electronic Technologies (ICEFEET), Patna, India, 24–25 June 2022; pp. 1–6. [Google Scholar]
- UNFCC. Paris Agreement; UNFCC: Piscataway, NJ, USA, 2015. [Google Scholar]
- Ahluwalia, M.S.; Patel, U. Getting to Net Zero: An Approach for India at CoP-26; Centre for Social and Economic Progress: New Delhi, India, 2021. [Google Scholar]
- Central Electricity Authority (CEA). Power Sector at a Glance. Ministry of Power, Government of India. 2023. Available online: https://powermin.gov.in/en/content/power-sector-glance-all-india (accessed on 9 March 2023).
- Government of India, Ministry of Power. Annual Report 2021–2022; MOP Annual Report Eng 2021–2022; Ministry of Power: New Delhi, India, 2022; pp. 33–43.
- Ma, T.; Yang, H.; Lu, L. Solar photovoltaic system modeling and performance prediction. Renew. Sustain. Energy Rev. 2014, 36, 304–315. [Google Scholar] [CrossRef]
- Husain, M.A.; Tariq, A.; Hameed, S.; Arif, M.S.B.; Jain, A. Comparative assessment of maximum power point tracking procedures for photovoltaic systems. Green Energy Environ. 2017, 2, 5–17. [Google Scholar] [CrossRef]
- Kumar, D.; Chatterjee, K. A review of conventional and advanced MPPT algorithms for wind energy systems. Renew. Sustain. Energy Rev. 2016, 55, 957–970. [Google Scholar] [CrossRef]
- Wolfs, P.J.; Tang, L. A single cell maximum power point tracking converter without a current sensor for high performance vehicle solar arrays. In Proceedings of the 2005 IEEE 36th Power Electronics Specialists Conference, Dresden, Germany, 16 June 2005; pp. 165–171. [Google Scholar]
- Femia, N.; Petrone, G.; Spagnuolo, G.; Vitelli, M. Optimization of perturb and observe maximum power point tracking method. IEEE Trans. Power Electron. 2005, 20, 963–973. [Google Scholar] [CrossRef]
- Kasa, N.; Iida, T.; Iwamoto, H. Maximum power point tracking with capacitor identificator for photovoltaic power system. IEE Proc.-Electr. Power Appl. 2000, 147, 497–502. [Google Scholar] [CrossRef]
- Shimizu, T.; Hashimoto, O.; Kimura, G. A novel high-performance utility-interactive photovoltaic inverter system. IEEE Trans. Power Electron. 2003, 18, 704–711. [Google Scholar] [CrossRef]
- Sera, D.; Mathe, L.; Kerekes, T.; Spataru, S.V.; Teodorescu, R. On the perturb-and-observe and incremental conductance MPPT methods for PV systems. IEEE J. Photovoltaics 2013, 3, 1070–1078. [Google Scholar] [CrossRef]
- Jain, S.; Agarwal, V. Comparison of the performance of maximum power point tracking schemes applied to single-stage grid-connected photovoltaic systems. IET Electr. Power Appl. 2007, 1, 753–762. [Google Scholar] [CrossRef]
- Wasynezuk, O. Dynamic behavior of a class of photovoltaic power systems. IEEE Trans. Power Appar. Syst. 1983, PAS-102, 3031–3037. [Google Scholar] [CrossRef]
- Desai, H.P.; Patel, H.K. Maximum power point algorithm in PV generation: An overview. In Proceedings of the 2007 7th International Conference on Power Electronics and Drive Systems, Bangkok, Thailand, 27–30 November 2007; pp. 624–630. [Google Scholar]
- Hua, C.; Lin, J.R. DSP-based controller application in battery storage of photovoltaic system. In Proceedings of the 1996 IEEE IECON—22nd International Conference on Industrial Electronics, Control, and Instrumentation, Taipei, Taiwan, 9 August 1996; Volume 3, pp. 1705–1710. [Google Scholar]
- Anderson, K.; Hansen, C.; Holmgren, W.; Jensen, A.; Mikofski, M.; Driesse, A. pvlib python: 2023 project update. J. Open Source Softw. 2023, 8, 5994. [Google Scholar] [CrossRef]
- Mikofski, M.; Meyers, B.; Chaudhari, C. PVMismatch Project. 2018. Available online: https://github.com/SunPower/PVMismatch (accessed on 8 March 2022).
- Lee, K.H.; Araki, K.; Elleuch, O.; Kojima, N.; Yamaguchi, M. Pypvcell: An Open-Source Solar Cell Modeling Library in Python. In Proceedings of the 2017 IEEE 44th Photovoltaic Specialist Conference (PVSC), Washington, DC, USA, 25–30 June 2017; pp. 359–362. [Google Scholar] [CrossRef]
- Abu, M.; Siddique, B.; Karim, S.M.R. Modeling of Double Diode Solar Photovoltaic Module using Matlab. Int. J. Comput. Appl. 2017, 179, 975–8887. [Google Scholar] [CrossRef]
- JA Solar. JAP6-72 305-325 4BB Multicrystalline Silicon Module. Available online: https://documents.unboundsolar.com/media/specs-3975302543.1931060-1.pdf (accessed on 1 February 2022).
- Balamurugan, R.; Natarajan, A.; Premalatha, K. Stellar-mass black hole optimization for biclustering microarray gene expression data. Appl. Artif. Intell. 2015, 29, 353–381. [Google Scholar] [CrossRef]
- Eberhart, R.; Kennedy, J. A New Optimizer Using Particle Swarm Theory. In Proceedings of the Sixth International Symposium On Micro Machine And Human Science, Nagoya, Japan, 4–6 October 1995. [Google Scholar]
- Karaboga, D.; Basturk, B. A powerful and efficient algorithm for numerical function optimization: Artificial bee colony (ABC) algorithm. J. Glob. Optim. 2007, 39, 459–471. [Google Scholar] [CrossRef]
- Geem, Z.W.; Kim, J.H.; Loganathan, G.V. A New Heuristic Optimization Algorithm: Harmony Search. Simulation 2001, 76, 60–68. [Google Scholar] [CrossRef]
- Dorigo, M.; Stützle, T. The ant colony optimization metaheuristic: Algorithms, applications, and advances. In Handbook of Metaheuristics; Springer: Berlin/Heidelberg, Germany, 2003; pp. 250–285. [Google Scholar]
- Ashraf, S.M.; Patel, A.S.; Kherani, A.A.; Lall, B. 3GPP-based testbed for edge computing: Architecture, implementation and application deployment. In Proceedings of the IEEE International Conference on Advanced Networks and Telecommunications Systems (ANTS), Jaipur, India, 17–20 December 2023; pp. 515–520. [Google Scholar] [CrossRef]
Parameters | Actual Value | Simulation Value | Error (%) | Unit |
---|---|---|---|---|
Isc | 9.06 | 9.06 | 0 | A |
Voc | 46.22 | 47.83 | 3.4 | V |
Vmp | 37.38 | 38.64 | 2.6 | V |
Imp | 8.56 | 8.54 | 0.23 | V |
Pmp | 320.82 | 335.02 | 2.8 | V |
Isc | 0.058 | 0.059 | 1.7 | %/°C |
Pmp | −0.41 | −0.419 | 2.2 | %/°C |
Voc | −0.33 | −0.328 | 0.6 | %/°C |
No. | MPPT | STC | CPSC | ||||||
---|---|---|---|---|---|---|---|---|---|
CT (s) | MP (W) | CV (%) | TF (%) | CT (s) | MP (W) | CV (%) | TF (%) | ||
1 | PSO | 0.81 | 331.2 | 1.01 | 98.5 | 2.23 | 262.3 | 2.5 | 97.3 |
2 | ABC | 0.98 | 334.1 | 0.49 | 99.6 | 1.84 | 268.6 | 2.4 | 99.1 |
3 | HS | 0.47 | 298.4 | 2.12 | 88.6 | 0.91 | 203.8 | 4.3 | 75.4 |
4 | ACO | 0.89 | 332.5 | 0.81 | 98.7 | 2.91 | 242.1 | 2.9 | 89.3 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ashraf, S.M.; Arif, M.S.B.; Khouj, M.; Ayob, S.M.; Masud, M.I. Python-Based Implementation of Metaheuristic MPPT Techniques: A Cost-Effective Framework for Solar Photovoltaic Systems in Developing Nations. Energies 2025, 18, 3160. https://doi.org/10.3390/en18123160
Ashraf SM, Arif MSB, Khouj M, Ayob SM, Masud MI. Python-Based Implementation of Metaheuristic MPPT Techniques: A Cost-Effective Framework for Solar Photovoltaic Systems in Developing Nations. Energies. 2025; 18(12):3160. https://doi.org/10.3390/en18123160
Chicago/Turabian StyleAshraf, Syed Majed, M. Saad Bin Arif, Mohammed Khouj, Shahrin Md. Ayob, and Muhammad I. Masud. 2025. "Python-Based Implementation of Metaheuristic MPPT Techniques: A Cost-Effective Framework for Solar Photovoltaic Systems in Developing Nations" Energies 18, no. 12: 3160. https://doi.org/10.3390/en18123160
APA StyleAshraf, S. M., Arif, M. S. B., Khouj, M., Ayob, S. M., & Masud, M. I. (2025). Python-Based Implementation of Metaheuristic MPPT Techniques: A Cost-Effective Framework for Solar Photovoltaic Systems in Developing Nations. Energies, 18(12), 3160. https://doi.org/10.3390/en18123160