# A Novel Bio-Inspired Algorithm Applied to Selective Harmonic Elimination in a Three-Phase Eleven-Level Inverter

Authors: Adrián F. Peña-Delgado; Hernán Peraza-Vázquez; Juan H. Almazán-Covarrubias; Nicolas Torres Cruz; Pedro Martín García-Vite; Ana Beatriz Morales-Cepeda; Juan M. Ramirez-Arredondo
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

Selective harmonics elimination (SHE) is a widely applied control strategy in multilvel inverters for harmonics reduction. SHE is designed for the elimination of low-order harmonics while keeping the fundamental component equal to any previously specified amplitude. This paper proposes a novel bio-inspired metaheuristic optimization algorithm called Black Widow Optimization Algorithm (BWOA) for solving the SHE set of equations. BWOA mimics the spiders’ different movement strategies for courtship-mating, guaranteeing the exploration and exploitation of the search space. The optimization results show the reliability of BWOA compared to the state-of-the-art metaheuristic algorithms and show competitive results as a microalgorithm, opening its future application for an on-line optimization calculation in low requirement hardware.


---

## Body

## 1. Introduction

Inverters are power electronics devices capable of providing an alternating output waveform from a direct current source at the required frequency and output voltage design specifications. Square or quasi-square output waveform inverters are among the most common and basic inverter types. Similar to simple inverters, a multilevel inverter converts a dc source into an alternating output. However, the output current is generated as a multiple-step waveform at many voltage levels. Multilevel inverters (MLI) were first introduced midway during the seventies decade. However, due to their versatility, they have been consistently applied as medium high voltage inverters, industrial drivers, and static VAR compensators, as well as for transmission and distributions systems, just to mention some [1, 2]. Their main advantage resides on their higher power quality, low switching losses, and better electromagnetic compatibility. Even though there have been a few decades since they were initially developed, researchers are still designing new topologies and modulation strategies to improve the multilevel inverters’ performance, including, but not limited to, increasing their efficiency and to reduce harmonic content and electromagnetic interference (EMI) [3, 4]. The best possible MLI performance arises from a combination of selecting a given topology and matching it with the right modulation strategy.In terms of inverter topologies, the most common MLI types found in the literature are diode-clamped, capacitor-clamped, and cascaded H-bridge inverters. From the modulation strategies perspective, MLI are categorized in two main groups: fundamental switching frequency and high-switching frequency. Each of these groups has two subdivisions, where selective harmonic elimination and space vector control are considered part of the fundamental switching frequency group, whereas the second group includes the high-switching frequencies, pulsed width modulation strategies (PWM): space vector and multilevel sinusoidal. [3, 4].Particularly, for the purpose of this research, this study uses the cascaded H-bridge multilevel topology and the selective harmonic elimination (SHE) control strategy [5,6]. The cascaded H-Bridge multilevel topology consists of multiple H-bridge inverter modules with separate dc sources, connected in cascade or series. The typical staircase voltage output with selective harmonics elimination for multilevel inverters is generated by the correct angle switching and synchronization of power device semiconductors. By Fourier transforming the voltage output, a series of nonlinear equations need to be solved for the unknown angles per quarter of the fundamental cycle. Basically, SHE aims for the elimination of the low-order harmonics by making them equal to zero, while keeping the fundamental component equal to the desired amplitude [7–11]. Several techniques have been applied to solve this set of equations, ranging from iterative methods such as Newton–Raphson [12] to stochastic methods such as genetic algorithms (GA) [13–15] and particle swarm optimization (PSO) [16, 17]. However, each of these techniques has their own drawbacks that reduce their use in selective harmonic elimination. Use of the Newton–Raphson method is not recommended to solve for a high number of angles as in multilevel inverters, whereas genetic algorithms’ main limitation is its convergence rate, which is very slow when compared to other algorithms. On the contrary, PSO [18], a swarm-based metaheuristic, has a very good convergence rate, but suffers from stagnation when searching for the local minima. In order to overcome some of these issues, metaheuristics such as the bee [19], ant colony [20], modified version of the fish algorithm [21], and firefly algorithms [22] have also been applied to SHE in multilevel inverters, achieving better results than PSO. Recently, two new metaheuristic, the whale optimization algorithm (WOA) [23] and a modified version of grey wolf optimization [24] (MGWO), have been applied to the SHE technique. Routray et al. in [25] show that the MGWO algorithm outperforms the grey wolf optimization GWO, the genetic algorithm (GA), and the particle swarm optimization (PSO) methods. Similarly, Kar et al. in [26] compared WOA with PSO and the firefly algorithm, showing WOA’s faster response and less computation time. Each of these optimization methods requires a suitable objective function that includes the SHE set of equations with the proper constraints. Several objective functions have been described in the literature [10, 14, 25–28] for the SHE problem. In this paper, the objective function defined in [26, 27] is used. Currently, researchers are still applying new methods to solve the SHE technique, such as the flower pollination algorithm [29], teaching-learning-based optimization [28] and a differential harmony search algorithm [30], demonstrating the continuous interest in this topic.This paper aims to establish the black widow optimization algorithm theoretical foundations as a new alternative method to solve the SHE set of equations.


