# Differential Evolution Applied to a Multilevel Inverter--A Case Study
## 2 Materials and Methods
### Optimization Problem Statement  
Optimization is obtaining the best possible solution to several designs and engineering problems.  
An optimization problem contains three important aspects:  
1. Objective function: the property to be optimized, which can be expressed as a linear or non-linear function.
2. Decision variable: an unknown element of an optimization problem.
3. Constraints: restrictions that must be satisfied to produce an acceptable result.  
For a stated objective function that is defined on the set of all decision variables, a decision must be found such that the objective is optimized (minimized or maximized) [1; 25].  
An optimization problem may be as follows:  
\[\min f(x)\,subject\ to\ x\ \in\ \Omega \tag{7}\]  
where \"\(f\)\" is a real-valued function called the objective function.  
The vector \"\(x\)\" is a vector of \"\(n\)\" independent variables \(x=[x_{1},\,x_{2}\,\dots\ x_{n}]\) where the variables \(x_{1},\,x_{2}\,\dots\ x_{n}\), often referred to as decision variables, are selected by the user or designer. The set \(\Omega\) is a subset of \(R\) called the constraint set or feasible set.  
The above problem is a decision problem. It involves finding the \"best\" vector x in compliance with the constraints, or may, all possible vectors within \(\Omega\). The \"best\" vector is the one that has the smallest value of the objective function. This vector is called the \"minimizer\". It is possible to have many minimizers.  
Most engineering problems require the designer to optimize some conflicting objectives. Objectives conflict if one objective's improvement leads to another's deterioration. The simplest way to optimize is to find a decision variable that satisfies the given constraints and optimizes a function whose components are objective functions [25; 26]. Multi-objective problems may not have a single optimal solution.  
In this paper, the optimization problem is the reduction of THD in a cascade H-bridge multilevel inverter (CHBMLI) and finding a desired value of Mi according to the application. Starting from the THD, the stepped waveform of the output voltage is analyzed using the Fourier series and is expressed in the following equation, considering that it has quarter-wave symmetry:  
\[V_{out}(\theta)\ =\ \sum_{n=1,3,5}^{\infty}b_{n}\ sin(n\theta) \tag{8}\]  
where \(n=1,3,5\) are odd harmonics, and \(b_{n}\) is given by:  
\[b_{n}=\sum_{n=1,3,5}^{2N-1}\frac{4V_{dc}}{n\pi}(V_{1}\cos(n\alpha_{1})+V_{2} \cos(n\alpha_{2})+\cdots V_{m}\cos(n\alpha_{N})) \tag{9}\]  
where:  
\(N\) = number of switching angles per quarter cycle.  
\(n\) = 1, 3, 5... 2\(N-\)1 (odd harmonics).  
\(m\) = number of DC sources.  
\(\alpha\) = switching angle.  
The quality of the output voltage waveform is determined by how many harmonics it contains, so Equation (4) shows the THD formula following the IEEE 519 standard to be set as an objective function:  
\[THD=\frac{\sqrt{\sum_{n=1,3,5,7}^{50}-V_{n}^{2}}}{V_{1}}*100 \tag{10}\]  
where:  
\[V=\frac{4V_{dc}}{n\pi}\,\cos(n\alpha_{1})+\frac{4V_{dc}}{n\pi}\,\cos(n\alpha_ {2})+\dots\,\frac{4V_{dc}}{n\pi}\,\cos(n\alpha_{n}),\]The angles must satisfy the following constraints:  
\[0\leq\alpha_{1}\leq\alpha_{2}\ldots\leq\alpha_{n}\leq\frac{\pi}{2} \tag{11}\]  
where \(n\) = number of switching angles per quarter cycle and \(\alpha_{1}\) = switching angle 1, \(\alpha_{2}\) = switching angle 2, and \(\alpha_{n}\) = switching angle \(n\) (The switching angles are the decision variables).  
When \(Mi>1\), it is said that there is over-modulation, which results in the absence of pulses when comparing the modulating signal with the carrier signal.  
Regarding Mi, the modulation ratio is equal to V1 over \(n\).  
Recalling that the case study is a seven-level CHBMILI, Figure 2 shows a waveform with seven levels and three switching angles (\(n\) = 3); the equation remains:  
\[Mi=\frac{4}{3\pi}(\cos(\alpha_{1})+\cos(\alpha_{2})+\cos(\alpha_{3})) \tag{12}\]