*2.1. Train*

The longitudinal dynamic of vehicles is evaluated applying Newton's second law and kinematic equations:

$$\begin{aligned} m \ \varepsilon \frac{d\upsilon}{dt} = F(t) - R\_{BASE}(\upsilon) - R\_{TRACK}(\upsilon) \\ \mathbf{x} = \mathbf{x}\_0 + \upsilon\_0 \ t + \frac{1}{2} \frac{d\upsilon}{dt} \ t^2 \\ \upsilon = \frac{d\upsilon}{dt} \end{aligned} \tag{1}$$

where *m* is the mass of the vehicle, ε is a correction factor taking into account the rotating mass, *v* and *x* are the train speed and position respectively, *F* is the traction (if positive) or braking (if negative) force. *RBASE*(*v*) is the basic resistance including roll resistance and air resistance, and *RTRACK*(*x*) is the line resistance caused by track slopes and curves, described by:

$$R\_{BASE}(v) = \alpha\_1 + \alpha\_2|v| + \alpha\_3 v^2 \tag{2}$$

$$R\_{TRACK}(\mathbf{x}) = m\mathbf{g}\sin(\mathbf{y}(\mathbf{x})) + m\mathbf{g}\frac{a}{r(\mathbf{x}) - b} \tag{3}$$

where α1, α2 and α3 are the coe fficients of the Davis formula, related to the train and track characteristics, and they can be estimated by empirical measures; *g* is the gravitational acceleration and γ(*x*) is the slope grade. The second term of *RTRACK* is the curve resistance given by empirical formulas, as the Von Röckl's formula, where *r*(*x*) is the curvature radius, and *a*, *b* are coe fficients which depend on the track gauge; in this paper it is considered *a* = 0.65 m and *b* = 55 m [46].

From a given a speed cycle, it is possible to calculate the value of the force (*FMECH*) on the wheels required to overcome the vehicle inertia, slopes and curves, aerodynamic friction and rolling friction. Going upstream the vehicle components and their related efficiencies, the power requested to the contact wire *PTRAIN* is calculated as follows:

$$P\_{TRANN} = \begin{cases} \frac{F\_{MECH} \cdot \upsilon}{\eta\_t} + P\_{ALY} & F\_{MECH} \ge 0\\ \left(F\_{MECH} \upsilon\right) \eta\_t + P\_{ALY} & F\_{MECH} < 0 \end{cases} \tag{4}$$

where *PAUX* is the power absorbed by board auxiliary services (lighting, cooling or heating), *m* is the total mass of the train (including the passengers), *v* is the vehicle speed and η*t* the total efficiency of the locomotive, which takes into account the efficiency of the gear box, the electric motor and the inverter. To bring into account that the voltage along the track is not constant, the railway vehicle is modeled as an ideal current source *ITRAIN*, whose is calculated as the ratio between vehicle power and line voltage *VLINE*:

$$I\_{TRAIN} = \frac{P\_{TRAIN}}{V\_{LINE}}\tag{5}$$
