Research Article

A Hybrid Maximum Power Point Tracking Approach for Photovoltaic Systems under Partial Shading Conditions Using a Modified Genetic Algorithm and the Firefly Algorithm

Pseudocode 1

MATLAB pseudocode of the proposed algorithm.
Generate initial population
Initial fitness of initial individuals is determined by Eq. (2).
while (limit the execution times (max generations))
 while (convergence judgement conditions unsatisfied)
  //mutation process
  for i=1:4 //individual number
   calculate slope S of individual i by Eq. (4).
   calculate voltage adjustment VM of individual i by Eq. (3).
  end for i
  //attractive process
  for i=1:4 //individual number
     for j=1:4 //individual number
   if (i≠j)
    calculate distance D between i and j.
    calculate voltage movement VA of individual i by Eq. (5).
   end if
     end for j
  end for i
  //crossover process
     select parents for new individuals randomly.
     calculate the voltage of offspring VO from their parents‘operating
     voltages VRA & VRB using Eq. (6).
  //selection process
  for i=1:6 //4 parents and 2 offspring
     calculate fitness of each individual using Eq. (2).
  end for i
     sort the fitness of the individuals
     define the individual with the highest fitness as MPP.
     discard 2 individuals with the lowest fitness.
  //convergence process
  for i=1:4 /the rest of the individuals
     execute convergence judgement using Eq. (7) and Eq. (8).
  end for i
 end while (max generations)
iteration number = iteration number + 1 //record iteration number
end while (conditions are satisfied)
output the operating voltage of the MPP and the iteration number.