Next Article in Journal
Analysis of Experimental Data from a Concentrating Parabolic Solar Plant and Comparison with Simulation Model Results
Previous Article in Journal
Ammonia–Hydrogen Dual-Fuel Combustion: Strategies for Optimizing Performance and Reducing Emissions in Internal Combustion Engines
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Python-Based Implementation of Metaheuristic MPPT Techniques: A Cost-Effective Framework for Solar Photovoltaic Systems in Developing Nations

1
Bharti School of Telecommunication Technology and Management, Indian Institute of Technology Delhi, New Delhi 110016, India
2
Department of Electrical Engineering, Zakir Husain College of Engineering and Technology, Aligarh 202002, India
3
Department of Electrical Engineering, College of Engineering, University of Business and Technology, Jeddah 21361, Saudi Arabia
4
Faculty of Electrical Engineering, Universiti Teknologi Malaysia UTM, Johor Bharu 81310, Malaysia
*
Authors to whom correspondence should be addressed.
Energies 2025, 18(12), 3160; https://doi.org/10.3390/en18123160
Submission received: 7 May 2025 / Revised: 4 June 2025 / Accepted: 6 June 2025 / Published: 16 June 2025
(This article belongs to the Section A2: Solar Energy and Photovoltaic Systems)

Abstract

:
Despite the convenience of solar potential and the magnitude of energy received by the Earth from the sun, solar photovoltaic systems have failed to meet the growing energy demand. This can be attributed to various factors such as low cell efficiency, environmental conditions, and improper tracking of operating points, which further worsen the system’s performance. Various advanced metaheuristic-based Maximum Power Point Tracking (MPPT) techniques were reported in the literature. Most available techniques were designed and tested in subscription-based/paid software such as MATLAB/Simulink, PSIM simulator, etc. Due to this, the simulation and analysis of these MPPT algorithms for developing and underdeveloped countries added an extra economic burden. Many open-source PV libraries are computationally intensive, lack active support, and prove impractical for MPPT testing on resource-constrained hardware. Their complexity and absence of optimization for edge devices limit their viability for the edge device. This issue is addressed in this research by designing a robust framework using an open-source programming language i.e., Python. For demonstration purposes, we simulated and analyzed a solar PV system and benchmarked its performance against the JAP6 solar panel. We implemented multiple metaheuristic MPPT algorithms including Artificial Bee Colony (ABC) and Particle Swarm Optimization (PSO), evaluating their efficacy under both Standard Test Conditions (STC) and complex partial shading scenarios. The results obtained validate the feasibility of the implementation in Python. Therefore, this research provides a comprehensive framework that can be utilized to implement sophisticated designs in a cost-effective manner for developing and underdeveloped nations.

1. Introduction

