**4. Simulation Procedures**

The railway system model was implemented in a rail simulator based on the 'quasi static' backwards looking method, due to its short simulation times for estimating energy consumption of vehicles following an imposed speed cycle [46]. The rail simulator is a multi-stage program, implemented in Visual Basic and Fortran language and operating in MS-DOS and the Microsoft Excel workspace [59–61], including:


The software allows one to perform high-quality studies from an energy point of view, with a high degree of flexibility in the simulation by means of a graphical interface where it is possible to set many parameters such as trains' departure times, specific train sequences and trains' stop time period in each station.

For the sizing and verification of the energy storage systems, models have been implemented in the Matlab/Simulink environment. Given the parameters of the electrochemical cells and supercapacitors, and given the power profile to be supplied, it is possible to evaluate electrical variables such as voltage, current, state of charge, power and energy supplied and absorbed.

The numerical simulations have been divided into three parts. The first part is related to the train performance simulations, to determine the power profile required by the rolling stock. The second part is related to the traction system simulations, in which the system is studied from an energy point of view, inserting traffic data and imposing simulation constraints. The last part is related to the on-board energy storage systems, which presents the ESS performance given a power profile reference.
