# The Development of an Optimal Control Strategy for a Series Hydraulic Hybrid Vehicle
## 3 Control System Development
### Dynamic Programming (DP) Optimal Control Strategy with DP Application
#### 3.3.3 The Optimization of Energy Management Using DP  
In order to apply DP algorithm, the continuous dynamic equations must by discretized. If the duty time, \(T\), is divided into \(N\) equals increments, \(T_{s}\), the dynamic equation, Equation (15) is approximated by the following difference equation:  
\[x\left(k+1\right)=x\left(k\right)+\frac{1.4p_{pr}^{-1/1.4}\left(\left(p_{\max} -p_{\min}\right)x\left(k\right)+p_{\min}\right)^{1/1.4}P_{a}\left(k\right)}{V_ {a}\left(p_{\max}-p_{\min}\right)}T_{s} \tag{16}\]  
where \(x(k)\) is the state of charge for the accumulator at time \(k\). The integral part of the cost function is approximated by the summation:  
\[J_{f}=\sum_{k=0}^{N-1}\Delta m_{f,k}\left(\omega_{e}\left(k\right),T_{e}\left( k\right)\right)dt \tag{17}\]  
where \(\Delta m_{f,k}\) is the fuel consumption, which is assumed to be constant during the time increment \(T_{s}\), for the engine at time \(k\). The static equations, from Equation (6) to Equation (9), are represented in the form of equality constraints:  
\[P_{w}\left(k\right)=\left(m\frac{v\left(k+1\right)-v\left(k\right)}{T_{s}}+mg \text{sin}\theta+mf_{r}g\text{cos}\theta+0.5 pC_{d}A_{f}v^{2}\left(k\right) \right)v\left(k\right)\]  
\[P_{p/m}\left(k\right)=P_{w}\left(k\right)/\eta_{p/m} \tag{18}\] \[P_{p}\left(k\right)=\left(1-u_{k}\right)P_{p/m}\left(k\right)/ \eta_{p/m}\] \[P_{e}\left(k\right)=P_{p}\left(k\right)/\eta_{p}\] \[\omega_{e}\left(k\right)=l_{2}\left(P_{e}\left(k\right)-l_{1} \right)^{3}+l_{3}\left(P_{e}\left(k\right)-l_{1}\right)^{2}+l_{4}P_{e}\left(k \right)+l_{5}\] \[T_{e}\left(k\right)=\frac{\pi}{30}\frac{1000P_{e}\left(k\right)}{ \omega_{e}\left(k\right)}\] \[\Delta m_{f,k}=k_{00}+k_{10}\omega_{e}\left(k\right)+k_{20}\omega _{e}^{2}\left(k\right)+k_{11}\omega_{e}\left(k\right)T_{e}\left(k\right)+k_{01 }T_{e}\left(k\right)+k_{02}T_{e}^{2}\left(k\right)\] \[P_{a}\left(k\right)=u_{k}P_{w}\left(k\right)\]  
The physical constraints are given below and if these constraints are violated, an infinite penalty is given to the cost function. \[J_{f}=\sum_{k=0}^{N-1}\Delta m_{f,k}\left(\omega_{e}\left(k\right),T_{e}\left( k\right)\right)dt \tag{17}\]0 \[J_{f}=\sum_{k=0}^{N-1}\Delta m_{f,k}\left(\omega_{e}\left(k\right),T_{e}\left( k\right)\right)dt \tag{17}\]1 \[J_{f}=\sum_{k=0}^{N-1}\Delta m_{f,k}\left(\omega_{e}\left(k\right),T_{e}\left( k\right)\right)dt \tag{17}\]2 \[J_{f}=\sum_{k=0}^{N-1}\Delta m_{f,k}\left(\omega_{e}\left(k\right),T_{e}\left( k\right)\right)dt \tag{17}\]3  
The DP algorithm can be implemented backwards or forwards, but backward implementation is more convenient and saves computation time and memory space. Therefore, in this work, a normal backward DP is used. Initially, for a given drive cycle, the duty time, \(0\leqslant t\leqslant\ T\), is divided into \(N\) equal increments, \(T_{s}\). DP is implemented from \(k=N-1\) backward to \(k=0\). At \(k=N\), a soft constraint is applied to penalize any deviation in the final SOC value from the initial SOC, in order to ensure that the net energy that is stored in the accumulator is zero. Therefore, a comparison of fuel economy of the SHHV with the conventional vehicle can be made:  
\[J_{f}=\sum_{k=0}^{N-1}\Delta m_{f,k}\left(\omega_{e}\left(k\right),T_{e}\left( k\right)\right)dt \tag{17}\]4  
where \(\alpha\) is a penalty weight. At each time step \(k\left(k=N-1,\ldots,0\right)\), all of the allowable power-splitting factor, \(u\), is applied for each of the allowable state values to find the optimal policy, which minimizes the fuel consumption rate of the engine for a given last stage of operation.