Energy has become a critical and fundamental component of a country’s economic success. Excessive usage of conventional resources such as coal and petroleum has prompted significant global efforts to develop alternative energy sources [1]. Solar, wind, biomass, and geothermal heat are non-conventional energy sources that are both environmentally beneficial and long-lasting. The efficient use of energy from these resources, combined with appropriate technology, is predicted to play a significant role in providing clean and green energy sources [2]. In the context of India, solar energy is one of the vital sources of renewable energy as India receives 4–7 kWh m 2 solar irradiation per day [3].
The power generation in India is mainly dependent on coal, as shown in Figure 1. As a result, India is the third largest carbon emitter, contributing over 7.3% of the total share [4]. This has made the task of achieving the sustainable development goals (SDG), exacerbated due to the impact of COVID-19 [5], an arduous task for India. In addition, there is mounting pressure by developed countries on India to reduce carbon emissions in order to keep the global rise in temperature below 1.5 °C in line with the Paris agreement [6]. To address these challenges, India has pledged to go carbon neutral by 2070 at the Conference of Parties (CoP) 26 in Gasglow [7] In order to reach net-zero emissions, India has put wheels into motion through the rapid adoption of solar photovoltaics (PV). As of January 2023, the total installed capacity due to solar stands at 11.4% as shown in Figure 1a [8]. Despite its potential, the share of electricity generation via renewable energy sources (excluding hydro), including solar, is a little over 3% for the financial year (FY) 2021–2022 [9] as shown in Figure 1b. This is because it is hard to harvest power from solar PV at optimum output. The solar PV panels’ output is nonlinear in nature as it varies non-linearly with changes in voltage. Hence, it is not necessary that the connected load extracts the maximum power possible from the panel, as the voltage at which the load operates may not be the maximum power voltage for the panel [10]. In order to extract maximum power from solar PV panels, tracking of the maximum power point is required, which is done by using maximum power point trackers (MPPT) [11]. MPPT uses a tracking algorithm to control the operating point of the solar PV panel through power electronics converters. The maximum power operation in a photovoltaic system is critical because it maximizes PV system power generation for a given set of conditions. Various conventional and advanced MPPT techniques were developed and reported in the literature [12]. However, each technique has its own advantage and disadvantages. Kumar et el have classified these algorithms into two major categories, namely conventional and advanced MPPT algorithms, which can be further classified into different sub-categories as shown in Figure 2 [12].
Conventional MPPT (CMPPT) are those techniques that are comparatively easy to implement, such as constant parameters(such as constant current or voltage), measurement and comparison, or trial and error(perturbing and observing). Some of the famous CMPPT techniques include perturb and observe (P&O) [13,14], short circuit current method [15], open-circuit voltage method [16], incremental-conductance (IC) method [17] etc. CMPPT algorithms are easy to implement and work correctly in static conditions. Still, they fail to track MPP in dynamic conditions such as complex partial shading as they suffer from instability, slow tracking, and slow response [18,19,20,21]. However, advanced MPPT (AMPPT) techniques, such as intelligence-based or metaheuristic MPPT (MhMPPT), can easily address this issue efficiently and with better accuracy compared to conventional techniques. The intelligence-based MPPT relies on a large input of data along with high computation power, which makes its implementation very complex for a real system. However, MhMPPTs are especially good when there is incomplete or defective information or a crunch of computational capacity.
Various research has been carried out in improving the tracking of maximum power point MPP, however, most of the reported techniques were implemented using subscription-based paid software. As this adds extra cost to the system and is not an affordable option for these countries. Providing a solution to this issue is a challenge that requires exploring the cost-effective implementation of the MPPT by adopting open sources software platform. Some of the open source solar simulation libraries are PVLib [22], PVMispatch [23], Pypvcell [24]. While PVLib remains the most popular and stable python tool for PV system simulation, its computational intensity makes it unsuitable for edge device applications. Additionally, it lacks robust capabilities for modeling partial shading conditions and evaluating MPPT performance. Alternative tools like PVMismatch and pvpycell offer improved simulation of partial shading effects but suffer from limited software support and implementation challenges due to unresolved dependencies. Hence, the main contribution of this work includes cost-effective and open-source modelling of PV systems, testing of different metaheuristic power point trackers for complex partial shading conditions and testing the feasibility for the edge devices. In this work, the realization and implementation of metaheuristic-based MPPT techniques have been carried out using open-source platform, i.e., Python. Two swarm-based MPPT techniques, particle swarm optimization (PSO), and artificial bee colony (ABC) optimization, were designed and implemented for a solar PV system. Systematic modelling of the PV system, which includes modelling of the panel, converters, and MPPT is carried out in Python. The performance of the system is evaluated under both standard test conditions (STC) and complex shading conditions. In order to validate, we have used JAP6 solar panel as a benchmark. We have also conducted a feasibility test to identify the minimum requirements of this implementation for the edge devices.
The organization of the paper is as follows: in Section 2 modelling of the considered solar PV system is presented. Section 3 describes the implementation of metaheuristic algorithms and the methodology used to design its implementation using a base MPPT python class. The discussion on the performance of the solar PV system when subjected to various environmental conditions and the performance of PSO and ABC MhMPPT is compared in Section 4 followed by the conclusion of the paper in Section 5.

2. Design and Implementation of System in Python

The main components of a solar PV system include solar panels that act as a source of power, power converters, a battery storage system, and a load. In this implementation, each component is modeled in Python and the system is integrated by implementing selected MPPT techniques.

2.1. The Two-Diode PV Model