## 2. Materials and Methods

### 2.1. Selective Harmonic Elimination Problem Formulation

As previously mentioned, the cascaded H-bridge multilevel topology integrates several H-bridge modules with isolated dc sources connected either in series or parallel, as seen in Figure1. The mathematical relationship between the isolated dc sources (s) and the number of levels (n) is defined asFigure 1
3ϕ n-level multilevel inverter (MLI). The H-bridge modules with isolated power sources are also depicted.(1)n=2s+1.The number of power devices semiconductorsNsw can be calculated by(2)Nsw=6n−1,whereas the peak voltage Vp of the phase voltages VA−N, VB−N and VC−N can be defined as follows:(3)VA−N=VB−N=VC−N=sVdc.Figure2 illustrates the staircase waveform output for a 3 phase n-level MLI and its functional relationship with the number of switches and switching times, whereas in Figure 3, the typical staircase phase voltage VA−N waveform output for a MLI with isolated sources is also illustrated, where the switching angles are subject to(4)0≤α1≤α2≤⋯≤αs−1≤αs≤90∘.Additionally, the mathematical representation of Figure3 is described as in the following equation:Figure 2
General representation and operation of a3ϕ phase voltage of an n-level multilevel inverter.Figure 3
Typical multilevel inverter staircase waveform output represented as a function of angles and switching times.(5)ftV+=0,0<t<α1,Vdc,α1<t<α2,2Vdc,α2<t<αs−1,⋮⋮s−1Vdc,αs−1<t<αs,sVdc,αs<t<π−αs,s−1Vdc,π−αs<t<π−αs−1,⋮⋮2Vdc,π−αs−1<t<π−α2,Vdc,π−α2<t<π−α1,0,π−α1<t<π,ftV−=0,π<t<π+α1,−Vdc,π+α1<t<π+α2,−2Vdc,π+α2<t<π+αs−1,⋮⋮−s−1Vdc,π+αs−1<t<π+αs,−sVdc,π+αs<t<2π−αs,−s−1Vdc,2π−αs<t<2π−αs−1,⋮⋮−2Vdc,2π−αs−1<t<2π−α2,−Vdc,2π−α2<t<2π−α1,0,2π−α1<t<2π.The Fourier series expansion of the output multilevel inverter presented in Figure3 can be defined as follows:(6)ft=A0︸dc+∑n=1∞Ancosnα+Bnsinnα︸ac|ω0=2πT.Due to the nature of the waveform and the quarter wave symmetry, the dc componentA0 and the Fourier coefficient An will be both equal to 0. Therefore, the equation can be rewritten as follows:(7)ft=∑n=1∞Bnsinnα.Substituting equation (5) in (7), the Fourier series expansion of the MLI staircase output waveform is defined as follows:(8)ftV+=4Vdcnπcosnα1+⋯+cosnαn,for oddn,0,for evenn.In this work, as a case of study, a3ϕ eleven-level multilevel inverter is selected. Thus, the selective harmonic elimination set of equations that eliminates the fifth, seventh, eleventh, and thirteenth harmonic can be rewritten as below:(9)cosα1+cosα2+⋯+cosα5=M,cos5α1+cos5α2+⋯+cos5α5=0,cos7α1+cos7α2+⋯+cos7α5=0,cos11α1+cos11α2+⋯+cos11α5=0,cos13α1+cos13α2+⋯+cos13α5=0,where M=V1∗/4Vdcπ and the modulation index is defined as m=M/5 for 0≤m≤1.Therefore, the objective function, previously reported in [26, 27], is defined as follows:(10)minfα1,α2,…,α5=∑i=15cosαi−M2+∑i=15cos5αi2+⋯+∑i=15cos13αi2,subjected to the switching angles as described by equation (4).


## 2.1. Selective Harmonic Elimination Problem Formulation

