_applied sciences_  
_Article_  
**Total Harmonic Distortion Reduction in Multilevel Inverters**  
**through the Utilization of the Moth-Flame**  
**Optimization Algorithm**  
**[PERSON]**\({}^{1,\dagger}\)**, [PERSON]**\({}^{2,\ddagger}\)**, [PERSON]**\({}^{3,\ddagger}\)**, [PERSON]**\({}^{4,\ddagger}\)**,**  
**[PERSON]**\({}^{4,\ddagger}\)**, [PERSON]**\({}^{5,\ddagger}\)**, [PERSON]**\({}^{4,\ddagger}\)**, [PERSON]**\({}^{6,\ddagger}\)**,**  
**[PERSON]**\({}^{4,\ddagger}\)**, [PERSON]**\({}^{5,\ddagger}\)**, [PERSON]**\({}^{7,\ddagger,\ddagger}\)**,**  
**[PERSON]**\({}^{4,\ast,\ddagger}\)**and [PERSON]**\({}^{4,\ddagger}\)**  
sequence of the semiconductor switches within the inverter structure [3; 4; 5]. However, a poor sequence of the multilevel inverter semiconductors leads to a high level of THD in the output voltage. Due to the above, a well-suited arrangement of semiconductors can generate a seamless output voltage featuring minimal total harmonic distortion (THD) [6; 7; 8; 9; 10]. The sequence of the semiconductors can be mainly established using digital platforms, like microcontrollers or Digital Signal Processors, among others. Numerous articles have tackled the optimization of the THD for the output voltage in the Cascade H-Bridge Multilevel Inverter Topology (CHBMLI) by obtaining and implementing the switching angles that generate the voltage output waveform by using low-frequency modulation [11; 12; 13; 14; 15; 16]. The obtention of the switching angles is primarily carried out using Selective Harmonic Elimination (SHE) and the Optimal Minimization of the Total Harmonic Distortion (OMTHD). In the SHE method, the objective is to reduce the low-order harmonics of the CHBMLI, like the 3 rd, 5 th, and 7 th, among others [12]. This method solves a set of nonlinear equations, which are as follows:  
\[\cos(\theta_{1})+\cos(\theta_{2})+...+\cos(\theta_{s})=r \tag{1}\]  
\[\cos(3\theta_{1})+\cos(3\theta_{2})+...+\cos(3\theta_{s})=0 \tag{2}\]  
\[\cos(5\theta_{1})+\cos(5\theta_{2})+...+\cos(5\theta_{s})=0 \tag{3}\]  
\[\vdots\]  
\[\cos(n\theta_{1})+\cos(n\theta_{2})+...+\cos(n\theta_{s})=0 \tag{4}\]  
In this context, \(r\) represents the magnitude of the fundamental value that has been suggested. The Equations (2) to (4) need to be equated to zero to remove the contribution of that specific harmonic, thus yielding the correct switching angles for the semiconductor devices. Therefore, reducing or eliminating the low-order harmonics using this method achieves a low THD value. These equations also need to satisfy the following condition: \(0\leq\theta_{1}\leq\theta_{2}...\leq\theta_{n}\leq\frac{\pi}{2}\), where \(0\leq\theta_{1}\) to \(0\leq\theta_{n}\) represents the switching angles of the CHBMLI. To address Equations (2) to (4), numerous authors employ metaheuristic algorithms, which mimic the advantageous characteristics found in nature, driven by the principles of natural selection and societal adaptation [17]; for instance, the SHE method, along with the Genetic algorithm (GA), is used in reference [18] to eliminate the 5 th and 7 th harmonics in a seven-level CHBMLI, while the authors of reference [19] use the Newton Raphson (NR) and the Particle Swarm Optimization (PSO) algorithm to eliminate the 5 th and 7 th harmonics as well in a seven-level CHBMLI. By contrast, in reference [20], this method is simulated to eliminate the odd harmonics up to the 15 th with the GA algorithm. On the other hand, the OMTHD technique also allows for obtaining the switching angles of a CHBMLI; however, the objective of this function is to directly reduce the THD in the output voltage pattern of a CHBMLI, and, compared to the SHE method, the OMTHD manipulates the value of the harmonics without maintaining or eliminating any specific harmonics (including the fundamental component) [11]. The OMTHD method has been carried out using conventional techniques like the NR method [11; 15], where the authors obtained the THD values for the CHBMLI across configurations of five, seven, and nine levels.