The electrical equivalent two-diode model shown in Figure 3 is commonly used to describe a PV cell [25].
A current source, one diode, internal shunt resistance, and series resistance, which represent the resistance within each cell, are all included in the model. The net current is the difference between the photo and normal diode currents. Diode current is calculated by the Equation (1) and photo current by Equation (2).
I d 2 = I d 1 = I o [ e q ( V + I R s ) K T 1 ]
I = I p h I d 1 I d 2 V + I R s R s h
where I is Cell current (A), q is the charge of electron (C), K is the Boltzmann’s constant (j/K), T is the cell temperature (K), I p h is the photo current (A), I o is the diode saturation current (A), R s , R s h are cell series and shunt resistances ohms and V is the cell output voltage (V).
Python model of solar PV is developed from scratch. The simulation is done by making a generic class such that any Solar PV can be simulated by properly defining the parameters. The process of implementation is depicted in Figure 4. In this work, the JA Solar panel (model number JAP6-72-325) [26] is taken as the PV panel for the implemented system. The modeling of the panel is done as per the specifications provided by the manufacturer in its datasheet.

2.2. System Integration

Modeling of DC-DC buck converter and battery storage has been carried out considering a standard battery with a constant voltage of 24 V. Integration of all the modeled components implementing PSO and ABC-based MPPT techniques. The following section presents a detailed implementation of the selected MPPT techniques in Python.
Figure 4. PV class implementation in Python.
Figure 4. PV class implementation in Python.
Energies 18 03160 g004

3. Python Implementation of Selected MPPT Techniques

The PV systems tends to have multiple peaks in power vs voltage graph when subjected to partial shading conditions. Conventional MPPT techniques (P&O, IC, etc.) often converge to local optima due to their gradient-based nature, failing to track the global MPP. This results in significant power loss during non-uniform irradiance conditions. Metaheuristic algirithmss are probabilistic search techniques that provides “good enough” results for complex optimization problems. According to Balamurugan et al. [27], a metaheuristic is a higher-level method that is able to identify, create, or choose the value of variables that may offer a good enough solution to an optimization problem. In our case, the solution is the value of voltage, and current produce optimum power. Metaheuristic algorithms such as Particle Swarm Optimization (PSO) and Artificial Bee Colony (ABC) provide near-optimal solutions while effectively avoiding local optima. Unlike computationally intensive machine learning approaches that demand substantial data and resources, PSO and ABC rely primarily on hyperparameter tuning, making them lightweight and efficient. Their inherent stochastic nature enables robust exploration of the solution space without requiring complex computations. These characteristics make PSO and ABC particularly suitable for scenarios with constrained computational capabilities, where simplicity, speed, and low resource dependency are critical. Thus, their balance of performance and efficiency motivates their adoption in this work.

3.1. Phyton Implementation of Algorithms

To begin the implementation of MPPT tracker using various metaheuristic algorithms, the first step to define a base class that takes care of data collection that will be used for calculation by different MhMPPT algorithms as shown in Figure 5. The general format of the base MPPT class is as follows:
  • 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

PSO is a population-based, stochastic Evolutionary Algorithm search method based on the behavior of a flock of birds [28]. The PSO algorithm keeps track of a swarm of individuals (known as particles), each representing a potential solution to the given optimization function according to the Equation (4). Particles have a basic behavior: they imitate surrounding particles’ successes as well as their own. The best particle in the search area in the neighborhood denoted by P b e s t , the current inertia of the particle, as well as the best solution discovered by all particles in the entire swarm population denoted by G b e s t , impact a particle’s position. The particle position X i is updated using Equation (3),
X i ( n + 1 ) = X i ( k ) + V i ( n + 1 )
V i ( n + 1 ) = ω V i + C 1 r 1 ( P b e s t X i ( n ) ) + C 2 r 2 ( P b e s t X i ( n ) )
where V is the updated velocity of the particle and is calculated by (4). Acceleration coefficients are c 1 and c 2 such that c 1 , c 2 R . The Random variables r 1 and r 2 are defined such that r 1 , r 2 U ( 0 , 1 ) , P b e s t is the personal best position of particle X in the neighborhood area, and G b e s t is the best position of all particles in the population overall. If position represents the real duty cycle and velocity represents the current duty cycle perturbation, may be rewritten as d i ( n + 1 ) = d i ( n ) + δ i ( n + 1 ) where δ i ( n + 1 ) corresponds to the change in duty cycle to achieve such that d i ( n + 1 ) attain V i ( n + 1 ) voltage in the ( n + 1 ) t h time step where n Z + . In the example of PSO, the current duty cycle perturbation is determined by P b e s t and G b e s t . If the current duty cycle differs significantly from the previous cycle, the ensuing duty cycle change will be significant. As a result, PSO can be considered an adaptable kind of P&O. Hence the motivation to use PSO as one of the selected metaheuristic for MPPT problem. The duty cycle in the case of P&O step size is fixed, but in PSO it fluctuates depending on particle position. An appropriate MPPT controller utilizing PSO can be readily developed with the right control parameters. The flowchart for python implementation is shown in Figure 6, while the corresponding pseudocode is provided in Algorithm 1.
Algorithm 1 PSO based MPPT Algorithm.
  1:
for each particle i do
  2:
    for each particle d do
  3:
        Initialize the operating voltage according to the equation
  4:
        Initialize the velocity according to the equation
  5:
        calculate the value of fitness parameters
  6:
    end for
  7:
end for
  8:
while Termination conditions not reached do
  9:
    for e doach particle i
10:
        calculate output power
11:
        if t thenhe output power better than p b e s t i d in history
12:
           update P b e s t i d
13:
        end if
14:
    end for
15:
    choose the particle having the best power value as the g b e s t d
16:
    update the duty
17:
    for each particle i do
18:
        for each dimension d do
19:
           calculate velocity according to the equation (insert equation no)
20:
           Update particle position according to the equation (insert equation no)
21:
           Update the duty
22:
        end for
23:
    end for
24:
    Next iteration
25:
    if Termination condition reached then
26:
        exit loop
27:
    end if
28:
end while

3.3. ABC Based MPPT

A Metaheuristic search algorithm inspired by bees is an Artificial bee colony (ACO). It is an optimization technique that uses a graph inspired by a biological bee to find the shortest way to a solution. It uses a modern stochastic approach and simplifies the solution of computational problems. It was first suggested in the year 2005 by Dervis Karaboga [29]. This method uses artificial bees that live in hives. The bees communicate with each other by releasing pheromones and waggling dances. Pheromone (a kind of chemical) along with the waggle dance used to attract fellow bees in search of flower nectar. The stronger the combination of these two signals is, the more efficient the path is. That is how the ants communicate with each other to find food. Initially, the ABC divides the particles (artificial bees) into two groups, ie, employed and unemployed(onlooker) bees. The employed bees randomly scout in search of flower nectar. If they find nectar, then through communication with pheromone and waggle dance, the unemployed bee follows the signal. The flowchart for the implementation of ABC-based MPPT in python is shown in Figure 7, while the corresponding pseudocode is provided in Algorithm 2.
Algorithm 2 ABC based MPPT Algorithm.
  1:
Initialize the operating voltage and current according to the equation
  2:
Initialize the velocity according to the equation
  3:
calculate the value of fitness parameters(voltage and current) and calculate power.
  4:
while Termination condition not reached do
  5:
    for each employee bees do
  6:
        Find a new food sources and evaluate the fitness.
  7:
        Apply greedy selection mechanism.
  8:
    end for
  9:
    Calculate the probability for each food source.
10:
    for each onlooker bees do
11:
        Select a food source
12:
        Produce new food source
13:
        Evaluate the fitness
14:
        Apply greedy selection mechanism
15:
    end for
16:
    Scout bee phase
17:
    if any employed bee becomes scout bee then
18:
        Send the scout bee at a randomly produced food source
19:
    end if
20:
    if Termination condition reached then
21:
        Exit the loop
22:
    end if
23:
end while
The mathematical model is used to simulate ABC-based MPPT is done by first initializing random bees that will be employed bees to find each unique solution according to Equation (5) where X i , j is the solution by i t h particle of j t h dimension.
The next step is when the employed bee move to the solution of maximum nectar (GMPP). this position is denoted by V i , j as per Equation (6).
X i , j = X m i n , i = r a n d [ 0 , 1 ] [ X m a x , i X m i n , i ]
V i , j = X i , j + α ( X i , j X k , j ) ; k = 1 , N s
In the next step, the unemployed bee act according to the information passed by the employed bee with the assistance of a pheromone and waggle dance. the magnitude of the signal is denoted as probability as shown in Equation (7) where f ( x ) is the fitness function.
P i ^ = f ( x i ) n = 1 N s f ( x i )
When both sets of bees converge to a point, the scout bee haphazardly searches for an alternate solution. if the equation given by (8) is satisfied, GMPP search will start again.
| P p v P p v , ( n 1 ) P p v , ( n 1 ) | Δ P p v

4. Results and Discussion

Python model of a solar PV panel has been designed and developed using parameters provided by the manufacturer of the panel for validation.