As previously mentioned, the cascaded H-bridge multilevel topology integrates several H-bridge modules with isolated dc sources connected either in series or parallel, as seen in Figure1. The mathematical relationship between the isolated dc sources (s) and the number of levels (n) is defined asFigure 1
3ϕ n-level multilevel inverter (MLI). The H-bridge modules with isolated power sources are also depicted.(1)n=2s+1.The number of power devices semiconductorsNsw can be calculated by(2)Nsw=6n−1,whereas the peak voltage Vp of the phase voltages VA−N, VB−N and VC−N can be defined as follows:(3)VA−N=VB−N=VC−N=sVdc.Figure2 illustrates the staircase waveform output for a 3 phase n-level MLI and its functional relationship with the number of switches and switching times, whereas in Figure 3, the typical staircase phase voltage VA−N waveform output for a MLI with isolated sources is also illustrated, where the switching angles are subject to(4)0≤α1≤α2≤⋯≤αs−1≤αs≤90∘.Additionally, the mathematical representation of Figure3 is described as in the following equation:Figure 2
General representation and operation of a3ϕ phase voltage of an n-level multilevel inverter.Figure 3
Typical multilevel inverter staircase waveform output represented as a function of angles and switching times.(5)ftV+=0,0<t<α1,Vdc,α1<t<α2,2Vdc,α2<t<αs−1,⋮⋮s−1Vdc,αs−1<t<αs,sVdc,αs<t<π−αs,s−1Vdc,π−αs<t<π−αs−1,⋮⋮2Vdc,π−αs−1<t<π−α2,Vdc,π−α2<t<π−α1,0,π−α1<t<π,ftV−=0,π<t<π+α1,−Vdc,π+α1<t<π+α2,−2Vdc,π+α2<t<π+αs−1,⋮⋮−s−1Vdc,π+αs−1<t<π+αs,−sVdc,π+αs<t<2π−αs,−s−1Vdc,2π−αs<t<2π−αs−1,⋮⋮−2Vdc,2π−αs−1<t<2π−α2,−Vdc,2π−α2<t<2π−α1,0,2π−α1<t<2π.The Fourier series expansion of the output multilevel inverter presented in Figure3 can be defined as follows:(6)ft=A0︸dc+∑n=1∞Ancosnα+Bnsinnα︸ac|ω0=2πT.Due to the nature of the waveform and the quarter wave symmetry, the dc componentA0 and the Fourier coefficient An will be both equal to 0. Therefore, the equation can be rewritten as follows:(7)ft=∑n=1∞Bnsinnα.Substituting equation (5) in (7), the Fourier series expansion of the MLI staircase output waveform is defined as follows:(8)ftV+=4Vdcnπcosnα1+⋯+cosnαn,for oddn,0,for evenn.In this work, as a case of study, a3ϕ eleven-level multilevel inverter is selected. Thus, the selective harmonic elimination set of equations that eliminates the fifth, seventh, eleventh, and thirteenth harmonic can be rewritten as below:(9)cosα1+cosα2+⋯+cosα5=M,cos5α1+cos5α2+⋯+cos5α5=0,cos7α1+cos7α2+⋯+cos7α5=0,cos11α1+cos11α2+⋯+cos11α5=0,cos13α1+cos13α2+⋯+cos13α5=0,where M=V1∗/4Vdcπ and the modulation index is defined as m=M/5 for 0≤m≤1.Therefore, the objective function, previously reported in [26, 27], is defined as follows:(10)minfα1,α2,…,α5=∑i=15cosαi−M2+∑i=15cos5αi2+⋯+∑i=15cos13αi2,subjected to the switching angles as described by equation (4).


## 3. Black Widow Optimization Algorithm

In this section, the inspiration of the proposed method is first discussed. Then, the mathematical model is provided.


### 3.1. Biological Fundamentals

The western black widow spider (Latrodectus hesperus or L. hesperus) is a venomous spider species found from western Canada to southern Mexico. The venom, present in female black widows, contains a potent neurotoxin active against a range of animals. Furthermore, the said venom is one of the most dangerous for humans given that just one bite can cause death. These spiders feed on insects such as cockroaches, beetles, and butterflies; they weave their web in trees and inhabit forests and swamps. Males, who use sex pheromones to discern female mating status, are known to show no interest in mating with starving and poorly fed females, as females can exhibit cannibalistic behavior. Further details about the black widow spiders’ behaviour can be found in [31, 32].


### 3.2. Mathematical Model

In this section, the mathematical model of spiders’ different movement strategies for courtship-mating and the pheromone rate is first provided. Afterwards, the black widow algorithm is then proposed.


