# Simultaneous DC Railway Power System Analysis Method Using Model-Based TPS
## 2 Background of the TPS Algorithm
### Calculation of TPS Dynamic  
If the acceleration is given as Equation (1), then the time increment method can be expressed as  
\[v_{i+1}=v_{i}+a(t_{i+1}-t_{i}) \tag{4}\]  
\[s_{i+1}=s_{i}+v_{i}(t_{i+1}-t_{i}) \tag{5}\]  
Next, the distance increment method can be expressed as below:  
\[t_{i+1}=t_{i}+\frac{s_{i+1}-s_{i}}{v_{i}} \tag{6}\]  
\[v_{i+1}=\sqrt{v_{i}^{2}+2a_{i}(s_{i+1}-s_{i})} \tag{7}\]  
Most of the previously developed program adopts the distance increment method. Note that, the time increment for distance increment method is not linear; it is a varying time step. Additionally, the velocity increment method can be expressed as  
\[t_{i+1}=t_{i}+\frac{v_{i+1}-v_{i}}{a_{i}} \tag{8}\]  
and \(s_{i+1}\) is same as Equation (5). Using Equation (5), the distance of the train moved is an integral of speed \(v_{i}\) with respect to time. Which means that the turning point from coasting (or powering) to breaking mode must be given in time. So additional algorithm is needed to check if the train actually reached the destination as follows:  
\[\left|D_{k}-\sum_{i=1}^{N}d_{i}^{(m)}\right|\leq\sigma \tag{9}\]  
where, \(D_{k}\) is actual distance between two stations, \(d_{i}^{(m)}\) is calculated distance between each adjacent modes \(i\) with regard to the selection of breaking points. This value can be acquired by taking the integral of a speed curve such as Figure 1.  
Additionally, \(\sigma\) is an arbitrary small number that guarantees the accuracy of the result. However, additional iterative processes by adopting time increment method to satisfy Equation (9) can be an obstacle for simultaneous simulation. So, this paper uses a distance increment method. When using the distance increment method, time step changes by \((s_{i+1}-s_{i})/v_{i}\). This is allowable from the point of view of the engineering because the time step for the railway power system, which is dominant, is much shorter than TPS time  
Figure 1: Determination of train arrival by Equation (5). increment values. Additionally, as this paper focuses on varying resistance to represent moving train, evenly changing distance can be a reasonable choice and we will discuss this issue in the last section of the simulation part. Forward and Backward Moving Calculation  
There are two ways to acquire the turning point of breaking mode; manually or automatically. For designing purposes, manually putting on a notch signal, which controls the power of the train, can be used. However, this paper only focuses on the deriving automatic mode change of start, powering, coasting and braking status. Simply, when the train moves forward by acceleration and backward by deceleration, that intersection point is a mode changing moment of coasting (or powering) to braking mode as shown in Figure 2. The forward calculation is literally that the train is moving from the previous station to the next target station. Meanwhile, the backward calculation is an assumption that the train is moving from the target station backwards to the previous station as Equations (10) and (11). \[F_{eff,i}=F_{brk,i}+R_{i} \tag{10}\]  
\[s_{i+1}=s_{i}+v_{i}(t_{i+1}-t_{i}) \tag{5}\]0  
For the distance integration of backward calculation, \(s_{b,i+1}-s_{b,i}\) is negative value, so that the radicand of Equation (11) is positive. So the speed curve reversely increases as Figure 2a by the deceleration value of \(a_{b,i}\). In short, the train virtually moves backwards to determine the exact breaking point of moving the train in forward direction. The unique intersection point for breaking point calculation is shown in Figure 2b. Additionally, the Equation (12) represents the formula to calculate the unique intersection point of \((s_{c2b},v_{c2b})\). \[ \begin{bmatrix}s_{c2b}\\ v_{c2b}\end{bmatrix} = \begin{bmatrix}m_{f}&-1\\ m_{b}&-1\end{bmatrix} ^{-1}\cdot \begin{bmatrix}m_{f}s_{i}-v_{f}\\ m_{b}s_{i}-v_{b,i}\end{bmatrix}  \tag{12}\]  
The algorithm repeatedly finds the unique solution point using the forward slope \(m_{f}\) and the backward slope \(m_{b}\) acquired by adjacent points.