4.1. Analysis of Solar PV Panel

The analysis has been carried out at standard test conditions (STC) as shown in Figure 8a. The output also includes panel working at varying temperatures and irradiance, and the results are compared to the manufactured data sheet of the JAP6 solar panel. Temperature coefficient includes temperature coefficient of short circuit current, open circuit current, and maximum power and are represented by symbol α Isc, β Voc, and γ Pmp, respectively. These parameters are used in comparison to the temperature coefficient obtained by Python simulation, and the result is shown in Table 1. The percentage error in the value of α Isc, β Voc, and γ Pmp is 1.7, 0.6, and 2.2, respectively. When we compare the data from Figure 8b,c. It can be seen that the error is very low in all cases, as summarised in Table 1.
Complex Partial Shading condition is described as a partial shading condition along with variable irradiance with respect to time in Figure 9. This is done as it simulates the real-life scenario of a cloud moving above the panel.

4.2. Analysis of System Implementing PSO and ABC Based MPPT

To analyze the performance of metaheuristic-based MPPT algorithms, qualitative analysis has been carried out for STC as well as for complex partial shading conditions, shown in Figure 10 and Figure 11. Since metaheuristics are probabilistic, metrics like output power, tracked voltage/current, convergence time, and tracking efficiency are reported as mean values unless specified otherwise. The qualitative analysis consists of five graphs. Starting from a variation of duty, voltage, and power for the transient period vs time, variation of optimum power and percentages of exploration/exploitation as well as runtime against epoch and a 3-dimensional graph of electrical parameters. These graphs are helpful to compare the performance based on equal function evaluation. Figure 12 and Figure 13 shows the qualitative analysis of ABC and PSO-based MPPT. Figure 12 displays, from left to right, a 3-d output graph of power current and voltage denoted by “(a)”, variation of duty voltage and power denoted by “(b)” and optimum power vs epoch denoted by “(c)” in the figure for ABC based MPPT working at STC. Similarly, “(a’)”, “(b’)” and “(c’)” demonstrate the 3-d graph, variation of power voltage and duty as well as optimum best power vs epoch for PSO-based MPPT for panel working at STC. Similarly, Figure 13 shows the variation of duty, power, optimum power, etc for ABC (denoted by “(a)”, “(b)” and (“c”) and PSO (denoted by “(a’)”, “(b’)” and “(c’)”) based MPPT working at complex partial shading condition. At STC, it can be seen that the best power obtained by ABC-based MPPT after 30 epochs was 334 W, while it can be seen that the best power obtained by PSO after 30 epochs were 332 W. In the case of complex partial shading conditions, the optimum power reached is 267.43 W for ABC-based MPPT and 262.78 W for PSO-based MPPT. The transient fluctuation is high PSO-based MPPT compared to ABC-based MPPT.
Variation of exploration and exploitation percentages vs epoch and runtime of each function evaluation vs epoch has also been shown in Figure 14 and Figure 15 for ABC and PSO-based MPPT, respectively. These graphs are added to give a better understanding of the inner workings of these algorithms, and these graphs aid in deciding the termination criteria for these algorithms. The exploration and exploitation percentages vs epoch are shown by “(a)” and “(a’)” for MPPT working at STC and complex partial shading conditions, respectively. Similarly, “(b)” and “(b’)” shows the runtime vs epoch for MPPT working at STC and complex partial shading conditions respectively. Subfigures “(c)” and “(c’)” depict the optimum power (global maximum tracked up to the current epoch) versus epoch for the MPPT algorithm operating under standard test conditions (STC) and complex partial shading conditions, respectively optimum power (global maximum for that epoch) vs epoch for MPPT working at STC and complex partial shading conditions respectively.
The steady-state response of PSO and ABC MhMPPT algorithm is shown in Figure 10 an Figure 11 for STC as well as for complex partial shading conditions. At STC, PSO-based MPPT converges faster than ABC-based MPPT. PSO takes 0.81 s to converge whereas ABC takes around 1 second to converge. In the case of complex partial shading, PSO-based MPPT converges at 2.23 s, whereas ABC-based MPPT takes only 1.84 s to converge hence making it faster. The average power tracked in both cases is better for the ABC-based MPPT. Table 2 summarizes the comparison of MhMPPT PSO and ABC with Harmonic Search (HS) [30] and Ant Colony Algorithm (ACO) [31] for STC and CPSC. The mathematical formulation of HS and ACO is provided in the Appendix A.1 and Appendix A.2 respectively. The best convergence for all the MhMPPT for STC for all the algorithm is approximately 335 W. For CPSC, best convergence for PSO, ABC and ACO is approximately 270 W (maximum power at CPSC is 270.54). HS best convergence came to be around 258.32. The Table 2 shows that no single algorithm (PSO, ABC, HS, ACO) outperforms all others across both STC and CPSC conditions. For example, HS has the fastest convergence (CT) in STC but the worst tracking efficiency (TF) in CPSC.

4.3. MPPT Implementation Details for the Edge Devices

The implementation targets edge devices, which we define as resource-constrained computing platforms with limited processing power and memory. The simulation has been carried out on a machine with an Intel Core i5 processor (10th generation), 8 GB of RAM, and a 256 GB SSD, running Ubuntu 20.04 LTS as the operating system. To facilitate real-world hardware deployment, we conducted a systematic evaluation of minimum hardware requirements by analyzing computational resource utilization during Docker-containerized execution as the edge device [32]. Based on the empirical monitoring of processor performance metrics using Docker stats, we derived the following baseline specifications:
  • 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+
Some development boards that fulfil the above requirements are Raspberry Pi3+/4, Orange Pi 5, Intel NUC Kit, Ordroid XU4, etc. While this implementation can be further optimized for better performance with reduced requirements, the specified specifications do not represent absolute global minimum thresholds.

5. Conclusions

Complete modeling of the solar PV system has been carried out in Python. The PV results of modelling of JA solar PV panel and the effects of environmental conditions validate the performance of the solar PV class, which is used to design any solar PV. On comparison with the specification sheet of the JA solar panel confirms the simulation’s robustness for most parameters and demonstrates reliable performance (average error: 1.6%), validating its utility for predicting panel behaviour under standard conditions. The design, implementation, and analysis of two metaheuristic-based MPPT algorithms were conducted in this research. The comparison has been carried out at STC and complex partial shading conditions. The study conducted a two-part analysis of metaheuristic-based MPPT trackers. First, the search response was evaluated through equal function assessments, examining variations in optimum power, algorithm runtime, and the exploration-exploitation balance across epochs. Second, a comparative evaluation focused specifically on steady-state performance, assessing the tracker’s convergence stability and efficiency during sustained operation. The table compares PSO and ABC MPPT tracking methods under Standard Test Conditions (STC) and complex partial shading. Under STC, ABC achieved higher power (334.67W vs 331.12 W) and efficiency (99.6% vs. 98.5%) but slower convergence (0.98 s vs. 0.81 s) than PSO. During partial shading, ABC maintained superior performance (267.43 W, 99.04% efficiency, 1.84 s convergence) compared to PSO (262.78 W, 97.32%, 2.23 s). The PSO-based MPPT tracks the best MPP more quickly but the tracking efficiency is less compared to ABC-based MPPT in both cases of STC as well as complex partial shading conditions. The feasibility analysis for edge device implementation also determines the minimum hardware specifications required.

Author Contributions

Conceptualization, M.S.B.A., S.M.A. (Syed Majed Ashraf) and S.M.A. (Shahrin Md. Ayob); methodology, M.S.B.A. and S.M.A. (Syed Majed Ashraf); validation, M.S.B.A., M.I.M., M.K., S.M.A. (Shahrin Md. Ayob) and S.M.A. (Syed Majed Ashraf); formal analysis, M.S.B.A., S.M.A. (Syed Majed Ashraf) and S.M.A. (Shahrin Md. Ayob); writing—original draft preparation, M.S.B.A. and S.M.A. (Syed Majed Ashraf); writing—review and editing, M.S.B.A., M.I.M., M.K. and S.M.A. (Shahrin Md. Ayob); supervision, M.S.B.A.; funding acquisition, M.I.M. and M.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
COPConference of Parties
SDGSustainable Development Goal
PVPhotovoltaic
STCStandard Test Conditions
MPPMaximum Power Point
MPPTMaximum Power Point Tracker
CMPPTConventional Maximum Power Point Tracker
AMPPTAdvance Maximum Power Point Tracker
MhMPPTMetaheuristic Maximum Power Point Tracker
PSOParticle Swarm Optimization
ABCArtificial Bee Colony
HSHarmony Search
ACOAnt Colony Optimization
CPSCComplex Partial Shading Condition

Appendix A

Appendix A.1

Mathematical Formulation of HS:
The mathematical modeling is done by finding the probability of optimal harmony P r ( H ) as shown in Equation (A1).
P r ( H ) = [ H r H i M + ( 1 H r ) 1 L ]
where:
  • 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)
  • H i = the optimum solution or note value of instrument (global best)
  • H r = considering rate of harmony memory