#### 3.2.1. Strategy: Movement and Pheromones

(1) Movement. As part of the moving strategies, the spider’s movements within the web were modelled as linear and spiral, as described in equation (11) and illustrated in Figure 4: where x⟶it+1 is the new position of a search agent, indicating the movement of the spider, and x⟶∗t is the best search agent found from the previous iteration. The variable m is a float number generated randomly in the interval of 0.4,0.9, r1 is the random integer number generated in the interval from 1 to the size of maximum of search agents, and x⟶r1t is the r1th search agent selected, with i≠r1. Finally, β is defined as a random float number generated in the interval of −1.0,1.0, and x⟶it as the current search agent.Figure 4
Typical spider movement within the web.(11)x⟶it+1=x⟶∗t−mx⟶r1t,if rand≤0.3,x⟶∗t−cos2πβx⟶it,in other case,(2) Pheromones. Pheromones perform a very important role in the courtship-mating of L. hesperus spiders. In [31], the link between the spiders diet and the change in pheromone signals that affects the quality and quantity of silk is shown. In other words, well-fed female spiders produce more silk than hungry females. Male spiders are more responsive to sex pheromones from well-fed females, as they provide the benefit of having higher fertility, but primarily to avoid the cost of risky mating attempts with a likely hungry cannibal female. That is, male black widow spiders prefer to avoid cannibalism rather than seek for more fertile females. Sex pheromones alone can provide an insight into the recent feeding history of females, possibly reducing costs for males expressing their choice in the field. Therefore, female spiders with low pheromone rates are not preferred by male spiders. On this research, the black widow spiders’ pheromone rate value is defined in the following equation:(12)pheromonei=fitnessmax−fitnessifitnessmax−fitnessmin,where fitnessmax and fitnessmin are the worst and the best fitness value in the current generation, respectively, whereas fitnessi is the current fitness value of the ith search agent. The pheromone vector, in equation (12), contains the normalized fitness in the interval of 0,1. For low pheromones rates values equal or less than 0.3, equation (13) is applied in Algorithm 1. Low pheromone levels in a female spider represent a hungry cannibal spider. Therefore, if they are present, the said female spiders will not be chosen but will be replaced for another one:(13)x⟶it=x⟶∗t+12x⟶r1t−−1σ∗x⟶r2t,where x⟶it is the search agent (female spider) with low pheromone rate that will be updated. r1 and r2 are random integer numbers generated in the interval from 1 to the maximum size of search agents (spiders), with r1≠r2, whereas x⟶r1t and x⟶r2t are the r1,r2th search agents selected, x⟶∗t is the best search agent found from the previous iteration, and σ is a binary number randomly generated in Algorithm 2, σ∈0,1.Algorithm 1: Pheromone procedure.
(1)
Begin procedure(2)
fori=1 to sizePopulation do(3)
ifpheromonei≤0.3then(4)
x⟶i search agent updated by equation (13).(5)
end if(6)
end for(7)
End procedureAlgorithm 2:σ procedure.
(1)
Begin procedure(2)
ifrand≤0.5then(3)
return 0(4)
else(5)
return 1(6)
end if(7)
End procedure(3) Pseudocode and Computational Complexity of the BWOA Algorithm. The pseudocode of the BWOA is explained in Algorithm 3. Important aspects to mention about the algorithm are that it does not require more parameters to run than the size of the population (search agents or female spiders) and the number of iterations. On each iteration, the values of m (linear movement) and β (spiral movement) vary, as described in line 4 of Algorithm 3, where both randomly generated variables are inside the main while loop. In order to update the whole population, the low pheromone criterion (line 10 and 11) helps the algorithm to get a second chance to improve the fitness quality before the next iteration. In terms of the spider’s biological behavior, it is used to represent cannibalism in female spiders, or the nonselection of females by male spiders, due to their low pheromone levels. These strategies and rules provide a fine balance between the intensification (exploitation) and diversification (exploration) over the search space (Algorithm 3).Algorithm 3: Black widow optimizer algorithm (BWOA).
(1)
Begin procedure(2)
Generate the initial population(3)
while iteration < Max Number of Iterations do(4)
Initialization random of parametersm and β, where 0.4 ≤ m ≤ 0.9 and −1.0 ≤β≤ 1.0(5)
ifrandom<0.3then(6)
xnewi=x⟶∗t−mx⟶r1t(7)
else(8)
xnewi=x⟶∗t−cos2πβx⟶it(9)
end if(10)
Compute pheromone for each search agent by equation (12)(11)
Update search agents that havelow pheromone value, Algorithm 1, equation (13)(12)
Calculatexnew fitness value of the new search agents(13)
ifxnew<x∗then(14)
x∗=xnew(15)
end if(16)
iteration=iteration+1(17)
end while(18)
Displayx∗, the best optimal solution(19)
end procedure(4) Time Complexity. Without any loss of generality, let f be any optimization problem and suppose that O (f) is computational time complexity of evaluating its function value. Therefore, the BWOA computational time complexity is defined as O (tMax∗nSp∗f), where tMax is the maximum number of iterations and nSp is the number of spiders (population size).


