## 5 Designing Stable Predictive Controller for Multi-Agent Intersections  
The cost function according to an intersection model using a multiagent system is described as follows:  
\[J=X^{T}(n+1)(I_{N}\otimes Q)X(n+1)+\Delta S^{T}(n)(I_{N}\otimes W)\Delta S(n) \tag{10}\]  
The model predictive control determines control signals by having a process model and receiving future signals based on optimization. This act minimizes the difference between the predicted outputs and the reference signals. The dynamic system in Equation (9) limits and finalizes the overall system. In counting, all signals of the closed-loop system have been limited. The proof: Typically, in urban intersections, the control signal is a traffic light that is green or red, and if it is green, vehicles can enter or leave, and during the red phase, the vehicles only can enter the queue. \[ \begin{bmatrix}\Delta X(n+1)\\ Y(n)\end{bmatrix} = \begin{bmatrix}(I_{M}\otimes A_{i})&0\\ \mathbb{1}.C_{i}&I\end{bmatrix}\begin{bmatrix}\Delta X(n)\\ Y(n)\end{bmatrix} + \begin{bmatrix}(I_{M}\otimes B_{i})\\ Y(n)\end{bmatrix} S(n)+ \begin{bmatrix}I\\ 0\end{bmatrix} \Delta C(n) \tag{11}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Component** & **Description** \\ \hline \(Q_{i}(n)\) & Queue length \\ \(q_{i}(n)\) & The number of vehicles that enter the queue \\ \(d_{i}(n)\) & The number of vehicles that have left the queue \\ \(S_{i}(n)\) & Control signal \\ \(W_{i}(n)\) & Waiting time \\ T & Sampling time \\ X(n) & Model variable vector \\ S(n) & Control signal \\ \(I_{M}\) & Identity matrix \\ \(A_{i,}B_{i},C_{i}\) & Metrics \\ J & Cost function \\ y(n) & New output \\ y’(n) & Output \\ H & Hamilton equation \\ \(\otimes\) & Kronecker \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The parameters used in this article. Figure 3: Multi-agent two-phase signaled intersection. The new output will be as follows:  
\[y^{\prime}(n)= \begin{bmatrix}\xi\end{bmatrix}\begin{pmatrix}\Delta X(n)\\ Y(n)\end{pmatrix}  \tag{12}\]  
Now, for proving the stability of the general system, the suitable Hamiltonian function with the goal of strength should be presented in this Theorem. Since the equations are discrete, then in this paper, Equation (13) is the Hamiltonian function. \[H=y^{\prime T}y+\Delta S^{T}R\Delta S \tag{13}\]  
Equation (13) causes the cost function to minimize. This equation is a new output on the based cost function at a general system, totaling the previous output with the control and reference signals. Then, via putting relation \(\Delta X\) in relation Equation (13), the above equation can be written as follows:  
\[H=(\xi\Delta X(n+1))^{T}(\xi\Delta X(n+1))+\Delta S^{T}R\Delta S \tag{14}\]  
where \(\xi=[1\;1\;1\;1\;0\;0\;0\;0]\) and by placement:  
\[\Delta X(n+1)=A\Delta X+B\Delta S+C \tag{15}\]  
With assuming that:  
\[A =(I_{M}\otimes A_{i})x(n)\] \[B =(I_{M}\otimes B_{i})x(n)\] \[C=\mathbbm{1}C_{i}\]  
Additionally, \(I_{M}=q\) has been defined as input at the general system. Using Equation (17) and via putting relation, Equations (17) and (18) can be rewritten as follows:  
\[H=(\xi(I_{M}\otimes A_{i})X(n)+(I_{M}\otimes B_{i})S(n)+ \mathbbm{1}C_{i})^{T}\] \[(\xi(I_{M}\otimes A_{i})X(n)+(I_{M}\otimes B_{i})S(n)+ \mathbbm{1}C_{i}+\Delta S^{T}R\Delta S\]  
According to Equation (17), \(\xi\) affects each parameter, written as the Hamiltonian equation below.