## 4 Decentralized Energy-Optimal Control Framework for Solving TOP
### Solution for Energy-Optimal Control Problem  
The integration of the energy-optimal control problem (13) with the vehicle dynamic constraint (10) and the velocity and control input constraint (11) facilitates the derivation of Hamiltonian functions for each CAV [19]:  
\[ \begin{array}{ll}H_{i}(t,p_{i}(t),v_{i}(t),u_{i}(t))&=\frac{1}{2}u_{i}^{2}(t) +\lambda_{i}^{p}(t)\cdot v_{i}(t)+\lambda_{i}^{v}(t)\cdot u_{i}(t)+\mu_{i}^{a} \cdot(u_{i}(t)-u_{\text{max}})\\ &+\mu_{i}^{b}\cdot(u_{\text{min}}-u_{i}(t))+\mu_{i}^{c}\cdot(v_{i}(t)-v_{\text{ max}})+\mu_{i}^{d}\cdot(v_{\text{min}}-v_{i}(t))\end{array}  \tag{15}\]  
where \(\lambda_{i}^{p}(t)\) and \(\lambda_{i}^{v}(t)\) denote the costates, and \(\mu_{i}^{a}\), \(\mu_{i}^{b}\), \(\mu_{i}^{c}\), and \(\mu_{i}^{d}\) are the Lagrange multipliers. The Hamiltonian functions are divided into seven cases depending on whether different control inputs \(u_{i}(t)\) and velocities \(v_{i}(t)\) satisfy the boundary conditions (i.e., whether they attain \(u_{\text{max}}\), \(u_{\text{min}}\), \(v_{\text{max}}\), \(v_{\text{min}}\)). More specifically, the seven cases are as follows [9]:1. Control and State Constraints not Active, \(u_{i}(t)\
eq u_{max}\), \(u_{i}(t)\
eq u_{min}\), \(v_{i}(t)\
eq v_{max}\), \(v_{i}(t)\
eq v_{min}\). 2. Control Constraints Active, \(u_{i}(t)=u_{max}\). 3. Control and State Constraints Active, \(u_{i}(t)=u_{max}\), \(v_{i}(t)=v_{max}\). 4. Control Constraints Active, \(u_{i}(t)=u_{min}\)
5. Control and State Constraints Active, \(u_{i}(t)=u_{min}\), \(v_{i}(t)=v_{min}\). 6. State Constraints Active, \(v_{i}(t)=v_{max}\). 7. State Constraints Active, \(v_{i}(t)=v_{min}\). Based on the statistical data presented in reference [9], the case in which neither control constraints nor state constraints are active exerts a significant influence on the driving process of the CAVs, rendering them pivotal for investigating the control input functions. In such a case, \(\mu_{i}^{a}=\mu_{i}^{b}=\mu_{i}^{c}=\mu_{i}^{d}=0\), and the Hamiltonian functions are transformed into the following [9]:  
\[H_{i}(t,p_{i}(t),v_{i}(t),u_{i}(t))=\frac{1}{2}{u_{i}}^{2}(t)+\lambda_{i}^{p}( t)\cdot v_{i}(t)+\lambda_{i}^{p}(t)\cdot u_{i}(t) \tag{16}\]  
The costates transform into the following [9]:  
\[\dot{\lambda}_{i}^{p}=-\frac{\partial H_{i}}{\partial p_{i}}=0,\ \dot{\lambda}_{i}^{v}=-\frac{\partial H_{i}}{\partial v_{i}}=-\lambda_{i}^{p}(t) \tag{17}\]  
The extremum condition is as follows [9]:  
\[\frac{\partial H_{i}}{\partial u_{i}}=u_{i}(t)+\lambda_{i}^{v}(t)=0 \tag{18}\]  
By Equation (17), it can be readily inferred that \(\lambda_{i}^{p}(t)=a_{i}\) and \(\lambda_{i}^{v}(t)=-(a_{i}t+b_{i})\), where \(a_{i}\) and \(b_{i}\) are integral constants. Thus, the optimal control input \(u_{i}^{*}(t)\) is as follows [9]:  
\[{u_{i}}^{*}(t)= a_{i}t+b_{i} \tag{19}\]  
According to the second-order vehicle dynamics (10) relationship, we can derive the following [9]:  
\[{v_{i}}^{*}(t)= \frac{1}{2}{a_{i}t^{2}}+b_{i}t+c_{i} \tag{20}\] \[{p_{i}}^{*}(t)= \frac{1}{6}{a_{i}t^{3}}+\frac{1}{2}{b_{i}t^{2}}+c_{i}t+d_{i} \tag{21}\]  
In our strategy, CAV \(i\) will maintain a constant speed \(v_{i}^{m}\) while traversing MZ after entering. Therefore, the boundary conditions of the costates are: \(\lambda_{i}^{v}(t_{i}^{m})=-u_{i}^{*}(t_{i}^{m})=0\). Then, the three equations derived from substituting the provided initial and final state constraints (14) into (20) and (21) are: \(p_{i}^{*}(t_{i}^{0})=\frac{1}{6}{a_{i}}\left(t_{i}^{0}\right)^{3}+\frac{1}{2} {b_{i}}\left(t_{i}^{0}\right)^{2}+c_{i}t_{i}^{0}+d_{i}=0\), \(p_{i}^{*}\left(t_{i}^{m}\right)=\frac{1}{6}{a_{i}}\left(t_{i}^{m}\right)^{3}+ \frac{1}{2}{b_{i}}\left(t_{i}^{m}\right)^{2}+c_{i}t_{i}^{m}+d_{i}=L\), \(v_{i}^{*}\left(t_{i}^{0}\right)=\frac{1}{2}{a_{i}}\left(t_{i}^{0}\right)^{2}+ b_{i}t_{i}^{0}+c_{i}=v_{0}\), where \(L\) is the distance from the entrance of the CZ to the entrance of the MZ. The simultaneous representation of these four equations in matrix form is as follows [9]:  
\[