## 3.1. Biological Fundamentals

The western black widow spider (Latrodectus hesperus or L. hesperus) is a venomous spider species found from western Canada to southern Mexico. The venom, present in female black widows, contains a potent neurotoxin active against a range of animals. Furthermore, the said venom is one of the most dangerous for humans given that just one bite can cause death. These spiders feed on insects such as cockroaches, beetles, and butterflies; they weave their web in trees and inhabit forests and swamps. Males, who use sex pheromones to discern female mating status, are known to show no interest in mating with starving and poorly fed females, as females can exhibit cannibalistic behavior. Further details about the black widow spiders’ behaviour can be found in [31, 32].


## 3.2. Mathematical Model

In this section, the mathematical model of spiders’ different movement strategies for courtship-mating and the pheromone rate is first provided. Afterwards, the black widow algorithm is then proposed.


### 3.2.1. Strategy: Movement and Pheromones

(1) Movement. As part of the moving strategies, the spider’s movements within the web were modelled as linear and spiral, as described in equation (11) and illustrated in Figure 4: where x⟶it+1 is the new position of a search agent, indicating the movement of the spider, and x⟶∗t is the best search agent found from the previous iteration. The variable m is a float number generated randomly in the interval of 0.4,0.9, r1 is the random integer number generated in the interval from 1 to the size of maximum of search agents, and x⟶r1t is the r1th search agent selected, with i≠r1. Finally, β is defined as a random float number generated in the interval of −1.0,1.0, and x⟶it as the current search agent.Figure 4
Typical spider movement within the web.(11)x⟶it+1=x⟶∗t−mx⟶r1t,if rand≤0.3,x⟶∗t−cos2πβx⟶it,in other case,(2) Pheromones. Pheromones perform a very important role in the courtship-mating of L. hesperus spiders. In [31], the link between the spiders diet and the change in pheromone signals that affects the quality and quantity of silk is shown. In other words, well-fed female spiders produce more silk than hungry females. Male spiders are more responsive to sex pheromones from well-fed females, as they provide the benefit of having higher fertility, but primarily to avoid the cost of risky mating attempts with a likely hungry cannibal female. That is, male black widow spiders prefer to avoid cannibalism rather than seek for more fertile females. Sex pheromones alone can provide an insight into the recent feeding history of females, possibly reducing costs for males expressing their choice in the field. Therefore, female spiders with low pheromone rates are not preferred by male spiders. On this research, the black widow spiders’ pheromone rate value is defined in the following equation:(12)pheromonei=fitnessmax−fitnessifitnessmax−fitnessmin,where fitnessmax and fitnessmin are the worst and the best fitness value in the current generation, respectively, whereas fitnessi is the current fitness value of the ith search agent. The pheromone vector, in equation (12), contains the normalized fitness in the interval of 0,1. For low pheromones rates values equal or less than 0.3, equation (13) is applied in Algorithm 1. Low pheromone levels in a female spider represent a hungry cannibal spider. Therefore, if they are present, the said female spiders will not be chosen but will be replaced for another one:(13)x⟶it=x⟶∗t+12x⟶r1t−−1σ∗x⟶r2t,where x⟶it is the search agent (female spider) with low pheromone rate that will be updated. r1 and r2 are random integer numbers generated in the interval from 1 to the maximum size of search agents (spiders), with r1≠r2, whereas x⟶r1t and x⟶r2t are the r1,r2th search agents selected, x⟶∗t is the best search agent found from the previous iteration, and σ is a binary number randomly generated in Algorithm 2, σ∈0,1.Algorithm 1: Pheromone procedure.
(1)
Begin procedure(2)
fori=1 to sizePopulation do(3)
ifpheromonei≤0.3then(4)
x⟶i search agent updated by equation (13).(5)
end if(6)
end for(7)
End procedureAlgorithm 2:σ procedure.
(1)
Begin procedure(2)
ifrand≤0.5then(3)
return 0(4)
else(5)
return 1(6)
end if(7)
End procedure(3) Pseudocode and Computational Complexity of the BWOA Algorithm. The pseudocode of the BWOA is explained in Algorithm 3. Important aspects to mention about the algorithm are that it does not require more parameters to run than the size of the population (search agents or female spiders) and the number of iterations. On each iteration, the values of m (linear movement) and β (spiral movement) vary, as described in line 4 of Algorithm 3, where both randomly generated variables are inside the main while loop. In order to update the whole population, the low pheromone criterion (line 10 and 11) helps the algorithm to get a second chance to improve the fitness quality before the next iteration. In terms of the spider’s biological behavior, it is used to represent cannibalism in female spiders, or the nonselection of females by male spiders, due to their low pheromone levels. These strategies and rules provide a fine balance between the intensification (exploitation) and diversification (exploration) over the search space (Algorithm 3).Algorithm 3: Black widow optimizer algorithm (BWOA).
(1)
Begin procedure(2)
Generate the initial population(3)
while iteration < Max Number of Iterations do(4)
Initialization random of parametersm and β, where 0.4 ≤ m ≤ 0.9 and −1.0 ≤β≤ 1.0(5)
ifrandom<0.3then(6)
xnewi=x⟶∗t−mx⟶r1t(7)
else(8)
xnewi=x⟶∗t−cos2πβx⟶it(9)
end if(10)
Compute pheromone for each search agent by equation (12)(11)
Update search agents that havelow pheromone value, Algorithm 1, equation (13)(12)
Calculatexnew fitness value of the new search agents(13)
ifxnew<x∗then(14)
x∗=xnew(15)
end if(16)
iteration=iteration+1(17)
end while(18)
Displayx∗, the best optimal solution(19)
end procedure(4) Time Complexity. Without any loss of generality, let f be any optimization problem and suppose that O (f) is computational time complexity of evaluating its function value. Therefore, the BWOA computational time complexity is defined as O (tMax∗nSp∗f), where tMax is the maximum number of iterations and nSp is the number of spiders (population size).


