# Research on Multi-Mode Braking Energy Recovery Control Strategy for Battery Electric Vehicles
## 3 Optimization of Control Strategies Based on Genetic Algorithms
### Chromosome code  
The standard coding methods are binary coding and floating-point coding. Binary coding is due to mapping errors in the discretization, resulting in the iterative search for the optimal space becoming larger so that the performance and efficiency of the algorithm optimization are reduced. Therefore, this paper uses the floating-point coding method to encode the optimization variables. The length of the encoding is the same as the number of variables, and the encoding formula is as follows [30]:  
\[x(j)=a(j)+r(j)[b(j)-a(j)] \tag{42}\]  
where \(j\) is the optimization variable; \(a(j)\) is the minimum value of the optimization variable; \(b(j)\) is the maximum value of the optimization variable, \(r(j)\) is a random number between \([0,1]\); and \(x(j)\) is the gene position on the chromosome. (3) Design of the fitness function \begin{table}
\begin{tabular}{c c c c c c c c} \hline Optimization parameters & \(x_{1}\) & \(x_{2}\) & \(x_{3}\) & \(x_{4}\) & \(x_{5}\) & \(x_{6}\) & \(x_{7}\) \\ Range of values & [0, 0.2] & [0.1, 0.5] & [0.3, 0.8] & [0.02, 0.3] & [0.2, 0.7] & [0.7, 0.9] & [0, 30] \\ \hline Optimization parameters & \(x_{8}\) & \(x_{9}\) & \(x_{10}\) & \(x_{11}\) & \(x_{12}\) & \(x_{13}\) & \(x_{14}\) \\ Range of values & [20, 70] & [30, 85] & [0, 30] & [20, 80] & [80, 110] & [0, 0.4] & [0.1, 0.7] \\ \hline Optimization parameters & \(x_{15}\) & \(x_{16}\) & \(x_{17}\) & \(x_{18}\) & \(x_{19}\) & \(x_{20}\) & \(x_{21}\) \\ Range of values & [0.3, 0.8] & [0.02, 0.3] & [0.2, 0.7] & [0.7, 0.9] & [0, 0.2] & [0.1, 0.5] & [0.02, 0.2] \\ \hline Optimization parameters & \(x_{22}\) & \(x_{23}\) & \(x_{24}\) & \(x_{25}\) & \(x_{26}\) & \(x_{27}\) & \(x_{28}\) \\ Range of values & [0.1, 0.4] & [0.02, 0.2] & [0.3, 0.6] & [0.02, 0.2] & [0.4, 0.8] & [0.3, 0.7] & [0.7, 0.9] \\ \hline \end{tabular}
\end{table} 
Table 3: Optimization variable value range table. Figure 10: Output optimization variable position selection. The genetic algorithm's fitness function measures the degree to which the individuals in the population are close to the global optimal solution to the problem. The fitness function usually varies from the optimization objective function, which converts the objective function value to the fitness value of the individuals in the genetic search formula. \[F(X)=\left\{ \begin{array}{l}f(X)+C_{\min},f(x)+C_{\min}>0\\ 0,f(x)+C_{\min}\leq 0\end{array} \right. \tag{43}\]  
The main effect of using a genetic algorithm to optimize the fuzzy controller is to improve the braking energy recovery rate; so, the objective function value is selected as the braking energy recovered during braking. In this paper, the calculation of the braking energy recovery value under NEDC cycling conditions is carried out according to the battery power \(P_{bat}\) output from the coupled Cruise vehicle model in the Simulink control strategy model, and the expression is as follows:  
\[F=\int\limits_{P_{bat}}P_{bat}dt>0 \tag{44}\]  
(4) Design of the fitness function  
The standard methods of selection operation are the proportional selection method, random traversal sampling method, truncated selection method, and random selection without replay margin, etc. In this paper, the proportional selection method is selected. The principle of this method is that the probability of a population individual being inherited by the next generation is directly proportional to its fitness. Let the population size be \(M\), the fitness of individual \(i\) be \(F_{i}\), and then the probability of an individual being selected \(p_{i}\) is as follows:  
\[p_{i}=\frac{F_{i}}{\sum_{i=1}^{M}F_{i}} \tag{45}\]  
From the above equation, the higher the fitness of the optimized individual, the higher the probability of being selected. However, since the algorithm is based on comparing the randomly generated probability and the likelihood of the individual being assigned to determine whether the individual is selected, its randomness may lead to the excellent individual not being selected.