## 3 Mathematical Modeling
### Train Traffic Dynamic Model  
The headway \(H_{i,i-1}^{s}=t_{i,s}^{d}-t_{i-1,s}^{d}\) between two consecutive trains \(i\) and \(i\)-1 determines the number of waiting passengers at station \(s\). Setting an appropriate headway will avoid the problem of the number of waiting passengers exceeding the available platform capacity during peak periods and solve the problem of wasted train capacity. \[H_{\text{min}}\leq H_{i,i-1}^{s}\leq H_{\text{max}}\,\forall i\in I\backslash\{ 1\},s\in S,I\in\{1,2,\ldots,N^{up}\}\cup\Big{\{}1,2,\ldots,N^{down}\Big{\}} \tag{1}\]  
where \(H_{\text{max}}\) and \(H_{\text{min}}\) are the maximum and minimum headway, respectively. \(I\) is the set of train serial numbers in both directions, and the number of trains running is determined by the number of passengers. \(N^{up}\) and \(N^{down}\) are the total number of trains running in the upstream and downstream directions respectively. It should be clear how the number of trains is determined. The minimum number of trains \(N^{up}_{\text{min}}(N^{down}_{\text{min}})\) is obtained based on the ratio of the expected maximum number of on-board passengers. The expected maximum number of on-board passengers is calculated with the maximum headway and train capacity \(C\) assumed to be infinite. The minimum number of trains during the study period \(T\) should also satisfy the maximum headway constraint, as shown in Equation (2). After that, the maximum number of trains can be determined by calculating the minimum headway, as shown in Equation (3). \[\left\{ \begin{array}{l}N^{up}_{\text{min}}=\max[\frac{Q^{p}_{i,s}}{C},\frac{T }{H_{\text{max}}}+1],i\in\{1,2,\ldots,\frac{T}{H_{\text{max}}}+1\},s\in\{1,2,3,\ldots,n\}\\ N^{down}_{\text{min}}=\max[\frac{Q^{p}_{i,s}}{C},\frac{T}{H_{\text{max}}}+1],i \in\{1,2,\ldots,\frac{T}{H_{\text{max}}}+1\},s\in\{n+1,n+2,\ldots,2n\}\end{array} \right. \tag{2}\]  
\[N^{up}_{\text{max}}=N^{down}_{\text{max}}=\frac{T}{H_{\text{min}}} \tag{3}\]  
where \(Q^{p}_{i,s}\) is the number of on-board passengers of the train \(i\) leaving station \(s\). After obtaining the maximum/minimum number of trains in both directions, the upper and lower bound constraints on the actual number of trains can be acquired, i.e., \(N^{up}\in[N^{up}_{\text{min}},N^{up}_{\text{max}}],N^{down}\in[N^{down}_{ \text{min}},N^{down}_{\text{max}}]\). The departure time \(t_{i,s}^{d}\) of train \(i\) at station \(s\) is related to the arrival time \(t_{i,s}^{d}\) and dwell time \(\tau_{i}^{s}\), where the arrival time \(t_{i,s}^{a}\) is composed of the departure time \(t_{i,s-1}^{d}\) at the previous station \(s\)-1 and the running time \(t_{i,s-1,s}^{a}\) from station \(s\)-1 to station \(s\) of train \(i\), as shown in Figure 4.  
\[t_{i,s}^{d}=t_{i,s}^{a}+A_{i}^{s}\cdot\tau_{i}^{s},A_{i}^{s}\in\{1,0\},\forall i \in I,s\in S \tag{4}\]  
\[t_{i,s}^{a}=t_{i,s-1}^{d}+t_{i,s-1,s}^{t},\forall i\in I,\forall s\in S \backslash\{1,n+1\} \tag{5}\]  
\[t_{i,s-1,s}^{r,\min}\leq t_{i,s-1,s}^{r}\leq t_{i,s-1,s}^{r,\max},\forall s \in S\backslash\{1,n+1\} \tag{6}\]  
\[\tau_{i}^{s,\min}\leq\tau_{i}^{s}\leq\tau_{i}^{s,\max},\forall i\in I,s\in S \tag{7}\]  
where \(A_{i}^{s}\) indicates whether the train \(i\) stops at station \(s\). If the train \(i\) stops at station \(s\), \(A_{i}^{s}=1\), otherwise \(A_{i}^{s}=0\). The terms \(\tau_{i}^{s,\min}\) and \(\tau_{i}^{s,\max}\) are the minimum dwell time and maximum dwell time of the train \(i\) at station \(s\). The terms \(t_{i,s-1,s}^{r,\min}\), \(t_{i,s-1,s}^{r,\max}\) are the minimum running time and maximum running time of the train \(i\) from station \(s\)-1 to station \(s\). In order to guarantee service quality, this paper specifies two train skip-stop behaviors. On the one hand, when three consecutive trains pass the same station \(s\), at least two trains stop at station \(s\), i.e., three consecutive trains are not allowed to skip the same station. On the other hand, a train cannot skip three consecutive stations.