## 3.2.1. Strategy: Movement and Pheromones

(1) Movement. As part of the moving strategies, the spider’s movements within the web were modelled as linear and spiral, as described in equation (11) and illustrated in Figure 4: where x⟶it+1 is the new position of a search agent, indicating the movement of the spider, and x⟶∗t is the best search agent found from the previous iteration. The variable m is a float number generated randomly in the interval of 0.4,0.9, r1 is the random integer number generated in the interval from 1 to the size of maximum of search agents, and x⟶r1t is the r1th search agent selected, with i≠r1. Finally, β is defined as a random float number generated in the interval of −1.0,1.0, and x⟶it as the current search agent.Figure 4
Typical spider movement within the web.(11)x⟶it+1=x⟶∗t−mx⟶r1t,if rand≤0.3,x⟶∗t−cos2πβx⟶it,in other case,(2) Pheromones. Pheromones perform a very important role in the courtship-mating of L. hesperus spiders. In [31], the link between the spiders diet and the change in pheromone signals that affects the quality and quantity of silk is shown. In other words, well-fed female spiders produce more silk than hungry females. Male spiders are more responsive to sex pheromones from well-fed females, as they provide the benefit of having higher fertility, but primarily to avoid the cost of risky mating attempts with a likely hungry cannibal female. That is, male black widow spiders prefer to avoid cannibalism rather than seek for more fertile females. Sex pheromones alone can provide an insight into the recent feeding history of females, possibly reducing costs for males expressing their choice in the field. Therefore, female spiders with low pheromone rates are not preferred by male spiders. On this research, the black widow spiders’ pheromone rate value is defined in the following equation:(12)pheromonei=fitnessmax−fitnessifitnessmax−fitnessmin,where fitnessmax and fitnessmin are the worst and the best fitness value in the current generation, respectively, whereas fitnessi is the current fitness value of the ith search agent. The pheromone vector, in equation (12), contains the normalized fitness in the interval of 0,1. For low pheromones rates values equal or less than 0.3, equation (13) is applied in Algorithm 1. Low pheromone levels in a female spider represent a hungry cannibal spider. Therefore, if they are present, the said female spiders will not be chosen but will be replaced for another one:(13)x⟶it=x⟶∗t+12x⟶r1t−−1σ∗x⟶r2t,where x⟶it is the search agent (female spider) with low pheromone rate that will be updated. r1 and r2 are random integer numbers generated in the interval from 1 to the maximum size of search agents (spiders), with r1≠r2, whereas x⟶r1t and x⟶r2t are the r1,r2th search agents selected, x⟶∗t is the best search agent found from the previous iteration, and σ is a binary number randomly generated in Algorithm 2, σ∈0,1.Algorithm 1: Pheromone procedure.
(1)
Begin procedure(2)
fori=1 to sizePopulation do(3)
ifpheromonei≤0.3then(4)
x⟶i search agent updated by equation (13).(5)
end if(6)
end for(7)
End procedureAlgorithm 2:σ procedure.
(1)
Begin procedure(2)
ifrand≤0.5then(3)
return 0(4)
else(5)
return 1(6)
end if(7)
End procedure(3) Pseudocode and Computational Complexity of the BWOA Algorithm. The pseudocode of the BWOA is explained in Algorithm 3. Important aspects to mention about the algorithm are that it does not require more parameters to run than the size of the population (search agents or female spiders) and the number of iterations. On each iteration, the values of m (linear movement) and β (spiral movement) vary, as described in line 4 of Algorithm 3, where both randomly generated variables are inside the main while loop. In order to update the whole population, the low pheromone criterion (line 10 and 11) helps the algorithm to get a second chance to improve the fitness quality before the next iteration. In terms of the spider’s biological behavior, it is used to represent cannibalism in female spiders, or the nonselection of females by male spiders, due to their low pheromone levels. These strategies and rules provide a fine balance between the intensification (exploitation) and diversification (exploration) over the search space (Algorithm 3).Algorithm 3: Black widow optimizer algorithm (BWOA).
(1)
Begin procedure(2)
Generate the initial population(3)
while iteration < Max Number of Iterations do(4)
Initialization random of parametersm and β, where 0.4 ≤ m ≤ 0.9 and −1.0 ≤β≤ 1.0(5)
ifrandom<0.3then(6)
xnewi=x⟶∗t−mx⟶r1t(7)
else(8)
xnewi=x⟶∗t−cos2πβx⟶it(9)
end if(10)
Compute pheromone for each search agent by equation (12)(11)
Update search agents that havelow pheromone value, Algorithm 1, equation (13)(12)
Calculatexnew fitness value of the new search agents(13)
ifxnew<x∗then(14)
x∗=xnew(15)
end if(16)
iteration=iteration+1(17)
end while(18)
Displayx∗, the best optimal solution(19)
end procedure(4) Time Complexity. Without any loss of generality, let f be any optimization problem and suppose that O (f) is computational time complexity of evaluating its function value. Therefore, the BWOA computational time complexity is defined as O (tMax∗nSp∗f), where tMax is the maximum number of iterations and nSp is the number of spiders (population size).