At the starting of optimization, HM is filled with random sequence of harmonies. there is no optimal note in all instrument as shown in (A2)
H 1 = H 2 = . . . + H n = 0
and it means that probability of is very low as shown in Equation (A3)
P r ( H ) = [ ( 1 H r ) 1 L ] N

Appendix A.2

Mathematical Formulation of ACO: The first step is to generate the first batch of random solutions by releasing K random solutions. The number of parameter is N (artificial ants) such that N Z . To simulate the pheromone, the output is represented as fitness function represented by F ( x i ) where x i is position at which the fitness function is evaluated., it is shown mathematically in Equation (A4)
F ( x 1 ) F ( x 2 ) F ( x N )
Gaussian Function is used to for the solution of ith dimension as shown in Equation (A5)
G i ( x ) = k = 1 z W k g k i ( x ) = k = 1 z w k 1 σ k 2 π e x p ( ( x μ k i ) 2 2 ( σ k i ) 2 )
in the Equation (A5), weight factor (A6) sub Gausian function, standard deviation, means, the probability for selecting gausian function is calculated by using Equation (A7)
w k = 1 ϕ Z 2 π e x p ( ( k 1 ) 2 2 ( ϕ Z ) 2 )
P k = w k j = 1 z w j

References

  1. 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]
  2. 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]
  3. 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).
  4. 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).
  5. 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]
  6. UNFCC. Paris Agreement; UNFCC: Piscataway, NJ, USA, 2015. [Google Scholar]
  7. 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]
  8. 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).
  9. 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.
  10. Ma, T.; Yang, H.; Lu, L. Solar photovoltaic system modeling and performance prediction. Renew. Sustain. Energy Rev. 2014, 36, 304–315. [Google Scholar] [CrossRef]
  11. 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]
  12. 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]
  13. 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]
  14. 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]
  15. 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]
  16. 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]
  17. 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]
  18. 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]
  19. Wasynezuk, O. Dynamic behavior of a class of photovoltaic power systems. IEEE Trans. Power Appar. Syst. 1983, PAS-102, 3031–3037. [Google Scholar] [CrossRef]
  20. 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]
  21. 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]
  22. 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]
  23. Mikofski, M.; Meyers, B.; Chaudhari, C. PVMismatch Project. 2018. Available online: https://github.com/SunPower/PVMismatch (accessed on 8 March 2022).
  24. 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]
  25. 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]
  26. 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).
  27. 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]
  28. 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]
  29. 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]
  30. Geem, Z.W.; Kim, J.H.; Loganathan, G.V. A New Heuristic Optimization Algorithm: Harmony Search. Simulation 2001, 76, 60–68. [Google Scholar] [CrossRef]
  31. 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]
  32. 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]
