## 3 Modeling and Control Strategy Design
### ECMS Problem Formulation
#### 3.3.1 Equivalent Consumption Minimization Strategy
The theoretical inspiration for ECMS is the global optimization approach by [PERSON]'s minimum principle (PMP). The Hamiltonian function for the global optimal control problem described in Equation (12) can be written as:  
\[H(x(t),\lambda(t),u(t),t)=\dot{m}_{fuel}(u(t),t)+\lambda(t)\dot{x}(t) \tag{14}\]  
where the state, \(x\), is the battery SOC, the control input, \(u\), is the engine power, and \(\lambda\) is the co-state. If we define an EF \"\(s\)\" by  
\[s(t)=-\lambda(t)\frac{Q_{LHV}}{U_{OC}(SOC)C_{b}}, \tag{15}\]  
then Equation (14) can be converted to Equation (13). Based on the PMP, the equation of the co-state derived from the Hamiltonian function can be written as:  
\[\dot{\lambda}(t)=-\frac{\partial\dot{m}_{fuel}(u(t),t)}{\partial x}-\lambda(t )\frac{\partial f(x(t),u(t))}{\partial x} \tag{16}\]  
The battery's open-circuit voltage and resistance are SOC-dependent; however, usually, the variation is small, especially in the charge-sustaining mode where the SOC is maintained in a narrow range. Therefore, the right-hand side of Equation (16) is approximately zero, which implies that the co-state can also be treated as a constant [1]. This assumption was also validated through global optimization results [33]. Based on the equivalence between PMP and ECMS discussed above and Equation (15), the EF of ECMS can also be approximated by a constant. However, the charge/discharge efficiency should be considered due to the energy loss on the battery's internal resistance, and the commonly used method is to define the EF by two separated values [18]:  
\[ \begin{cases}s_{chg}=s\cdot\eta_{b}\\ s_{dis}=s/\eta_{b}\end{cases}  \tag{17}\]  
The problem is that the charge/discharge efficiency \(\eta_{b}\) is not constant and depends on many factors, such as cell temperature, SOC, and charge/discharge rate. Therefore, using an average value of efficiency will lead to inaccuracies. In this study, we considered the actual electrochemical power taken out of or stored in the battery instead of the output power and combined the two cases into one. That is, we replace the output power, \(P_{b}\), in Equation (13) with \(P_{ch}\), which is the battery current multiplied by the open-circuit voltage:  
\[p_{ch}=U_{OC}I=\frac{U_{OC}^{2}-U_{OC}\sqrt{U_{OC}^{2}-4 Rp_{b}}}{2R} \tag{18}\]Then, the ECMS cost function becomes:  
\[\dot{m}_{eqv}(t)=\dot{m}_{fuel}\big{(}p_{g}(t),t\big{)}+s(t)\frac{U_{OC}^{2}(t)-U _{OC}(t)\sqrt{U_{OC}^{2}(t)-4R(t)\big{(}p_{d}(t)-p_{g}(t)\big{)}}}{2Q_{LHV}R(t)} \tag{19}\]  
where the battery's instantaneous open-circuit voltage, \(U_{OC}\), and the internal resistance, \(R\), will be obtained from the battery model. It is subject to the following constraints:  
\[\left\{ \begin{array}{l}p_{\text{gmin}}(t)\leq p_{g}(t)\leq p_{g\text{max}}(t )\\ p_{g}(t)\leq p_{NVH}(t)\\ p_{\text{bmin}}(t)\leq p_{b}(t)\leq p_{b\text{max}}(t)\\ p_{d}(t)-p_{b\text{max}}(t)\leq p_{g}(t)\leq p_{d}(t)-p_{b\text{min}}(t)\end{array} \right. \tag{20}\]  
where the first constraint shows the operating range of the engine-generator set in different combustion modes; the second constraint is an NVH constraint, considering the drivability, which will be illustrated in the next subsection; the third constraint gives the battery's operating range and this will restrict \(p_{g}\) at different driving loads, as shown by the fourth constraint. Combining these four constraints together, the final constraint on the control input, \(p_{g}\), can be derived as:  
\[p_{\text{min}}(t)\leq p_{g}(t)\leq p_{\text{max}}(t) \tag{21}\]  
where  
\[\left\{ \begin{array}{l}p_{\text{min}}=\text{max}\big{(}p_{d}(t)-p_{b\text{ max}}(t),\ p_{g\text{min}}(t)\big{)}\\ p_{\text{max}}=\text{min}\big{(}p_{d}(t)-p_{b\text{min}}(t),\ p_{g\text{max}}(t ),\ p_{NVH}(t)\big{)}\end{array} \right.