## 4. Experimental Setup

In order to prove the effective elimination of the desired harmonics, the BWOA algorithm is compared against the Whale optimization [26] and the Modified Grey Wolf algorithms [25]; the state-of-the-art algorithms were recently applied in the selective harmonic elimination technique. In all three algorithms, the optimization parameters were run for 200 iterations and a population size of 100.Additionally, the Black Widow Optimization Algorithm was also implemented for a smaller number of iterations and population sizes (100 and 15 respectively). Generally speaking, for population sizes≤ 25, algorithms are considered as microalgorithms (μ-algorithms). These algorithms have been widely applied due to their ability to give good results in applications that have restrictive hardware requirements [33].In order to verify the reliability of the calculated optimal angles, a Matlab/Simulink simulation is implemented to generate the staircase output waveform and to perform a Fourier analysis. As illustrated in Figure5, first, the best found angles are fed to the Fourier analysis and staircase waveform generation module (FASWG) for an off-line calculation and then, the total harmonic distortion (THD) and the Fourier spectrum are displayed to verify the correct elimination of the desired low order harmonics.Figure 5
Simulink implementation to calculate the total harmonic distortion (THD) for the best angles determined by the black widow optimization algorithm.All computations were carried out in MATLAB R2018a on a standard PC (Linux Kubuntu 18.04 LTS, Intel core i7, 2.50 GHz, 16 GB).


## 5. Results and Discussion

