# Collaborative Trajectories Optimization for Tram and Connected Vehicles at Signalized Intersection
## 3 Mathematical Model
### Guidance Model of CAVs  
V2V communication, one of the earliest practical intelligent road traffic technologies, can be used to form a flexible vehicle fleet between CAVs [33]. The fleet control system is mainly divided into two layers, where the lower layer is responsible for the speed of the coordination control of the following cars. The upper layer is responsible for the speed control of the lead vehicle; the lead vehicle obtains timing information from the signal machine via V2I communication and calculates its recommended speed based on predetermined rules. This study puts forward that the \"road train\", which is composed of CAVs in the same phase as trams, can pass through intersections at the same time with trams by using TSP, fully utilizing the right-of-way at intersections. V2I communication can also help to avoid wasting the right-of-way, which is caused by drivers unknown to the TSP and the hesitancy of manipulation. In this paper, the intelligent driver model (IDM) was adopted as the car-following model. Because of the excellent performance of the IDM in traffic dynamics, many scholars have studied the field of traffic control by utilizing it. The input of the model is the speed of the car in front, the distance between the car and the car in front and the speed of the car. The output is the acceleration of the car [34]. The IDM is suitable to be applied to the research of this paper, and it is expressed as follows:  
\[\hat{v}=a_{\text{max}}\left[1-\left(\frac{v}{v_{0}}\right)^{4}-\left(\frac{s^ {*}(v,\Delta v)}{s}\right)^{2}\right] \tag{9}\]  
where the vehicle's acceleration, max acceleration, instant speed, desired speed, gap, relative speed and desired gap are denoted as \(\hat{v}\), \(a_{\text{max}}\), \(v\), \(v_{0}\), \(s\), \(\Delta v\) and \(s^{*}(v,\Delta v)\), respectively. The expression for the desired gap \(s^{*}(v,\Delta v)\) is:  
\[s^{*}(v,\Delta v)=s_{0}+\max\biggl{(}0,vT+\frac{v\Delta v}{2\sqrt{a_{\max}b}} \biggr{)} \tag{10}\]  
where \(s_{0}\), \(T\) and \(b\) are the safe gap (set to 1.5 m), reaction time (set to 0.8 s) and comfort deceleration, respectively. The upper control scheme states that, when the lead vehicle enters the speed guidance area, the shortest expected time to arrive at the intersection is first calculated; i.e., this is the time to reach an intersection when the target speed is the maximum speed limit. The minimum time for the lead vehicle to reach the intersection is expressed as follows:  
\[T_{\text{C1}}=\frac{V_{\max}-V_{\text{ini}}}{a}+\frac{L_{\text{g}}-\frac{(V_{ \max})^{2}-V_{\text{ini}}^{2}}{2a}}{V_{\max}} \tag{11}\]  
where \(T_{\text{C1}}\) represents the time between the arrival of the lead vehicle in the guide area and the arrival of the stop line at the intersection; \(L_{\text{g}}\) is the length of speed guide area; \(V_{\text{ini}}\) represents the initial speed of the leading car entering the speed guidance area; \(V_{\max}\) is the speed limit of CAVs and \(a\) is the comfort acceleration. If the calculated time of arrival is in a green light period, the number of cars allowed to pass during the remaining green light period is calculated. If all the following vehicles cannot make it through the intersection, the follow-up vehicles are guided through the intersection at the next green light period. The maximum number of cars that can pass is expressed as follows:  
\[N=\text{Int}\biggl{[}\frac{t_{\text{GE}}-(t_{\text{C1}}+T_{\text{C1}})}{(s_{ \text{a}}+l)/v^{*}}\biggr{]} \tag{12}\]  
where \(t_{\text{C1}}\) represents the moment when the lead vehicle enters the guidance area; \(t_{\text{GE}}\) represents the end of the green light for that phase; \(s_{\text{a}}\) is the actual distance between vehicles; \(l\) is the length of a vehicle and \(v^{*}\) is the target speed. When the fleet is in a state of equilibrium flow, \(\dot{v}\approx\Delta v\approx 0\), we can obtain the actual distance from Equations (9) and (10).