**2. Train Simulation Model**

In this work, an accurate simulation model is used to calculate the speed profiles of a train and its consumption measured at the pantograph and at substations. It is divided into three modules: train, line and manual driving [47]. The train simulator is a software developed by Comillas Pontifical University researchers. This simulator is a desktop application for Windows coded in an object-oriented environment using the C++/CLI programming language. A validation against real on-board registered measurements was performed for high-speed trains on commercial services and night tests on the Madrid–Barcelona line, demonstrating its accuracy. Simulation results taken from this software showed an average error of 1.2% in running time and 0.4% in energy consumption compared with on-board measurements [47]. This accurate simulator has been applied for the design of efficient driving and tested in collaboration with Renfe and Adif.

The train module includes mass, length, running resistance, adhesion coefficient and the engine characteristics. These are introduced through the maximum traction and braking effort curves, which depend on the train speed. In this work, the traction and braking efficiencies are taken as equal and non-dependent on the train speed. This module includes also the energy consumption of the on-board auxiliary systems and a minimum constant braking effort that is applied along neutral zones in order to feed the auxiliary systems when no braking curve is affecting the train.

The physical characteristics of the line—track geometry (grades, grades transitions and track curves and their transitions), speed limits, tunnels, stopping points, stations, neutral zones, electrical substations and catenary features—are introduced in the line module.

The manual driving module calculates the traction and braking force needed at every time step, taking into account track data, speed limits, the position and speed of the train and stopping points. The driving module takes as input driving commands that can be easily interpreted by a human driver and generates speed profiles. In this work, the human driving is emulated by using a PI (proportional–integral) controller, in which the engine effort is modelled as a variable that represents the proportion of traction or brake that is demanded with respect to the maximum values for the current train speed.