As previously described, the black widow optimization algorithm results are compared against the whale optimization (WOA) and modified grey wolf optimization (MGWOA) algorithms. The near-to optimal firing angles at 3 modulation index (0.6, 0.8, 1.0) are typically achieved by multilevel inverters, and their respective fitness and total harmonic distortion values are given in Tables1–3, respectively. It can be seen that the values obtained from BWOA outperform the WOA and MGWOA results regarding fitness and THD in all cases.Table 1
Black widow optimization parameters (BWOA): no. of iteration 250 and population size = 100 at different modulation indexes.
Modulation indexAnglesTHDFitnessα1α2α3α4α50.635.4446.9558.5872.6187.866.824.19e − 270.89.7033.4343.361.1883.65.633.05e − 291.07.8619.3729.6547.6863.215.011.29e − 28Table 2
Whale optimization parameters (WOA): no. of iteration 250 and population size = 100 at different modulation indexes.
Modulation indexAnglesTHDFitnessα1α2α3α4α50.635.3546.8958.4972.4487.706.878.17e − 050.833.2744.5052.9164.4976.645.5611.89e − 21.04.1920.2922.1241.9761.156.93.93e − 2Table 3
Grey wolf optimization parameters (MGWOA): no. of iteration 250 and population size = 100 at different modulation indexes.
Modulation indexAnglesTHDFitnessα1α2α3α4α50.635.2946.8058.4572.4687.746.872.78e − 040.810.3231.8344.7462.2385.656.733.37e − 31.00.4914.7425.6140.5789.165.7116.04e − 02Additionally, the BWOA was run at smaller optimization parameters as a microalgorithm (μ-BWOA) with a population size of 15 and a number of iterations of 100, converging faster with an acceptable solution. In order to determine the reliability of the BWOA and the μ-BWOA algorithms, the near-to optimal angles are fed to the FASWG calculation function. Figures 6 and 7 show the Fourier transform results using the data from Tables 1 and 4, respectively. It can be seen that, for both cases, BWOA and μ-BWOA, the calculated firing angles eliminate the desired low order harmonics previously selected.Figure 6
Line voltage output and Fourier transform spectrum for modulation indexes of 0.6 (a) and (d), 0.8 (b) and (e), and 1.0 (c) and (f), respectively. Firing angles taken from Table1 (BWOA results).Figure 7
Fourier transform spectrum calculated from the set of angles described in Table4 (μ-BWOA results).Table 4
Microblack widow optimization (μ-BWOA) parameters: no. of iteration 100 and population size = 15 at different modulation indexes.
Modulation indexAnglesTHDFitnessα1α2α3α4α50.635.4247.2859.2373.7688.786.466.60e − 030.819.9836.1751.9758.3670.085.719.70e − 031.07.152740.3251.7473.025.125.89e − 04Thus, in terms of a physical implementation of an 11-level multilevel inverter, theμ-BWOA can also be used to solve the SHE set of equations even in a low-specification hardware. So far, this is the first report for solving the SHE technique with a microalgorithm.Following the simulation validation of the near-to optimal calculated angles, Figure6, also shows the 3ϕ line voltage output waveform for modulation indexes of 1.0, 0.8, and 0.6 with a 100 sVdc voltage. Moreover, it can also be seen as a low overall THD at higher modulation indexes, as depicted in Figures 6(d)–6(f), respectively. Figure 8 shows the simulated 3ϕ line voltage (a), the output current for a pure resistive 10 Ω load (b), and a resistive-inductive 10 Ω–31.8 mH load (c) for a modulation of index of 1.Figure 8
Simulated eleven-level MLI: (a) line voltage output and current waveform output for a purely resistive and resistive-inductive load (b) and (c), respectively. From figure (c), it can be seen that the load current becomes more sinusoidal due to the filtering characteristic of the inductor reactance.


## 6. Conclusions

In this paper, a novel bio-inspired algorithm based on the spiders’ different movement strategies for courtship-mating is presented as an alternative method to solve the selective harmonic elimination problem. The black widow optimization algorithm was tested against the state-of-the-art algorithms previously used to solve the SHE technique, demonstrating its ability to get optimal (or near-to optimal) values. The simulation results show that the optimized angles can effectively remove the fifth, seventh, eleventh, and thirteenth harmonic of a three-phase eleven-level MLI.This paper also considers using the black widow optimization algorithm with low population parameters as a microalgorithm. As far as the authors’ knowledge, this condition has never been applied to solve the SHE problem before. Initial simulations show competitive results eliminating the preselected harmonics. This enables the BWOA to be run efficiently in an embedded system with low hardware requirements, as it can get close to optimal switching angle solutions with small population size and number of iterations. Future research will include in-depth analysis of BWOA for microalgorithm purposes, a physical implementation of the MLI, and a study comparing the different objective functions reported in the literature.



---

*Source: 8856040-2020-12-21.xml*