## 3 Mathematical Model and Solution Algorithm
### Model Construction
#### 3.2.2 Constraints  
The operating lines for the two unit trains in virtual coupling can be merged, altering the train operation constraints. Additionally, an extra virtual coupling constraint must be introduced to limit the number of coupled train formations. (1) Station service constraints \begin{table}
\begin{tabular}{c c} \hline \hline
**Symbol** & **Definition** \\ \hline \(x_{i,i^{\prime},s}\) & 0–1 variable, if train \(i\) and \(i^{\prime}\) are in a virtual coupling state when leaving station \(s\), then \(x_{i,i^{\prime},s}=1\), otherwise 0 \\ \(\hat{T}_{i}\) & 0–1 variable, if train \(i\) chooses to operate, then \(T_{i}=1\), otherwise 0 \\ \(\theta_{i}\) & 0–1 variable, if train \(i\) is full – length route, then \(\theta_{i}=1\), otherwise 0 \\ \(d_{i,s}\) & Integer variable, the departure time of the train \(i\) at station \(s\) \\ \(Y_{i,j}\) & 0–1 variable, if the rolling stock of train \(i\) is turned back to continue train \(j\), then \(Y_{i,j}=1\), otherwise 0 \\ \(\alpha_{i}\) & 0–1 variable, if the rolling stock of train \(i\) is sent from the depot, then \(a_{i}=1\), otherwise 0 \\ \(\beta_{i}\) & 0–1 variable, if the rolling stock of train \(i\) ends its operation and directly returns to the depot, then \(\beta_{i}=1\), otherwise 0 \\ \(z_{i}^{s}(t)\) & 0–1 variable, whether passengers arriving at station \(s\) in the \(t-\)th time interval have the chance to get on the train \(i\), if so, then \(z_{i}^{s}(t)=1\), otherwise 0 \\ \(L_{i}^{s,s^{\prime}}(t)\) & 0–1 variable, whether passengers arriving at station \(s\) and go to station \(s^{\prime}\) in the \(t-\)th time interval choose to board train \(i\), if so, then \(L_{i}^{s,s^{\prime}}(t)=1\), otherwise 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Decision Variables Description. The decision variables of the model encompass the train's operational status, denoted as \(T_{i}\), and the type of route, denoted as \(\theta_{i}\). As running sections vary across routes, a 0-1 variable \(\lambda_{i,s}\), is introduced to signify the train's service scope. \[\lambda_{i,s}\leq T_{i},\forall i\in I^{(u)} \tag{5}\]  
\[\lambda_{i,s}\leq T_{i},\forall i\in I^{(d)} \tag{6}\]  
The up short-turn route trains operate between station 1 and turnaround station \(m\), while the down short-turn route trains run between station \(2N\) and \(2N+1-m\), avoiding non-operating sections. \[\sum_{s\leq m}\lambda_{i,s}\geq m-M(1-T_{i}+\theta_{i}),\forall i\in I^{(u)},s \in S^{(u)} \tag{7}\]  
\[\sum_{s\leq m}\lambda_{i,s}\geq m-M(1-T_{i}+\theta_{i}),\forall i\in I^{(d)},s \in S^{(d)} \tag{8}\]  
\[\sum_{s\leq m}\lambda_{i,s}\leq M\cdot\theta_{i},\forall i\in I^{(u)},s\in S^ {(u)} \tag{9}\]  
\[\sum_{s\leq m}\lambda_{i,s}\leq M\cdot\theta_{i},\forall i\in I^{(d)},s\in S^ {(d)} \tag{10}\]  
Up and down full-length routes trains serve all stations. \[\lambda_{i,s}\geq 1-M(2-T_{i}-\theta_{i}),\forall i\in I^{(u)},s\in S^{(u)} \tag{11}\]  
\[\lambda_{i,s}\geq 1-M(2-T_{i}-\theta_{i}),\forall i\in I^{(d)},s\in S^{(d)} \tag{12}\]  
1. Train operation constraints The time gap between train arrivals and departures at two consecutive stations equals the duration of travel for that section, with adherence to the following constraints: \[a_{i,s}-d_{i,s}=r_{i,s},\forall i\in I^{(u)},s\in S^{(u)}/\{S\}\] (13)  
\[\lambda_{i,s}\leq T_{i},\forall i\in I^{(u)} \tag{5}\]0  
When the train halts at a station, it must adhere to the following constraints:  
\[\lambda_{i,s}\leq T_{i},\forall i\in I^{(u)} \tag{5}\]1  
\[\lambda_{i,s}\leq T_{i},\forall i\in I^{(u)} \tag{5}\]2  
The departure time of the train needs to be within the operating hours:  
\[\lambda_{i,s}\leq T_{i},\forall i\in I^{(u)} \tag{5}\]3  
\[\lambda_{i,s}\leq T_{i},\forall i\in I^{(u)} \tag{5}\]4  
The introduction of the virtual coupling decision variable reflects the coupling status of adjacent trains at the station. If trains \(i\) and \(i+1\) are in a coupled state at the station \(s\), their departure times are synchronized.