## 3 Gear Ratio Optimization Problem
### Objective Functions
#### 3.2.2 The Electric Energy Consumption  
The 100 km electric energy consumption of the EV depends on the specific driving cycle. In order to fully reflect the energy consumption of the electric-drive system, the average of two standard drive cycles, NEDC (New European Drive Cycle) and WLTP (World Light Vehicle Test Procedure), is used as the weighted value of the objective function. \[J_{de}=\frac{S_{NEDC}}{S_{NEDC}+S_{WLTP}}J_{NEDC}^{*}+\frac{S_{WLTP}}{S_{NEDC}+S _{WLTP}}J_{WLTP}^{*}, \tag{7}\]  
where \(S_{NEDC}\) and \(S_{WLTP}\) is the mileage of NEDC and WLTP respectively, \(J_{NEDC}^{*}\) and \(J_{WLTP}^{*}\) are the minimum electricity consumption of corresponding drive cycle. In each iteration process of the optimization process shown in Figure 2, the corresponding gear ratio combination of each individual has been assigned. Thus, given the drive cycle, the 100 km electric energy consumption of the EV is determined by the gear shift sequence. From a control point of view, this is a multistage decision-making process, so DP method can be used to solve this problem [25]. The following is a brief description of the implementation process. * **The global optimization problem formulation** Since the vehicle speed and acceleration are known in the standard drive cycle, the driveline torque and state-of-charge (SOC) of the battery at each time step \(k\) can be derived through a backward simulation model. The state-space model of the EV adopting the two-speed transmission can be established in Equation (8). \[\left\{ \begin{aligned} SOC(k+1)&=SOC(k)-\frac{I(k)T_{s }}{3600Q_{c}}\\ G(k+1)&=G(k)+u_{G}(k),\end{aligned} \right.\] (8) where the state variable is \(x=[SOC,G]\), \(G\) denotes the gear state, \(T_{s}\) is the time interval and can be set to 1, \(Q_{c}\) is the battery capacity, \(u_{G}\) is the only control variable and represents the gearshift command, \(I\) is the battery current and can be expressed as follows: \[I=\frac{V_{oc}-\sqrt{V_{oc}^{2}-4R_{int}P_{batt}}}{2R_{int}}\] (9) where \(P_{batt}\) is the battery power related to motor power flow, and \(V_{oc}\) and \(R_{int}\) are open circuit voltage and internal resistance, respectively. The tendency of the battery open circuit voltage with SOC and the battery internal resistance with SOC are shown in Figure 3.  
The DP optimization objective is to obtain the minimum electric energy consumption of the whole drive cycle, the cost of applying the control \(u_{G}(k)\) at time step \(k\) can be intuitively defined as  
\[L(x(k),u_{G}(k),k)=\psi_{batt}(x(k),u_{G}(k),k), \tag{10}\]  
where \(\psi_{batt}\) is the electricity consumption during the time interval. In addition, the cost of the frequent shift is considered, thus, Equation (10) is rewritten as  
\[L(x(k),u_{G}(k),k)=\psi_{batt}(x(k),u_{G}(k),k)+w_{G}|u_{G}(k)|, \tag{11}\]  
where \(w_{G}\) is the weight coefficient to penalize the frequently gearshift event. Finally, the objective function can be obtained by integrating the Equation (11) over the entire drive cycle. \[J=\phi(x(N),N)+\sum_{k=0}^{N-1}L(x(k),u_{G}(k),k), \tag{12}\]  
where \(\phi(x(N),N)\) is the final cost that is independent of the control variable. In this paper, there is no constraint on the final state, thus, the global optimization problem can be constructed as  
\[ \begin{array}{ll}\min_{u_{G}}&J=\sum_{k=0}^{N-1}L(x(k),u_{G}(k),k)\\ s.t.&\left\{\begin{array}{l}SOC_{min}\leq SOC(k)\leq SOC_{max}\\ G(k)\in\{1,2\}\\ u_{G}(k)\in\{-1,0,1\},\end{array}\right.\end{array}  \tag{13}\]  
where \(SOC_{max}\) and \(SOC_{min}\) are maximum and minimum values of SOC operating range according to the battery management system (BMS).