Figure 1. Power Sector Overview. (a) India’s Aggregate Installed Capacity, (b) Electricity Generation during GY 2021–2022.
Figure 1. Power Sector Overview. (a) India’s Aggregate Installed Capacity, (b) Electricity Generation during GY 2021–2022.
Energies 18 03160 g001
Figure 2. Classification of MPPT Techniques.
Figure 2. Classification of MPPT Techniques.
Energies 18 03160 g002
Figure 3. Two-diode model of a PV cell.
Figure 3. Two-diode model of a PV cell.
Energies 18 03160 g003
Figure 5. Derived techniques from base MPPT class.
Figure 5. Derived techniques from base MPPT class.
Energies 18 03160 g005
Figure 6. PSO Based MPPT Flowchart.
Figure 6. PSO Based MPPT Flowchart.
Energies 18 03160 g006
Figure 7. Flowchart of ABC-based MPPT.
Figure 7. Flowchart of ABC-based MPPT.
Energies 18 03160 g007
Figure 8. Output voltage, current, and power of the modelled PV panel under different conditions.
Figure 8. Output voltage, current, and power of the modelled PV panel under different conditions.
Energies 18 03160 g008
Figure 9. Shading condition.
Figure 9. Shading condition.
Energies 18 03160 g009
Figure 10. Steady state responses implementing PSO and ABC at STC.
Figure 10. Steady state responses implementing PSO and ABC at STC.
Energies 18 03160 g010
Figure 11. Steady state responses implementing PSO and ABC under complex partial shading condition.
Figure 11. Steady state responses implementing PSO and ABC under complex partial shading condition.
Energies 18 03160 g011
Figure 12. Qualitative analysis of ABC and PSO-based MPPT at STC. (a) Voltage vs. Current, (b) Variation of Duty, Voltage and Power with time, (c) Global Maximum Power vs. Epoch.
Figure 12. Qualitative analysis of ABC and PSO-based MPPT at STC. (a) Voltage vs. Current, (b) Variation of Duty, Voltage and Power with time, (c) Global Maximum Power vs. Epoch.
Energies 18 03160 g012
Figure 13. Qualitative analysis of ABC and PSO based MPPT at complex partial shading condition. (a) Voltage vs. Current, (b) Variation of Duty, Voltage and Power with time, (c) Global Maximum Power vs. Epoch.
Figure 13. Qualitative analysis of ABC and PSO based MPPT at complex partial shading condition. (a) Voltage vs. Current, (b) Variation of Duty, Voltage and Power with time, (c) Global Maximum Power vs. Epoch.
Energies 18 03160 g013
Figure 14. Variation of exploration/exploitation and runtime vs. epoch of ABC based MPPT. (a) Exploration and exploitation percentages vs. Epoch at STC, (b) Runtime vs. Epoch at STC, (a’) Exploration and exploitation percentages vs. Epoch at complex partial shading condition, (b’) Runtime vs. Epoch at complex partial shading condition.
Figure 14. Variation of exploration/exploitation and runtime vs. epoch of ABC based MPPT. (a) Exploration and exploitation percentages vs. Epoch at STC, (b) Runtime vs. Epoch at STC, (a’) Exploration and exploitation percentages vs. Epoch at complex partial shading condition, (b’) Runtime vs. Epoch at complex partial shading condition.
Energies 18 03160 g014
Figure 15. Variation of exploration/exploitation and runtime vs. epoch of PSO-based MPPT. (a) Exploration and exploitation percentages vs. Epoch at STC, (b) Runtime vs. Epoch at STC, (a’) Exploration and exploitation percentages vs. Epoch at complex partial shading condition, (b’) Runtime vs. Epoch at complex partial shading condition.
Figure 15. Variation of exploration/exploitation and runtime vs. epoch of PSO-based MPPT. (a) Exploration and exploitation percentages vs. Epoch at STC, (b) Runtime vs. Epoch at STC, (a’) Exploration and exploitation percentages vs. Epoch at complex partial shading condition, (b’) Runtime vs. Epoch at complex partial shading condition.
Energies 18 03160 g015
Table 1. Analysis of JAP6-72-325 Panel Simulation Results.
Table 1. Analysis of JAP6-72-325 Panel Simulation Results.
ParametersActual ValueSimulation ValueError (%)Unit
Isc9.069.060A
Voc46.2247.833.4V
Vmp37.3838.642.6V
Imp8.568.540.23V
Pmp320.82335.022.8V
α Isc0.0580.0591.7%/°C
γ Pmp−0.41−0.4192.2%/°C
β Voc−0.33−0.3280.6%/°C
Table 2. Comparative Performance of Metaheuristic MPPT Algorithms (STC: Standard Test Conditions; CPSC: Complex Partial Shading Condition).
Table 2. Comparative Performance of Metaheuristic MPPT Algorithms (STC: Standard Test Conditions; CPSC: Complex Partial Shading Condition).
No.MPPTSTCCPSC
CT (s)MP (W)CV (%)TF (%)CT (s)MP (W)CV (%)TF (%)
1PSO0.81331.21.0198.52.23262.32.597.3
2ABC0.98334.10.4999.61.84268.62.499.1
3HS0.47298.42.1288.60.91203.84.375.4
4ACO0.89332.50.8198.72.91242.12.989.3
CT: Convergence Time; MP: Mean Power; TF: Tracking Efficiency; CV: Coefficient of Variation.
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.

Share and Cite

MDPI and ACS Style

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

AMA Style

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 Style

Ashraf, 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 Style

Ashraf, 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

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop