## 4 Parameter Optimization  
The genetic algorithm (GA) is an approach that probabilistically seeks the optimal solution by mimicking the natural evolutionary process [23]. By utilizing mathematical techniques and computer simulations, it transforms the problem-solving process into one that resembles the biological evolution processes of selection, crossover, and mutation of chromosome genes. After multiple iterations and updates, the optimal solution to the problem is attained.  
GA avoids the issue of traditional optimization algorithms easily becoming stuck in local optimal solutions by conducting a global population search. Additionally, GA exhibits strong adaptability and is suitable for complex optimization problems, making it well suited for parameter optimization in the control system of SDCs for doubly fed wind turbines. Thirdly, GA possesses robustness and is insensitive to the selection of the initial population, thus having low requirements for the manually set initial parameter values.  
The parameter optimization method based on GA takes the fitness function as the evaluation criterion, uses MATLAB programming to realize the iterative calculation of the parameters of the SDC, and efficiently and quickly calculates the optimal parameters that should be set under different operating conditions to obtain the optimal suppression effect of the SSO.  
Figure 4 shows the flow chart of the GA algorithm implementation. The algorithm implementation steps are as follows:  
1. Initialize the population: select the dataset within the controllable range of the target parameters, and select the phase shift angle, gain, and serial compensation degree as the \"genes\" that can be operated. The initial parameters are set as follows: the crossing probability P\({}_{\rm c}\) is 0.5, the mutation probability P\({}_{\rm m}\) is 0.001, and the maximum number of iterations T is five.
2. Calculate the fitness values for different parameter combinations.
3. The cross-matching order is randomly generated, the cross-matching sequence is determined according to the crossover probability P\({}_{\rm c}\), and the cross-operation is carried out one by one to generate a new group.
4. Individuals are randomly selected to determine whether the gene fragment is mutated according to the mutation probability P\({}_{\rm m}\), and the mutation operation of the single gene fragment is performed to generate a new population.  
Determine whether the suppression requirements are met; otherwise, proceed to Step 2 until the maximum number of iterations is reached, and the optimal solution is retained.  
The optimization objective of this study is to calculate the optimal setting values of the gain K and phase-shift time constant T in the SDC for any operating condition using the GA algorithm to maximize the SSO amplitude rejection rate.  
The index of the amplitude suppression rate is defined to describe the suppression effect of the SSO phenomenon under different SDC parameters. The relevant amplitude suppression rate is expressed as follows:  
\[\beta=\frac{H_{a}-H_{b}}{H_{a}} \tag{9}\]  
where H\({}_{\text{a}}\) and H\({}_{\text{b}}\) represent the amplitude of the oscillation of the output waveform of the a-phase current I\({}_{\text{aa}}\) before and after the addition of the SDC, respectively.  
A mathematical model for parameter optimization is developed as shown in Equation (10):  
\[\left\{\begin{array}{l}maxC(\beta,K,T)\\ 0\leq\beta\leq 1\\ -10\leq K_{g}\leq-64\\ -30\leq K_{r}\leq-120\\ 0.2\leq T_{g}\leq 0.99\\ 0.2\leq T_{r}\leq 0.99\end{array}\right. \tag{10}\]