Analysis, Evaluation and Simulation of Railway Diesel-Electric and Hybrid Units as Distributed Energy Resources

: The objective of this paper involves the analysis, identiﬁcation and evaluation of di ﬀ erent possibilities o ﬀ ered by technology for the improvement and the management of the use of energy and hybridization in railways: On board generation, demand response and energy storage, both in traction and auxiliary loads, considering the aggregation of resources and its stochastic nature. The paper takes into account the importance of e ﬃ cient use of energy in railways, both currently (trains in service, prototypes) and in the future, considering the trends driven by energy policy scenarios (2030–2050) that will a ﬀ ect service and operation of units during their lifetime. A new activity has been considered that will be relevant in the future in the framework of a new electricity supply paradigm: Smart-Grids. According to this paradigm, the interaction of the Electric Power System and the Railway Supply System (somehow embedded in the Power System) will bring new opportunities for the collaboration of these two systems to perform, in a wise economic fashion, a better and more reliable operation of the complete energy system. The paper is focused on a mixed proﬁle with low-medium tra ﬃ c (passenger and freight): The ﬁrst part of the route is electriﬁed (3 kV DC catenary) whereas the second part is not electriﬁed. Results justify that complex policies and objectives bring an opportunity to make cost-e ﬀ ective the hybridization of railway units, especially in low / medium tra ﬃ c lines, which improves their social and economic sustainability.


Introduction
Different policies for improving Energy Efficiency (EE) are a cumber stone for sustainability objectives both for the European Union (EU) and for other countries worldwide. Transportation explains a high percent of the final use of energy, and should have considerable potential for improvement. For this reason, in last decade sustainability is also an important issue for the main associations of the railway sector, such as the International Union of Railways (UIC) and the Community of European Railway and Infrastructure Companies (CER) [1,2]. For these associations, and taking 1990 consumption baseline, the objectives are: Fifty percent reduction in the intensity of energy use (energy per passenger and km, i.e., kWh/pkm, or energy per ton and km, i.e., kWh/tkm) in 2030 (0.09 kWh /pkm), and sixty percent in 2050. In terms of environmental objectives, a reduction in emissions of 75% in 2050 is foreseen. To limit the expansion and dominance of road-based transportation, and to increase the market share of the so-called eco-friendly transport modes (railways and maritime transport), different countries are working in different working areas: For instance, Poland through a model of national intermodal transport [3], or the One Belt One Road Initiative (OBOR) of China, and,

Stationary Energy Storage Systems (SESS)
The main advantage of Stationary Energy Storage Systems is that there are no space and weight restrictions for the storage system, as they are installed in the trackside. In addition, Stationary Systems allow storing the regenerative energy for various trains at the same time, and the energy recuperated can be used in a different train that initially generates it. This fact helps to reduce the demand power peaks and to increase the number of vehicles that can circulate on the railway path reducing the investments to improve the electrical supply system.
However, SESS also have some restrictions. In the first place, the capability of the system is a function of the location of the vehicle, increasing the losses, due to transmission with the distance between the train and the storage system. Furthermore, it is impossible to apply these systems in cases of non-electrified railway paths, or in shorts distances without supply (last-mile, tunnels, etc.).
Some real projects of SESS are currently being used in different railway systems. In Philadelphia, ABB has installed a Li-ion batteries system called ENVILINE ESS [26], providing revenue by generating frequency regulation services on the local energy market. This system has also been installed in Warsaw Metro, improving its energy efficiency. Otherwise, Siemens [22,27] has provided supercapacitors SESS (Sitras SES) in Madrid, Cologne, Rotterdam, Toronto, Portland and Beijing metro lines.
In respect to flywheels, VYCON installed a system for the Los Angeles Country Metropolitan Transportation Authority (LA Metro) Red line (MRL) called WESS, in order to recover the braking energy from their trains [28]. There is also a flywheel system installed in London underground's Piccadilly Line [29].

Railway Route
In order to compare the ability of conventional diesel-electric units (Altaria service), hybrid units (Alvia service), and new proposed alternatives, and also to address the sizing of principal components of the power system (storage units, resizing of engine, etc.), a typical itinerary was selected. This route is a radial passenger service from Madrid to Cartagena, in where "Alvia" and "Altaria" services deserve the railway route and located in the southeast of Spain. Specifically, this itinerary has an electrified overhead system (3 kV, DC two-track, overhead catenary) from Madrid to Chinchilla (around 300 km) and a non-electrified one from Chinchilla (Albacete) to Cartagena (single-track, 225 km) without change of the diesel-electric locomotive (Altaria service). At present, there are six trains on service during weekdays (two of them are "Alvia", and four are "Altaria" type).
For simplicity, the results presented will be focused on a section the chosen itinerary: Alcázar de San Juan-Chinchilla-Cartagena. Alcázar de San Juan (150 km away from Madrid) is a XIX century railway node for freight and passenger services to/from the South and South-East of Spain. The track Madrid-Alcázar is more complex (radial and suburban services to other cities, for example, Toledo Cuenca, and some cities in Andalusia) and has been not considered for simplicity. The railway route was selected, due to their speed profiles (160-200 km in some sections), and a rough profile that conditions the haulage and the size of the storage and engine (i.e., energy constraints on the diesel motors are higher, in comparison to a flat line, due to the considerable acceleration power needed to overcome grade resistance and also to the high braking power recovery during down slopes). Obviously, the same simulation method can be applied to analyze other railway routes and diesel or electric locomotives and multiple unit vehicles.
The profile of the route (altitude versus distance) from Alcazar de San Juan (ASJ) to Cartagena (CT) is given in Figure 1. The route is used both for freight and passenger services and corresponds to a track and a platform that was renovated in 2008. It has experienced a decrease in traffic, due to the increasing rate of investment in new high-speed infrastructures (with EU standard rail gauge, track Madrid-Valencia, 2010, and Albacete-Chinchilla-Alicante, in service since 2013).

Locomotives, Multiple Units and Rolling Stock
For passenger service, rebuilt medium-speed diesel-electric locomotives 334 (with a maximum speed of 200 km/h, series that is very closed to GEC Class 67 [23] developed for UK operators) have been used in this work for simulation purposes. Also, new hybrids trains (hybrid diesel-electric and electric multiple unit, HDEMU S-730) managed and bought by the Spanish Railway Operator (RENFE) during this decade have been considered. The rolling stock considered in simulations were built by: Patentes Talgo, Spain (coaches Talgo IV for the diesel-electric locomotive, and coaches for S-730) [30], Vossloh/EMD, Spain (now Stadler Rail [31], these locomotives are based on diesel engines 12N710G3B-EC licensed by General Motors, 2004). For freight purposes, S-253 (TRAXX series by Bombardier, 2011) [21] and S-252 (Eurosprinter pilot series built by Krauss-Maffei and Siemens, 1992) [22], are also used for simulation purposes.
Main characteristics of these locomotives, coaches and electric multiple units (EMU) are given in Tables 1 and 2. Figure 2 depicts some of these trains.  The route is used both for freight and passenger services and corresponds to a track and a platform that was renovated in 2008. It has experienced a decrease in traffic, due to the increasing rate of investment in new high-speed infrastructures (with EU standard rail gauge, track Madrid-Valencia, 2010, and Albacete-Chinchilla-Alicante, in service since 2013).

Locomotives, Multiple Units and Rolling Stock
For passenger service, rebuilt medium-speed diesel-electric locomotives 334 (with a maximum speed of 200 km/h, series that is very closed to GEC Class 67 [23] developed for UK operators) have been used in this work for simulation purposes. Also, new hybrids trains (hybrid diesel-electric and electric multiple unit, HDEMU S-730) managed and bought by the Spanish Railway Operator (RENFE) during this decade have been considered. The rolling stock considered in simulations were built by: Patentes Talgo, Spain (coaches Talgo IV for the diesel-electric locomotive, and coaches for S-730) [30], Vossloh/EMD, Spain (now Stadler Rail [31], these locomotives are based on diesel engines 12N710G3B-EC licensed by General Motors, 2004). For freight purposes, S-253 (TRAXX series by Bombardier, 2011) [21] and S-252 (Eurosprinter pilot series built by Krauss-Maffei and Siemens, 1992) [22], are also used for simulation purposes.
Main characteristics of these locomotives, coaches and electric multiple units (EMU) are given in Tables 1 and 2. Figure 2 depicts some of these trains. Voltage (kV) -25/3/NA 3 3 Table 2. Characteristics of coaches.

Electric Infrastructures: Substations
The capacity of the electrical substations during peak demands is another issue to be considered. Capacity and configuration limit railway traffic and the electrical interconnection between the public Power System and the Railway Supply System (RSS). In the route Alcazar-Chinchilla, each substation is conventional non-controlled diode type non-reversible (i.e., rectifier substation). The substation usually has two power transformers (2 × 3300 kVA) connected to 66 kV sub-transmission network. These rectifier substations provide 3 kV DC to the overhead line. With this capacity, the number of trains is limited to 3 in the first and last sections of the route (notice that this route is a double-track section). This configuration of RPS is cost-effective and very reliable. It can be considered as a good solution in dense traffic scenarios, but has problems in scenarios in which the probability of having trains injecting and demanding power is low (notice that this is the case presented in this paper: An infrastructure that has reduced its use and which fights with sustainability concerns). Table 3 shows the name of each substation, trains flow and its coverage area.

Electric Infrastructures: Substations
The capacity of the electrical substations during peak demands is another issue to be considered. Capacity and configuration limit railway traffic and the electrical interconnection between the public Power System and the Railway Supply System (RSS). In the route Alcazar-Chinchilla, each substation is conventional non-controlled diode type non-reversible (i.e., rectifier substation). The substation usually has two power transformers (2 × 3300 kVA) connected to 66 kV sub-transmission network. These rectifier substations provide 3 kV DC to the overhead line. With this capacity, the number of trains is limited to 3 in the first and last sections of the route (notice that this route is a double-track section). This configuration of RPS is cost-effective and very reliable. It can be considered as a good solution in dense traffic scenarios, but has problems in scenarios in which the probability of having trains injecting and demanding power is low (notice that this is the case presented in this paper: An infrastructure that has reduced its use and which fights with sustainability concerns). Table 3 shows the name of each substation, trains flow and its coverage area. 1 Distance from previous substation, CH is the last substation; 2 Intercity + regional/commuter + freight.

Timetables for the Route
Additional information for simulation and evaluation purposes is the traffic in the route. This allows determining the existence of critical point for passenger and freight trains and the maximum and minimum number of trains in each substation and track. For the simulation, the traffic of this route is obtained for real traffic requirements and capacity of the single-and double-track sections ( Figure 1). Some example of this information is given in Figure 3.  1 Distance from previous substation, CH is the last substation; 2 Intercity + regional/commuter + freight.

Timetables for the Route
Additional information for simulation and evaluation purposes is the traffic in the route. This allows determining the existence of critical point for passenger and freight trains and the maximum and minimum number of trains in each substation and track. For the simulation, the traffic of this route is obtained for real traffic requirements and capacity of the single-and double-track sections ( Figure 1). Some example of this information is given in Figure 3. Graphic timetable for the railway route Alcázar de San Juan (AJ) to Chinchilla (CH) from 6 p.m. to 12 p.m. on weekdays. Passenger trains in green, freight trains in blue, commuter trains in red and regional trains in maroon.

Train Simulators
The simulation of railway systems has been a field of interest for researchers since the early '80s. In 2008 the Technical University of Cartagena (UPCT), Department of Electrical Engineering, envisaged the usefulness of developing a train energy simulation software. The main reason was the fast development of high-speed services in Spain, and the high energy demand for these trains that affects the whole Power Systems (e.g., balancing of phases in 25 kV substations for high-speed . Graphic timetable for the railway route Alcázar de San Juan (AJ) to Chinchilla (CH) from 6 p.m. to 12 p.m. on weekdays. Passenger trains in green, freight trains in blue, commuter trains in red and regional trains in maroon.

Train Simulators
The simulation of railway systems has been a field of interest for researchers since the early '80s. In 2008 the Technical University of Cartagena (UPCT), Department of Electrical Engineering, envisaged the usefulness of developing a train energy simulation software. The main reason was the fast development of high-speed services in Spain, and the high energy demand for these trains that affects the whole Power Systems (e.g., balancing of phases in 25 kV substations for high-speed tracks). Moreover, other important issues being considered were sustainability and social equity: The decrease in interest on conventional low traffic non-electrified lines (the case of the route under study) which deserves small/medium cities and rural areas (i.e., social and economic barriers arise for these areas whereas the development and migration to big cities is stimulated). This possibility resulted in the development of simulator software in Matlab [32,33]. The main purpose of the program was to calculate the energy consumption, energy recovery, and running times of trains.
Obviously, there are various simulation programs developed both by Universities, Engineering Service Companies and the Railway manufacturing industry. For instance, there are commercially available software packages, such as Trainops ( [34] developed by LTK) and Sitras Sidytrac ( [35], developed by Siemens). Available programs developed by Universities include: Train Operation Model [36] developed by Carnegie Melon University; OpenTrack by ETH university [37,38], Vehicle Simulation Program (VSP) by Vrije University of Brussels [39] or STEC by KTH (Sweden [20]).
The main advantages of this software, and the reason why it is used in this work, is the flexibility that allows for a build-on customization and the integration with other packages of the research team, for example Physically Based Load Models (PBLM) for the evaluation of Energy Storage and Demand Response beyond tractive loads, or the aggregation and management of these resources (from a stochastic point of view).
To simulate energy consumption and performance for different train types and categories (freight or passenger), one must first state their properties in the program (tractive effort, braking curves, weight of coaches or wagons, pneumatic braking characteristics, maximum speed, etc., needs to be defined together with number of seats, occupancy, load factor and so forth). Information about timetables and auxiliary systems are other examples of what information is necessary to perform simulations.
The railway route also needs to be defined. Line gradients, maximum and target speeds need to be defined along the line, together with information on locations of stops, curve radius, speed limits, as well as dwell time on each station.
Once all input data have been included, and a simulation has been performed, the software shows information about total travel time, internal and external forces, speed and acceleration, details about energy consumption and brake characteristics. These data will be discussed in the next section.
The main contributions of this paper are the following: • It introduces a simulation tool that integrates different models for the main load (traction), ESS systems and secondary loads (DR load models for heating and ventilation loads) to evaluate the performance of real railway power systems. Load aggregation procedures used in Public Power Systems are considered; • It proposes feasible solutions that allow increasing the energy efficiency of conventional railway systems by introducing ESS or applying DR policies that enable railways to make greater use of the energy generated through regenerative braking; • It takes into account the natural stochastic nature of different events (train delays) to evaluate the changes in the potential of regenerative braking, and its opportunities. • It defines load curves at several aggregation levels (substations, High Voltage feeders, etc.) taking into account train energy models, timetable for the route, track constraints, and the stochastic nature of some events into the system (train delays); • It demonstrates the potential of new DER resources in railways (storage, for example, due to last-mile capacities in new vehicles and hybrid vehicles) and Load Management to improve the operation of Railway Power System. It also offers a new way to manage new resources to the management of Power Systems, and the improvement of their operation. This potential increases the flexibility of railway demand, operating this system as a smart grid.
The rest of the paper is organized as follows: Section 2 describes the materials and methods used, explaining in detail the models applied to simulate the train movement and its energy consumption. Based on this and additional material, Section 3 examines the possibilities of using Distributed Energy Resources (DER), such as ESS and DR (for traction and "auxiliary" loads) in order to improve the performance of the railway system by increasing its energy efficiency and reducing power peaks. Finally, some conclusions and future developments are stated in Section 4.

General Equations of the Train Movement
The acceleration, a, of a train in its running direction can be described by a single scalar Newton equation and depends on the external and internal forces produced in the train: where: n-overall number of effects being considered. M-mass of the train a-acceleration of the train J-moment of inertia of the different rotating masses (wheels, cog wheels, motor rotors) in the transmission, which causes an apparent increase of mass. R-wheel radius. F tk -propulsive force, tractive effort of locomotive/EMU k of u units in the train. F rk -resistance forces, due to the element r of the train, locomotive, coach, generator, etc. F c -curve resistance F g -grade resistance, due to the slope of the track (positive or negative for the acceleration) k-increment of mass, due to rotating inertia, a coefficient in the range (0, 0.30) depending on the type of vehicle. It is in the range (0.06, 0.10) for a complete train.
Resistance forces are the sum of all forces acting on the train at a given time or place. Some of these forces change directly as the axle loading does: For example, journal friction, rolling resistance, or track resistance. Other forces vary with speed and are known as flange resistance. Finally, some forces vary with the square of the speed: Air and wind resistance. These resistance forces are examined in detail with different models [40][41][42], but they are not the objective of this paper. A quadratic formula has been used for decades to approximate rail vehicles resistance: where v is the speed of the vehicle (m/s, mph, km/h), and A (N), B (N s/m) and C (Ns 2 /m 2 ) are regression coefficients obtained by fitting run-down test of modern passenger and freight units to the Davis equation (e.g., different modifications were developed in 1970 by AREA association, or in 1992 by Canadian National [43]). For example, the modified version of 1970: where w is the weight per axle in tons; n the number of axles, K the air resistance (drag) coefficient, v the speed in miles per hour and F the resistance in pounds per ton. This paper uses different data from manufacturers (EMD, Bombardier, Alstom, Patentes Talgo, Vossloh, Krauss-Maffei, Siemens, etc.), associations (UIC) and railway administrations (SNCF, DB, SBB-CFF, FS, RENFE, etc.) for cars (Eurofima, Corail), locomotives (BoBo, such as Re4/4 III, or CoCo, such as Re6/6), and compositions of homogeneous and composite materials (SNCF). For example, Fr (in N), for a high-speed train (Train à Grande Vitesse, TGV-SE) from SNCF (French operator), or also for SNCF locomotives with n axles, both included in reference [42]: where the force is done in N, and v (speed) in km/h. The grade resistance or gravitational force (slope β, from which calculate i = sinβ): and curve resistance by means of empirical formulae: where k e is the gauge coefficient (750 m for 1435 mm gauge), and r c is the curve radius in meters. All these forces are considered in simulations, taking into account traction and braking curves from manufacturers, and also the limits and constraints of the RPS, being described in next sections.

Traction Effort Curves and Dynamic Braking
When diesel-electric locomotives and vehicles (e.g., DMU) are compared with electric locomotives or vehicles (EMU), it can be observed that their performances in steady state are higher for a 100% electric locomotive than in diesel locomotives. In the simulations to be developed in next paragraph, electric locomotives can develop up to 5.6 MW (according to their Tractive Effort characteristics, Figure 4a, red curve and orange in dash-dotted line) whereas a diesel-electric is limited at around 2.4 MW by the power of its diesel motor (3300 HP). In addition, an electric locomotive can be asked for a higher power during a short time (for instance, it peaks power for about 10 min). Consequently, the acceleration is lower in trains with diesel-electric traction. However, hybrid units, in diesel mode of operation, have several advantages to be discussed later in this work.
Appl. Sci. 2019, 9, x FOR PEER REVIEW 11 of 41 (in N), for a high-speed train (Train à Grande Vitesse, TGV-SE) from SNCF (French operator), or also for SNCF locomotives with n axles, both included in reference [42]: . ; where the force is done in N, and v (speed) in km/h. The grade resistance or gravitational force (slope β, from which calculate i = sinβ): and curve resistance by means of empirical formulae: where ke is the gauge coefficient (750 m for 1435 mm gauge), and rc is the curve radius in meters. All these forces are considered in simulations, taking into account traction and braking curves from manufacturers, and also the limits and constraints of the RPS, being described in next sections.

Traction Effort Curves and Dynamic Braking
When diesel-electric locomotives and vehicles (e.g., DMU) are compared with electric locomotives or vehicles (EMU), it can be observed that their performances in steady state are higher for a 100% electric locomotive than in diesel locomotives. In the simulations to be developed in next paragraph, electric locomotives can develop up to 5.6 MW (according to their Tractive Effort characteristics, Figure 4a, red curve and orange in dash-dotted line) whereas a diesel-electric is limited at around 2.4 MW by the power of its diesel motor (3300 HP). In addition, an electric locomotive can be asked for a higher power during a short time (for instance, it peaks power for about 10 min). Consequently, the acceleration is lower in trains with diesel-electric traction. However, hybrid units, in diesel mode of operation, have several advantages to be discussed later in this work.  At the same time, there are also significant differences in the braking performance of the different locomotives. The maximum braking power for the two full-electrical locomotives is about 5.6 MW; however, the maximum braking effort is higher in S-253 (240 kN) than S-252 (168 kN), and the curve changes at low speeds. In the case of the hybrid locomotive/vehicle, the maximum braking power is limited to 4 MW. Finally, diesel-electric locomotive S-334 only can achieve a At the same time, there are also significant differences in the braking performance of the different locomotives. The maximum braking power for the two full-electrical locomotives is about 5.6 MW; however, the maximum braking effort is higher in S-253 (240 kN) than S-252 (168 kN), and the curve changes at low speeds. In the case of the hybrid locomotive/vehicle, the maximum braking power is limited to 4 MW. Finally, diesel-electric locomotive S-334 only can achieve a braking power around 1.9 MW (Figure 4b). For this reason, diesel and hybrid locomotives have fewer deceleration rates and more time is required to reduce velocity or completely stop a train if only the regenerative braking is applied by railroad engineers.

Hotel Power (Hotel Loads)
In railway systems, the electrical load in the passenger units or coaches (i.e., load of lights, ventilation, heating and air conditioning, information screens, opening and closing of doors, loads in restaurant cars, etc., are referred to as "hotel load" or "hotel power"). UIC estimates that the amount of energy needed for hotel loads range from 10-15% and in some cases (SBB-CFF-FFS, Swiss Railways [44]) up to nearly 40-50% of the total energy consumption of the train [2]. Hotel loads can be directly supplied by the locomotive (e.g., Locomotive S-334) which involves a reduction of traction effort (see Figure 5a), can be feed from overhead lines through converters in coaches or, in some cases (e.g., Talgo IV coaches), trains are fed from power cars (1 or 2 cars) placed at the ends of the rake. Each power car is installed with one, or several DG sets generating 3-phase (4 wire) power supply at 3 kV DC or 380 Volts 50 Hz. Power is transmitted to entire rake through two cable feeders, running through the whole length of the train. In "conventional" intercity trains in Spain (mainly in the period 1990-2010), this electric power supply is tapped at each coach (e.g., Eurofima standard coaches) through 45 kVA DC/AC converters from 3 kV DC supply. Main characteristics are given in Table 4. These characteristics allow foreseeing some ratios of power demand, due to the occupation of passenger trains with respect to average power needed for traction purposes. As it has been stated before, some railway operators report high hotel loads in some trains. For this reason, SBB actually develops a Demand Response (DR) initiative based on the control of head points and heaters in train coaches [45]. This load control, according to SBB pilot reports, happens without affecting the performance of the heating system. This DR policy is well known in conventional power systems in residential and commercial segments [46]. Potential loads of interest are Water Heater (WH) [47] and Heat Ventilation and Air Conditioning Loads (HVAC) [48], due to the thermal inertia (storage) in walls (HVAC) or water tanks (WH), because of the specific heat of building envelope materials or water (WH). This kind of thermal storage covers energy supply to maintain the service (temperature), while power is switched-off.
The construction of train vehicles is especially based on steel (c = 477 J/kgK), and aluminum (c = 896 J/kgK) and this represents a valuable capacity for heat storage, with a similar potential to bricks in buildings' envelope.
There are several possibilities to model HVAC systems and their environment (vehicle or building envelope): A white box, grey box, and black box. Some references in the literature classify these models in physics-based, grey box, and data-driven [49]. According to some experiences, the same principles can be applied to thermal models of HVAC systems for rail vehicles [50]. The first alternative is white box models. Thermal design software, such as EnergyPlus, E_Quest [51], or Modelica, are considered as white box approaches, but they have some drawbacks. This approach is too complex (a high cost for computation time and resources) to evaluate demand response (EnergyPlus works with high order state-space models, e.g., model order around [30][31][32][33][34][35][36][37][38][39][40]. Besides, the identification and evaluation of every necessary parameter are time consuming (and consequently, it is difficult to identify them). These models need some simplification to make modeling efforts feasible to evaluate DR policies in short-term (seconds to some hours, time windows necessary for railway loads). An intermediate approach is the software toolbox BRCM that is proposed to simplify the order of these thermal models (i.e., the simplification of models like EnergyPlus [52]).
Authors' research group has previously proposed individual load models for HVAC loads and their envelope for residential dwellings, and the further aggregation by several mechanisms for these kinds of loads in other segments of public power systems [53]. In the literature, these models are called Physically Based Models (PBLM). For residential heating (cooling) devices with and without thermal storage (e.g., ceramic bricks), or for water heaters [53,54]. They involve the development of an equivalent "grey box" model (a lumped RC network, usually called 3R2C, 2R2C, 2R1C or 1R1C depending on the number of lumped RC parameters that have been chosen to model thermal admittances or transmittances of each wall for the overall model-3, 2, or 1 [55]), very close to References [51,52], but simplified in complexity (the order of state space equations). The reduced order of state-space equations also allows a better estimation of the parameters of each model [49]. Moreover, this approach makes possible a further aggregation of elemental models [56], a necessary condition for small loads both from buildings or train vehicles/coaches to make DR of interest with respect to the overall management demand. The model presented in Reference [57] has several advantages from the point of view of the identification of parameters, but the aggregation of some parameter into an equivalent have some drawback. Assuming that the temperature variations in the rail vehicle are small (steady state), the heat losses to the environment are due to the overall heat transfer coefficient (K) and the overall uncoiled surface of the vehicle (A). An estimation of K is possible because standards (e.g., EN 13129-1) limits the maximum overall heat transfer coefficient of vehicles (k-value) according to climatic zones (I, II or III) and vehicle categories (main line, urban, suburban, etc.). Moreover, it is usually analytically calculated and known by the manufacturer. For example, k values range from 1.2 W/m 2 K to 2.5 W/m 2 K, and they also depend on the area (corridors or primary passenger areas, according to UIC leaflet 567 [60]). The value of Cv parameter can be basically attributable to specific heat capacity for aluminum and steel, that are used in the manufacturing of vehicle bodies. Table 5 presents different physical values to evaluate the parameters used in PBLM model ( Figure 5).  These "grey box" models have been proposed recently [57] for different rail vehicles (tram, Metro, Regio, Main Line, etc.) and their parameters have been estimated through measurements performed in vehicles into the Rail Tech Arsenal GmbH (Vienna, Austria) [58]. The proposed models are a second order model (2R2C) and an equivalent first order model (1R1C). They are similar to "grey box" models proposed for residential dwellings (5R4C) in Reference [49]. In the case of dwellings, it is necessary a more complex model, due to exchanges between the space to be conditioned and other dwellings (rooms, floor, basement, etc.) which are not present in the case of railway vehicles. Other differences are: Standards (for example EN13129-1) require the supply of fresh air to maintain CO 2 levels, and the effect of speed in the exchange of heat between the vehicle and its environment, due to convection effects that changes significantly heat losses coefficients (up to 17.8 W/m 2 K according to the study developed in Reference [59]). Figure 5 shows two "grey box" models. Basic differences are RC networks (2R1C model is chosen for the walls, ceiling and ground that integrate the body frame of the vehicle) and the classification and modeling of external sources and their effects on the vehicle (a sole source versus several sources and their effects: Only in the indoor or both in indoor and in the body, for instance solar radiation). Both Figure 5a,b represent the energy balance between HVAC appliance and its load (vehicle). The model in Figure 5a is made up of several components (sub-models) to allow an optimal flexibility in modelling and planning (e.g., the evaluation of changes in the efficiency of appliances, due to improvements in efficiency, or due to the retrofit of thermal isolation of coaches, planned before periodic refurbishment tasks in older units). These PBLMs usually use thermal-electrical analogies, for example: Dwelling/environment submodels (indoor/vehicle cabin, frame and environment): Parameters that represent heat losses/gains (conduction/convection through vehicle envelope: h a , a wo , a wi , thermal losses and gains, due to air renovation (H V ); as well as heat gains: Solar radiation through windows or the frame (H s ); internal gains, due to passengers (H r ) or appliances (H a , i.e., lighting, information panels, etc.). Also, the model takes into account heat storage from the specific heat of vehicle body/frame (C v ), and indoor masses (C i ). This last capacity not only represents the capacity of the indoor air, but also the heat capacity of some elements of the passenger cabin that are in thermal equilibrium with the indoor air (e.g., seats) Energy conversion submodel (the appliance): Electrical energy conversion into heat (space heating), "cold" (air conditioning). This is represented by a current source (H ch ) and is independent of the dwelling submodels, see Figure 5a, where the same vehicle can "host" different appliances with the same or similar service (heating with resistors or heat pumps).
Control mechanisms which drive the demand according to load service: Thermostats in heating loads (m(t) in Figure 5a), and provide feedback among different submodels.
State variables: Those usually are temperatures (indoor Xi, and vehicle body X v ).
The model presented in Reference [57] has several advantages from the point of view of the identification of parameters, but the aggregation of some parameter into an equivalent have some drawback. Assuming that the temperature variations in the rail vehicle are small (steady state), the heat losses to the environment are due to the overall heat transfer coefficient (K) and the overall uncoiled surface of the vehicle (A). An estimation of K is possible because standards (e.g., EN 13129-1) limits the maximum overall heat transfer coefficient of vehicles (k-value) according to climatic zones (I, II or III) and vehicle categories (main line, urban, suburban, etc.). Moreover, it is usually analytically calculated and known by the manufacturer. For example, k values range from 1.2 W/m 2 K to 2.5 W/m 2 K, and they also depend on the area (corridors or primary passenger areas, according to UIC leaflet 567 [60]). The value of C v parameter can be basically attributable to specific heat capacity for aluminum and steel, that are used in the manufacturing of vehicle bodies. Table 5 presents different physical values to evaluate the parameters used in PBLM model ( Figure 5). These models will be used for simulation purposes. It must be taken into account that the model represents a coach, and that trains have multiple coaches (see Table 2), i.e., some aggregation process is necessary. These processes are described in detail in Reference [56].

Energy Storage Technologies
To characterize energy storage (ESS) technologies, it is usual to determine the energy to weight ratio (or the energy to volume ratio), that is also called energy density, but in traction applications is also significant the power density of the storage system (or the power to weight ratio) because locomotives demand high power peaks when the train accelerates.
Large energy density ratios mean that the ESS is capable of supplying power demand during long periods, while large power density ratios translate in the ability to supply high levels of power pulses in a short time. Figure 6 presents a classification of different storage technologies depending on both parameters: Energy and power density.

Energy Storage Technologies
To characterize energy storage (ESS) technologies, it is usual to determine the energy to weight ratio (or the energy to volume ratio), that is also called energy density, but in traction applications is also significant the power density of the storage system (or the power to weight ratio) because locomotives demand high power peaks when the train accelerates.
Large energy density ratios mean that the ESS is capable of supplying power demand during long periods, while large power density ratios translate in the ability to supply high levels of power pulses in a short time. Figure 6 presents a classification of different storage technologies depending on both parameters: Energy and power density.
Power density (W/kg) It is necessary to consider the trend rather than the absolute levels, as there could be discrepancies between different published data, because of the interdependency of both parameters and the publishing date, since these systems are currently being developed, and consequently, figures of performance could have improved.
Although there are several energy storage technologies, the most common ESS employed in railways applications are supercapacitors, flywheels and batteries. Batteries have a high energy density, but a low power density (a problem from the point of view of energy needs when the train accelerates), while supercapacitors have a high power density, but a low energy density ( Figure 6). Flywheels have higher power density than batteries and higher energy density than supercapacitors, but cost is an important drawback. Other important factors to take into account are shown in Table 6. In order to choose what technology is the most appropriate for each railway application, it is necessary to consider not only their characteristics, but also the place where the energy storage It is necessary to consider the trend rather than the absolute levels, as there could be discrepancies between different published data, because of the interdependency of both parameters and the publishing date, since these systems are currently being developed, and consequently, figures of performance could have improved.
Although there are several energy storage technologies, the most common ESS employed in railways applications are supercapacitors, flywheels and batteries. Batteries have a high energy density, but a low power density (a problem from the point of view of energy needs when the train accelerates), while supercapacitors have a high power density, but a low energy density ( Figure 6). Flywheels have higher power density than batteries and higher energy density than supercapacitors, but cost is an important drawback. Other important factors to take into account are shown in Table 6. In order to choose what technology is the most appropriate for each railway application, it is necessary to consider not only their characteristics, but also the place where the energy storage system is going to be installed. There are two possibilities for placing ESS, on board or wayside (normally in electrical substations) as stationary systems.

Energy Storage Models
Modeling of ESS (batteries and supercapacitors in this work) is an important concern for sizing ESS and developing control strategies of hybrid electric vehicles through simulation studies. Different models have been reported in the literature and reviewed in some specific reports for railways, for instance [62]. The use of batteries [17] and supercapacitors have been previously reported and, in some cases, for diesel traction engines [64]. The simplest model for a battery is a real voltage source (a voltage source with a constant or variable resistor in series, according to SoC of the battery). For a single supercapacitor, different models are proposed in the literature: From an electrochemical model to electric equivalent circuit model. Electric equivalent model is very popular and gives good results. They use from a first order model (the simplest one, with a capacitor) to a third or fourth model (with four capacitors with variable capacity) [65]. When modeling with RC networks is important to take the number of RC elements as low as possible for practical reasons; include the non-linear capacitance effect (the capacitance depends on voltage [64]) only in one C element and finally include a parallel leakage resistor. The model used for simulation purposes in next sections, is a first order model with two capacitors with fits adequately the pattern of response in the order of seconds to some minute [65]: A capacitance C, a capacitance which depends with voltage respect nominal conditions (i.e., U N ) K c (U i − U N ); a series resistance (R S ) and a parallel resistance (R P ) (Figure 7). Two 500 F capacitors from Maxwell Technologies (model BMOD0500 P016 B02) with 16 DC working voltage have been tested in the laboratory in charge and discharge tests to obtain the value of each internal parameter and test the performance of the ESS. Results were that every module could be represented by two resistors and two capacitors: R S = 2.1 mΩ; a parallel resistance R P = 2.8 kΩ; A capacitor C = 500 F and K c around 18 F/V [64]. Some of these values can be obtained in datasheets and the literature, but it is interesting to check them in the laboratory. The series and parallel association needed for each application can be built and evaluated through a state-space representation of the aggregated model. The equivalent of the association must take into account K c and the dependence of equivalent capacity versus voltage U i ). system is going to be installed. There are two possibilities for placing ESS, on board or wayside (normally in electrical substations) as stationary systems.

Energy Storage Models
Modeling of ESS (batteries and supercapacitors in this work) is an important concern for sizing ESS and developing control strategies of hybrid electric vehicles through simulation studies. Different models have been reported in the literature and reviewed in some specific reports for railways, for instance [62]. The use of batteries [17] and supercapacitors have been previously reported and, in some cases, for diesel traction engines [64]. The simplest model for a battery is a real voltage source (a voltage source with a constant or variable resistor in series, according to SoC of the battery). For a single supercapacitor, different models are proposed in the literature: From an electrochemical model to electric equivalent circuit model. Electric equivalent model is very popular and gives good results. They use from a first order model (the simplest one, with a capacitor) to a third or fourth model (with four capacitors with variable capacity) [65]. When modeling with RC networks is important to take the number of RC elements as low as possible for practical reasons; include the non-linear capacitance effect (the capacitance depends on voltage [64]) only in one C element and finally include a parallel leakage resistor. The model used for simulation purposes in next sections, is a first order model with two capacitors with fits adequately the pattern of response in the order of seconds to some minute [65]: A capacitance C, a capacitance which depends with voltage respect nominal conditions (i.e., UN) Kc (Ui−UN); a series resistance (RS) and a parallel resistance (RP) (Figure 7). Two 500 F capacitors from Maxwell Technologies (model BMOD0500 P016 B02) with 16 DC working voltage have been tested in the laboratory in charge and discharge tests to obtain the value of each internal parameter and test the performance of the ESS. Results were that every module could be represented by two resistors and two capacitors: RS = 2.1 mΩ ; a parallel resistance RP = 2.8 kΩ; A capacitor C = 500 F and Kc around 18 F/V [64]. Some of these values can be obtained in datasheets and the literature, but it is interesting to check them in the laboratory. The series and parallel association needed for each application can be built and evaluated through a state-space representation of the aggregated model. The equivalent of the association must take into account Kc and the dependence of equivalent capacity versus voltage Ui).

Acceleration and Power
In order to study the storage possibilities of the different locomotive vehicles, some simulations have been performed in the railway route from Alcazar de San Juan to Cartagena. In case of the full-electric locomotives (S-253 and S-252), although some simulations have been carried out in the whole itinerary, nowadays it is only possible to drive along the route from Alcazar de San Juan to Chinchilla, as the rest of the railway track from Chinchilla to Cartagena is not electrified.

Acceleration and Power
In order to study the storage possibilities of the different locomotive vehicles, some simulations have been performed in the railway route from Alcazar de San Juan to Cartagena. In case of the full-electric locomotives (S-253 and S-252), although some simulations have been carried out in the whole itinerary, nowadays it is only possible to drive along the route from Alcazar de San Juan to Chinchilla, as the rest of the railway track from Chinchilla to Cartagena is not electrified.
The simulator tool has been developed by authors in Matlab, based on the equations already described in Section 2 for obtaining the resistance forces and the tractive effort-velocity and acceleration curves. Once the resistance forces (curve, rail vehicles and grade, if this force is against the acceleration of the train) and the traction effort (motor and, in some cases, grade) is computed, it is easy to obtain the position, speed, acceleration, power and energy that determine the train performance in each trip on the route. For the section been considered, resistance force, due to curves is limited (see Figure 1b). Moreover, Talgo coaches have independent wheels which limit these effects respect to conventional (bogies) coaches. A preliminary version of this tool was presented in References [16,17].
The power profile of the locomotives is calculated as the product of the propulsive force and the velocity of the train. When the power takes negative values, it means the engine is generating energy. Acceleration could be obtained from Equation (2). Results obtained for the acceleration and power demand for the different locomotives simulated are shown in Figures 8 and 9. The simulator tool has been developed by authors in Matlab, based on the equations already described in Section 2 for obtaining the resistance forces and the tractive effort-velocity and acceleration curves. Once the resistance forces (curve, rail vehicles and grade, if this force is against the acceleration of the train) and the traction effort (motor and, in some cases, grade) is computed, it is easy to obtain the position, speed, acceleration, power and energy that determine the train performance in each trip on the route. For the section been considered, resistance force, due to curves is limited (see Figure 1b). Moreover, Talgo coaches have independent wheels which limit these effects respect to conventional (bogies) coaches. A preliminary version of this tool was presented in References [16,17].
The power profile of the locomotives is calculated as the product of the propulsive force and the velocity of the train. When the power takes negative values, it means the engine is generating energy. Acceleration could be obtained from Equation (2). Results obtained for the acceleration and power demand for the different locomotives simulated are shown in Figures 8 and 9. As can be seen in Figures 8 and 9, the train has negative acceleration throughout the itinerary, normally when it has to stop in a station, or it reduces speed below the limits of each of the sections of the route. This negative acceleration is achieved through braking. Electrical locomotives have regenerative braking (the traction motor works as a generator), but sometimes the generated energy cannot be returned through the catenary, so braking is achieved through the use of electrical resistors. In this case, the simulation software considers the possibility to inject power (if there are other trains on the track section) or the use of pneumatic, blending or resistive bank braking options, i.e., there is some feedback from Electric and Kinematical parts of the model. This is an important issue because electromechanical limitations can have a major impact on the kinematical behavior of The simulator tool has been developed by authors in Matlab, based on the equations already described in Section 2 for obtaining the resistance forces and the tractive effort-velocity and acceleration curves. Once the resistance forces (curve, rail vehicles and grade, if this force is against the acceleration of the train) and the traction effort (motor and, in some cases, grade) is computed, it is easy to obtain the position, speed, acceleration, power and energy that determine the train performance in each trip on the route. For the section been considered, resistance force, due to curves is limited (see Figure 1b). Moreover, Talgo coaches have independent wheels which limit these effects respect to conventional (bogies) coaches. A preliminary version of this tool was presented in References [16,17].
The power profile of the locomotives is calculated as the product of the propulsive force and the velocity of the train. When the power takes negative values, it means the engine is generating energy. Acceleration could be obtained from Equation (2). Results obtained for the acceleration and power demand for the different locomotives simulated are shown in Figures 8 and 9. As can be seen in Figures 8 and 9, the train has negative acceleration throughout the itinerary, normally when it has to stop in a station, or it reduces speed below the limits of each of the sections of the route. This negative acceleration is achieved through braking. Electrical locomotives have regenerative braking (the traction motor works as a generator), but sometimes the generated energy cannot be returned through the catenary, so braking is achieved through the use of electrical resistors. In this case, the simulation software considers the possibility to inject power (if there are other trains on the track section) or the use of pneumatic, blending or resistive bank braking options, i.e., there is some feedback from Electric and Kinematical parts of the model. This is an important issue because electromechanical limitations can have a major impact on the kinematical behavior of As can be seen in Figures 8 and 9, the train has negative acceleration throughout the itinerary, normally when it has to stop in a station, or it reduces speed below the limits of each of the sections of the route. This negative acceleration is achieved through braking. Electrical locomotives have regenerative braking (the traction motor works as a generator), but sometimes the generated energy cannot be returned through the catenary, so braking is achieved through the use of electrical resistors. In this case, the simulation software considers the possibility to inject power (if there are other trains on the track section) or the use of pneumatic, blending or resistive bank braking options, i.e., there is some feedback from Electric and Kinematical parts of the model. This is an important issue because electromechanical limitations can have a major impact on the kinematical behavior of the model (e.g., the variation in traction and braking curves, due to voltage values on overhead lines, which affects accelerations and changes timetables). The interest and impacts of this feedback is analyzed in the literature [66]. In the case of diesel units, they also have dynamic braking, in which the power supplied by motors are used to feed roof resistors cooled with forced ventilation. In both cases, energy is used in a non-efficient way.
In order to improve the energy efficiency and make use of the energy generated in the regenerative braking, the idea is to install batteries and/or supercapacitors, recovering and storing the braking energy. The recovered energy can be used for feeding the same train when it is accelerating, reducing the power peak consumption. In addition, in electrified paths, it could feed other locomotives circulating in the same itinerary or give it back to the grid through the catenary (in the case of reversible substations).

Diesel-Electric Locomotive (S-334)
S-334 locomotive has been simulated through the railway itinerary between Cartagena and Alcazar, with a Talgo IV coaches' configuration ( The speed profile for a passenger train in both directions is presented in Figure 10. Appl. Sci. 2019, 9, x FOR PEER REVIEW 18 of 41 the model (e.g., the variation in traction and braking curves, due to voltage values on overhead lines, which affects accelerations and changes timetables). The interest and impacts of this feedback is analyzed in the literature [66]. In the case of diesel units, they also have dynamic braking, in which the power supplied by motors are used to feed roof resistors cooled with forced ventilation. In both cases, energy is used in a non-efficient way.
In order to improve the energy efficiency and make use of the energy generated in the regenerative braking, the idea is to install batteries and/or supercapacitors, recovering and storing the braking energy. The recovered energy can be used for feeding the same train when it is accelerating, reducing the power peak consumption. In addition, in electrified paths, it could feed other locomotives circulating in the same itinerary or give it back to the grid through the catenary (in the case of reversible substations).

Diesel-Electric Locomotive (S-334)
S-334 locomotive has been simulated through the railway itinerary between Cartagena and Alcazar, with a Talgo IV coaches' configuration ( The speed profile for a passenger train in both directions is presented in Figure 10. Some figures of the simulation for passenger trains are presented in Table 7. The Cartagena-Alcazar itinerary has higher values of train energy consumption, as well as the average power consumption, due to the ascending slope and associated large grade resistances that the train has to overcome (see Figure 1).  Table 7. The Cartagena-Alcazar itinerary has higher values of train energy consumption, as well as the average power consumption, due to the ascending slope and associated large grade resistances that the train has to overcome (see Figure 1).

Hybrid Diesel-Electric and Electric Unit (HDEMU S-730)
S-730 locomotive has been simulated through the same itinerary, studying possibilities for energy storage associated with the use of regenerative braking and changes in traction mode throughout the route Alcazar-Chinchilla. The configuration of coaches is Talgo, see Table 2. This hybrid locomotive of the HDEMU can develop a maximum speed of 180 km/h in diesel-electric mode. Speed profiles for the route are presented in Figure 11. S-730 locomotive has been simulated through the same itinerary, studying possibilities for energy storage associated with the use of regenerative braking and changes in traction mode throughout the route Alcazar-Chinchilla. The configuration of coaches is Talgo, see Table 2. This hybrid locomotive of the HDEMU can develop a maximum speed of 180 km/h in diesel-electric mode. Speed profiles for the route are presented in Figure 11. Some results of the simulation for HDEMU S-730 are presented in Table 8.   Some results of the simulation for HDEMU S-730 are presented in Table 8.

Hybrid Diesel-Electric and Electric Unit (HDEMU S-730)
S-730 locomotive has been simulated through the same itinerary, studying possibilities for energy storage associated with the use of regenerative braking and changes in traction mode throughout the route Alcazar-Chinchilla. The configuration of coaches is Talgo, see Table 2. This hybrid locomotive of the HDEMU can develop a maximum speed of 180 km/h in diesel-electric mode. Speed profiles for the route are presented in Figure 11. Some results of the simulation for HDEMU S-730 are presented in Table 8.   The maximum energy recovered after a braking period is 203 kWh. It is also calculated the energy that the train needs to accelerate the first minute after a stop (maximum traction effort), obtaining a value of 32 kWh (i.e., first energy up and down cycle in Figure 12).
To store the regenerative energy and, in this way, reduce the train energy consumption, it is studied the possibility of installing an ESS based on Li-ion batteries, a HESS mixing batteries and supercapacitors, and only supercapacitors. Parameters of Li-ion batteries have been obtained from References [67,68] and parameters of supercapacitors from Reference [69].
The characteristics of the system are shown in Table 9. The state of charge of the battery energy storage system (BESS) and the hybrid ESS (HESS) is represented in Figure 13. In order to increase the batteries lifetime, the SOC remains between 30% and 80%, and the majority of the time, it is maintained around 50%. Red curves represent the supercapacitors values, and blue lines show the behavior of the batteries. The maximum energy recovered after a braking period is 203 kWh. It is also calculated the energy that the train needs to accelerate the first minute after a stop (maximum traction effort), obtaining a value of 32 kWh (i.e., first energy up and down cycle in Figure 12).
To store the regenerative energy and, in this way, reduce the train energy consumption, it is studied the possibility of installing an ESS based on Li-ion batteries, a HESS mixing batteries and supercapacitors, and only supercapacitors. Parameters of Li-ion batteries have been obtained from References [67,68] and parameters of supercapacitors from Reference [69].
The characteristics of the system are shown in Table 9. The state of charge of the battery energy storage system (BESS) and the hybrid ESS (HESS) is represented in Figure 13. In order to increase the batteries lifetime, the SOC remains between 30% and 80%, and the majority of the time, it is maintained around 50%. Red curves represent the supercapacitors values, and blue lines show the behavior of the batteries. The main problem that arises through the use of HESS-as on board energy storage system-is the higher rates of weight and volume per kWh of the supercapacitors compared with batteries (435 kg/kWh vs. 6.75 kg/kWh and 0.04 m 3 /kWh vs. 0.005 m 3 /kWh). On the one hand, excessive weight of the ESS could substantially modify the dynamic behavior of the train. On the other hand, if there is not enough space in the locomotive, it could be necessary to add a service/power car to the train to place the ESS (notice that this is not a problem for Talgo units, Table 2, because they usually integrate power coaches for diesel and electric units. In the case of Talgo IV, the reason is to cover "hotel loads" in the case the supply from locomotive is not available).

Electric Locomotives (S-252 and S-253)
S-252 and S-253 are full electric locomotives ( Figure 2). Therefore, in this case, the itinerary in which can circulate is only the section between Alcazar and Chinchilla (with 1 or 2 intermediate stops). These locomotives have been simulated not only in this section, but through the whole route (for comparison purposes). As can be seen in Figure 5a, both locomotives have similar traction The main problem that arises through the use of HESS-as on board energy storage system-is the higher rates of weight and volume per kWh of the supercapacitors compared with batteries (435 kg/kWh vs. 6.75 kg/kWh and 0.04 m 3 /kWh vs. 0.005 m 3 /kWh). On the one hand, excessive weight of the ESS could substantially modify the dynamic behavior of the train. On the other hand, if there is not enough space in the locomotive, it could be necessary to add a service/power car to the train to place the ESS (notice that this is not a problem for Talgo units, Table 2, because they usually integrate power coaches for diesel and electric units. In the case of Talgo IV, the reason is to cover "hotel loads" in the case the supply from locomotive is not available).

Electric Locomotives (S-252 and S-253)
S-252 and S-253 are full electric locomotives ( Figure 2). Therefore, in this case, the itinerary in which can circulate is only the section between Alcazar and Chinchilla (with 1 or 2 intermediate stops). These locomotives have been simulated not only in this section, but through the whole route (for comparison purposes). As can be seen in Figure 5a, both locomotives have similar traction curves, but the main difference is that S-252 reaches 220 km/h, while S-253 has a speed limit of 140 km/h, because S-253 was designed as a freight locomotive. Figures 14 and 15  curves, but the main difference is that S-252 reaches 220 km/h, while S-253 has a speed limit of 140 km/h, because S-253 was designed as a freight locomotive. Figures 14 and 15 depict the speed profile for a passenger train in both directions and the whole itinerary. Some results of the simulation for passenger trains are presented in Table 10.  curves, but the main difference is that S-252 reaches 220 km/h, while S-253 has a speed limit of 140 km/h, because S-253 was designed as a freight locomotive. Figures 14 and 15 depict the speed profile for a passenger train in both directions and the whole itinerary. Some results of the simulation for passenger trains are presented in Table 10.  Some results of the simulation for passenger trains are presented in Table 10.
The duration of the travel increases in about 10 min by using the locomotive S-253, due to their speed limit of 140 km/h (Table 10, and Table 1, i.e., S-252 is a locomotive designed for high-speed duties). However, the limitation of the maximum speed also reduces the energy consumption, e.g., from 4673.2 kWh to 3837.0 kWh (Cartagena-Alcazar direction), that means about 18% of the total energy consumption. These results show that accepting slightly longer travel times; significant improvements can be made in terms of energy efficiency. It is interesting to consider that some reports [2] present fast trains (high-speed trains) as a more efficient way for transportation, but this is mainly due to passenger occupation and supply system (25 kV AC, that allows power flow to public power system) and not to technological reasons. For this reason, the improvement of braking potential is the main concern of this work to engage authorities and operators in the improvement and maintenance of these lines.

Freight Transport with S-334 and S-252
The locomotives S-334 (diesel-electric) and S-252 (electric) have also been used for freight transport (it is usual for railway operators that older passenger locomotives be cascaded down to freight and regional services). In this case, the maximum speed permitted for the circulation of the wagons is 100 km/h. The train is formed by 10 flat bogie wagons (container-wagon, see Table 2). Both locomotives have been simulated throughout the whole itinerary (Figures 16 and 17 present some results of these simulations). The duration of the travel increases in about 10 min by using the locomotive S-253, due to their speed limit of 140 km/h (Table 10, and Table 1, i.e., S-252 is a locomotive designed for high-speed duties). However, the limitation of the maximum speed also reduces the energy consumption, e.g., from 4673.2 kWh to 3837.0 kWh (Cartagena-Alcazar direction), that means about 18% of the total energy consumption. These results show that accepting slightly longer travel times; significant improvements can be made in terms of energy efficiency. It is interesting to consider that some reports [2] present fast trains (high-speed trains) as a more efficient way for transportation, but this is mainly due to passenger occupation and supply system (25 kV AC, that allows power flow to public power system) and not to technological reasons. For this reason, the improvement of braking potential is the main concern of this work to engage authorities and operators in the improvement and maintenance of these lines.

Freight Transport with S-334 and S-252
The locomotives S-334 (diesel-electric) and S-252 (electric) have also been used for freight transport (it is usual for railway operators that older passenger locomotives be cascaded down to freight and regional services). In this case, the maximum speed permitted for the circulation of the wagons is 100 km/h. The train is formed by 10 flat bogie wagons (container-wagon, see Table 2). Both locomotives have been simulated throughout the whole itinerary (Figures 16 and 17 present some results of these simulations).  Some results of the simulation for freight trains are presented in Table 11. It is interesting to emphasize the high potential for energy recovery in these trains. This potential could justify the need for a change in transportation freight shares and the stimulation of intermodal services, both at national or international levels, for instance in Poland [3], or the OBOR initiative China-Europe [4].  Some results of the simulation for freight trains are presented in Table 11. It is interesting to emphasize the high potential for energy recovery in these trains. This potential could justify the need for a change in transportation freight shares and the stimulation of intermodal services, both at national or international levels, for instance in Poland [3], or the OBOR initiative China-Europe [4]. Results obtained for KPIs in passenger trains are presented in Table 12. It is considered that regenerative braking can be used only between Alcazar and Chinchilla and that the diesel locomotive (S-334) cannot use the regenerative braking. Results obtained for KPIs in passenger trains considering that regenerative braking can be used during the whole itinerary (all locomotives) are presented in Table 13. In a 2015 report issued by the Spanish Government about the situation of railways in Spain [70], some data about energy consumption have been published, distinguishing among different routes and types of trains. From the studied itinerary (Madrid-Cartagena) and passenger trains, it has been reported a KPI 2 value of 20.68 kWh/train-km, a KPI 3 of 0.079 kWh/seat-km and a KPI 4 of 0.135 kWh/pkm. These values can be compared with the values obtained for the diesel locomotive S-334 (without considering regenerative braking), as it is nearly the only locomotive that operates passenger duties in this route in 2015. As can be seen in Table 12, the values obtained in the present study are similar to those reported (e.g., from Alcazar to Cartagena: KPI 2-18.78 kWh/train-km; KPI 3-0.0716 kWh/seat-km; and KPI 4-0.1225 kWh/pkm).
Reference [20] studies the performance of several Sweden electrical locomotives in passenger services and presents some values for the Energy Recuperation Rate (KPI 5) that varies between 10-40%. Reference [20] evaluates KPI 3 with values which damp from 0.02 to 0.05 kWh/seat-km. These values are in agreement with values obtained in the current study for the electric locomotives (S-252 and S-253). Results validate the overall performance of the proposed model.
Another study [71] about a Japanese electric train with regenerative braking shows an Energy Recuperation Rate that varies from 45% to 65%. Reference [72] develops a study about the regenerative potential in a Metro Line from Istanbul, with 32% of energy recuperated through regenerative braking. Using peak clipping strategies and OESS, savings reach 75% [73].
As noticeable for these results, the Energy Regenerative Rate is highly influenced by the conditions of the railway route, as well as the characteristic of the locomotive, but it is demonstrated that making use of braking energy has a high potential in reducing the energy consumption and improving the energy efficiency of railways operations in the future.

Freight Trains
Results obtained for KPIs in freight trains (with the same considerations as in Table 12) are presented in Table 14. Results obtained for KPIs in freight trains considering that regenerative braking can be used during the whole itinerary (and by both locomotives) are presented in Table 15. In the case of freight locomotives, reports from the Spanish Government [74] calculate general data of the consumption rates, but it is not segregated in the different routes of the Spanish Railway System. There are reported values of 27.9 kWh/train-km for KPI 2, 0.03 kWh/gross tkm for KPI 3 and 0.07 kWh/net tkm for KPI 4. These values are slightly higher than those calculated in the present study for the diesel locomotive S-334 in the Alcazar-Cartagena direction, although there is not a big difference in the opposite direction (see Table 14: KPI 2-31.43 kWh/train-km; KPI 3-0.035 kWh/gross tkm; and KPI 4-0.0629 kWh/net tkm).
Differences between both results could be explained in the peculiarities of this specific railway route and locomotive compared with the average characteristics of the Spanish railway freight transport (notice that mountain areas in Spain cover 20 to 40% of territory, and railway profiles are quite difficult in some areas, like in Italy, Norway or Switzerland railways).

Downsizing Diesel-Electric Power Generation
The study of the possibility of a reduction (resizing) of the power engine for the hybrid HDEMU S-730 and the sizing of OESS alternatives (for its use in other sections) has been accomplished in this section. Trains with this type of locomotive are only used in passenger services and comprises of two 1.2 MW engines (in power/service coaches). The idea is to reduce in 0.4 MW each one of the power engines, and supply the default of power during peak demand with the help of an ESS that includes supercapacitors and batteries. This ESS stores the regenerative braking energy available in other periods.
To evaluate this possibility is necessary to perform simulations in the round trip between Cartagena and Alcazar. Figure 18 presents the electrical power profile for the whole itinerary (starting and ending in Alcazar) for both power plants. The red line marks the desired power reduction (i.e., from 2.4 MW to 1.6 MW in the 3 kV DC bus). To evaluate this possibility is necessary to perform simulations in the round trip between Cartagena and Alcazar. Figure 18 presents the electrical power profile for the whole itinerary (starting and ending in Alcazar) for both power plants. The red line marks the desired power reduction (i.e., from 2.4 MW to 1.6 MW in the 3 kV DC bus). Power peaks that ESS must cover (blue line), the regenerative braking profile (red line), and the stored energy necessary to meet the power demands (magenta) are presented in Figure 19 (remember that braking effort of this S730 unit is around 4 MW, Figure 4, and for simplicity and cost-effectiveness remains unchanged in this scenario). Power peaks that ESS must cover (blue line), the regenerative braking profile (red line), and the stored energy necessary to meet the power demands (magenta) are presented in Figure 19 (remember that braking effort of this S730 unit is around 4 MW, Figure 4, and for simplicity and cost-effectiveness remains unchanged in this scenario).
Power peaks that ESS must cover (blue line), the regenerative braking profile (red line), and the stored energy necessary to meet the power demands (magenta) are presented in Figure 19 (remember that braking effort of this S730 unit is around 4 MW, Figure 4, and for simplicity and cost-effectiveness remains unchanged in this scenario). The characteristics of the three systems proposed are presented in Table 16.  The characteristics of the three systems proposed are presented in Table 16.  Figure 20 depicts the energy stored through ESS systems in both cases. The red line represents the supercapacitors, and blue lines show the behavior of the batteries. It can be clearly observed the effect of the supercapacitors in the charge and discharge of the battery system (HESS), slightly reducing the fluctuations that the batteries suffer in BESS. In both cases, the SOC of the batteries is maintained between 30% and 80% to increase their lifetime.

Last Mile Applications
Another significant application of OESS is the so-called "last-mile". Hybrid or electric locomotives with this feature can cross non-electrified track sections without making use of overhead line, improving the flexibility and energy efficiency of the locomotive. This ESS can also be used in the hybrid locomotive when switching between the diesel and the electric engine, producing smoother transitions (or in terminals with different catenary voltage, e.g., 3 kV DC vs. 25 kV AC for SNCF, RENFE operators).
The ESS allows the locomotive to circulate in sidings, terminals, or factories, when normally another supporting diesel locomotive is used to help the train reach the last non-electrified part of

Last Mile Applications
Another significant application of OESS is the so-called "last-mile". Hybrid or electric locomotives with this feature can cross non-electrified track sections without making use of overhead line, improving the flexibility and energy efficiency of the locomotive. This ESS can also be used in the hybrid locomotive when switching between the diesel and the electric engine, producing smoother transitions (or in terminals with different catenary voltage, e.g., 3 kV DC vs. 25 kV AC for SNCF, RENFE operators).
The ESS allows the locomotive to circulate in sidings, terminals, or factories, when normally another supporting diesel locomotive is used to help the train reach the last non-electrified part of the itinerary (called last-mile). In addition, it can be applied when there is a change in the nominal voltage of the catenary, e.g., in trains crossing borders (3 kV DC to 15 kV or 25 kV AC systems). Otherwise, it can also be used when the train is arriving at terminal stations, reducing in this way emissions and noise nearby the train station. Finally, another important application is its use as a backup and DER system (to be developed in Section 3.5), increasing the flexibility of the train and allowing the operation of trains when unforeseen catenary instabilities or failures are produced.
The energy that is required for circulating during different distances (5, 10 and 15 km) at 50 km/h, with different gradients (between −15% and 15% ) is presented in Figure 21.

Last Mile Applications
Another significant application of OESS is the so-called "last-mile". Hybrid or electric locomotives with this feature can cross non-electrified track sections without making use of overhead line, improving the flexibility and energy efficiency of the locomotive. This ESS can also be used in the hybrid locomotive when switching between the diesel and the electric engine, producing smoother transitions (or in terminals with different catenary voltage, e.g., 3 kV DC vs. 25 kV AC for SNCF, RENFE operators).
The ESS allows the locomotive to circulate in sidings, terminals, or factories, when normally another supporting diesel locomotive is used to help the train reach the last non-electrified part of the itinerary (called last-mile). In addition, it can be applied when there is a change in the nominal voltage of the catenary, e.g., in trains crossing borders (3 kV DC to 15 kV or 25 kV AC systems). Otherwise, it can also be used when the train is arriving at terminal stations, reducing in this way emissions and noise nearby the train station. Finally, another important application is its use as a backup and DER system (to be developed in Section 3.5), increasing the flexibility of the train and allowing the operation of trains when unforeseen catenary instabilities or failures are produced.
The energy that is required for circulating during different distances (5, 10 and 15 km) at 50 km/h, with different gradients (between −15‰ and 15‰) is presented in Figure 21.  In last-mile applications, normally the slope is going to be near to 0, so the energy that is needed for circulating 15 km is about 30 kWh. In order to maintain the SOC of the batteries between 80% and 40% and increase their lifespan, it should be necessary to install a battery system, sized at 75 kWh. There is also the possibility to install a HESS equipped with a supercapacitor of capacity of 7kWh (that allow the train accelerates and reaches 50 km/h) and a battery of capacity of 50 kWh that could maintain the speed for 15 km (Section 3.5). It is also possible to install a 30 kWh supercapacitor system, that increases the lifespan of the system, but the space required, and its weight increase substantially. The characteristics of the systems proposed are presented in Table 17.

Evaluation and Characteristics of Aggregated Demand
Once traction power needs have been evaluated, it is interesting to take some attention to the load profile in the electrified route (3 kV-DC, 150 km length, eight rectifier substations, Table 3). For this purpose, the timetable presented in Figure 3 has been used for a workday, and 52 trains have been simulated (freight and passenger with electric, diesel-electric and hybrid traction) for the electrified section of the route (from AJ to CH). Notice that railway timetables are developed to make train operation robust and resilient to small delays and these can have a negative or positive effect. It should be taken into account that delays may occur throughout the route (stochastic theory helps in the study of these possibilities and is considered in railway traffic management algorithms [14], and that, in some cases, dynamic braking cannot be employed. The "stochastic" nature of the problem is not new in DR and DER policies and models, some of them proposed by authors [53] and applied for this problem with statistic methodologies explained in Reference [56]. Figure 22a shows this last scenario: Braking is performed through resistive braking (obviously, Altaria diesel train services with S-334 are not considered). Figure 22a represents the demand for the aggregated load (only traction requirements are considered for simplicity) for the eight substations from Alcazar SJ to Chinchilla, whereas Figure 22b includes the demand for Altaria (diesel-electric) and Alvia S-730 (hybrid) trains. Figure 22c depicts the low synchronism between the braking potential of the train in the section and the percentage of braking being effectively recovered by other trains. Figure 22d shows the possibilities that offer the change of mode of traction in HDEMU S-730 (demand for HDEMU in electric mode is presented in the green line, Figure 22b). This change in the operation model (from electric to diesel-electric) clips the peak demand target in Figure 22a.

Evaluation and Characteristics of Aggregated Demand
Once traction power needs have been evaluated, it is interesting to take some attention to the load profile in the electrified route (3 kV-DC, 150 km length, eight rectifier substations, Table 3). For this purpose, the timetable presented in Figure 3 has been used for a workday, and 52 trains have been simulated (freight and passenger with electric, diesel-electric and hybrid traction) for the electrified section of the route (from AJ to CH). Notice that railway timetables are developed to make train operation robust and resilient to small delays and these can have a negative or positive effect. It should be taken into account that delays may occur throughout the route (stochastic theory helps in the study of these possibilities and is considered in railway traffic management algorithms [14], and that, in some cases, dynamic braking cannot be employed. The "stochastic" nature of the problem is not new in DR and DER policies and models, some of them proposed by authors [53] and applied for this problem with statistic methodologies explained in Reference [56]. Figure 22a shows this last scenario: Braking is performed through resistive braking (obviously, Altaria diesel train services with S-334 are not considered). Figure 22a represents the demand for the aggregated load (only traction requirements are considered for simplicity) for the eight substations from Alcazar SJ to Chinchilla, whereas Figure 22b includes the demand for Altaria (diesel-electric) and Alvia S-730 (hybrid) trains. Figure 22c depicts the low synchronism between the braking potential of the train in the section and the percentage of braking being effectively recovered by other trains. Figure 22d shows the possibilities that offer the change of mode of traction in HDEMU S-730 (demand for HDEMU in electric mode is presented in the green line, Figure 22b). This change in the operation model (from electric to diesel-electric) clips the peak demand target in Figure 22a. Several indices have been defined for helping the reader in the evaluation of results (notice that these indices are for an aggregation of trains whereas KPI defined in Section 3.2.5 are valid for a single vehicle). For example, the load factor (LF) (or its reciprocal, the capacity factor, CF), that is usually used in Public Power Systems to evaluate the use of available capacity (i.e., the rationality of investments) is used in this work for Railway Power System (RPS). Traditional policies state that Supply-Side resources are planned to follow Load Demand fluctuations, but this theory is changing, due to the deployment and use of DR. In conventional Power Systems, CF is around 1.2-1.7 (i.e., the load factor is around 0.6 to 0.8), whereas in manufacturing sector CF rages 1.1-1.3. Notice that Railway Power Systems (Table 18) presents very low LFs (or very high CFs) even at medium-high aggregation level (in our case at 66 kV sub-transport level of public power system, considering in Several indices have been defined for helping the reader in the evaluation of results (notice that these indices are for an aggregation of trains whereas KPI defined in Section 3.2.5 are valid for a single vehicle). For example, the load factor (LF) (or its reciprocal, the capacity factor, CF), that is usually used in Public Power Systems to evaluate the use of available capacity (i.e., the rationality of investments) is used in this work for Railway Power System (RPS). Traditional policies state that Supply-Side resources are planned to follow Load Demand fluctuations, but this theory is changing, due to the deployment and use of DR. In conventional Power Systems, CF is around 1.2-1.7 (i.e., the load factor is around 0.6 to 0.8), whereas in manufacturing sector CF rages 1.1-1.3. Notice that Railway Power Systems (Table 18) presents very low LFs (or very high CFs) even at medium-high aggregation level (in our case at 66 kV sub-transport level of public power system, considering in this table the possibility that DC traction substation can exchange energy from a substation to other substations of the route; at present, a remote and complex possibility from technical and economic points of view). In this way, RPSs need some improvement in their use and management. The next index, EStB (Energy Savings through Braking), evaluates the amount of energy generated during braking of a railway unit that can be used for other units in the same section of the overhead line of the route (i.e., at the same catenary/electrical section or substations) during a day: gen_braking 100. (9) Finally, the potential (available theoretically) generation of energy through braking (kWh) with respect to traction demand (kWh) in a section of RPS (or modified KPI5), MKPI5 is also considered: Several scenarios have been considered for simulation purposes in this subsection: 1. Railway traffic in the route fulfills its timetable: This is theoretically possible, but difficult to accomplish in 100% of trains. In this case, trains usually use resistive braking to avoid incertitude and the possibility of an increase of voltage in catenary.

2.
Railway traffic present delays in some passenger and freight services (a delay from 1 to 5 min is considered with a uniform distribution) and average values of demand have been considered with the aggregation methodology described in Reference [56]. Trains use resistive braking as the main braking system. This case represents an average scenario from the point of view of the demand for planning and operation purposes.

3.
Railway traffic in the route fulfills its timetable, and electric trains use regenerative braking if the voltage remains around normal values.

4.
Railway traffic present delays in some passenger and freight services (a delay from 1 to 5 min is considered again, and average values have been considered) and vehicles deploy regenerative braking: Average values of demand and generation have been considered. In this case, some delay can improve energy recovery indices.

5.
Hybrid units (S-730) are able to change from conventional catenary supply to diesel-electric generator, in limited sections of the electrified route, to acts as a responsive load/generator (DER resource) for achieving an improved flexibility of demand and supply. 6.
Wayside storage: Substations have a partial storage system to limit power in peak periods and reduce LFs.
The load factor of the aggregated demand in Figure 22a has a very low value in all cases being considered (9.7 to 18.7). Notice that time windows (usually some seconds to one minute, due to dynamic train behavior) for the evaluation of energy and power needs from acceleration and braking are shorter than the time windows considered in Public Power Systems to compute some indices and record demand data (i.e., data aggregation acts as a high-pass filter). It should be noted that some peaks appearing on the load curve are in phase with S-730 demand. Merely, the change of mode of S-730 (from electrical mode to diesel) or the use of proposed storage of S-730 unit, during small periods, can raise the load factor up to 0.19 (i.e., +38%, or produce more than 2500 kW of flexibility during peak load periods). In the case of regenerative braking is considered, from 60% to 81% of generation, due to this possibility, is unable to be used by other trains because times do not match even in the case that eight traction substations are considered interconnected and reversible. This fact significantly limits the possibility to deploy regenerative braking based only on changes in the timetable.
It is also interesting to consider a more real possibility: The demand in a specific DC substation without any possibility to inject power into other feeders of the RPS. To resume this scenario, and for simplicity, only two substations with the worst pattern have been considered: Rio Záncara (km 148 to 171) and Chinchilla (km 279 to 295). Figure 23 shows that only a small percentage of available energy from regenerative braking can be potentially used by other trains, or in other works: An interesting potential for storage arises from these figures and explains the need for some wayside storage in traction substations. Tables 19 and 20 show that the improvement of LFs and the potential generation through regenerative braking are lost, including the possibility of the use of hybrid S-730 units as DER resource (i.e., the change from electric to diesel operation). For these cases, in where OESS does not improve the efficiency of the system (only a small 1.83%), the solution is a small wayside storage system (in the range 20-30 kWh) that significantly improves efficiency and load factor of both substations considered in the simulation (Tables 19 and 20).  Tables 19 and 20 show that the improvement of LFs and the potential generation through regenerative braking are lost, including the possibility of the use of hybrid S-730 units as DER resource (i.e., the change from electric to diesel operation). For these cases, in where OESS does not improve the efficiency of the system (only a small 1.83%), the solution is a small wayside storage system (in the range 20-30 kWh) that significantly improves efficiency and load factor of both substations considered in the simulation (Tables 19 and 20).

Synchronized Timetables and DR
Many railway administrations in Europe (Germany, France, Switzerland, etc.) use the so-called synchronized timetables (reports dealing with medium-term scenarios foresee a higher level of synchronization in several countries, e.g., Germany with 30 min interval for IC devices by 2030-2040 [6]). These timetables make easier the use of transport because the customer easily remembers the start of its trains (i.e., trains leave for their destination 5, 7, 13, 25 or 33 min past every hour). A well-known example is the Swiss Railways (SBB , Table 21). SBB-CFF-FFS operates 9000 passenger trains per day on its network, and has a well-known prestige to ensure safe and timely railway operation (i.e., high punctuality ratios). Specifically, SBB-CFF is proud because there are trains every half hour that connect the major population areas (e.g., at 7 h 49 or 8 h 49, and 8 h 25 or 9 h 25, from Zurich to Luzern, Table 21). The trend is firm because railway development plans in the future (PRODES 2035) foresee train departures every 15 min from Zurich to major populations in the Zurich area. Unfortunately, this policy also has several drawbacks: Its load curve peaks daily a value around 500 MW that can change up to 300 MW during short term intervals (1-5 min, short-term changes in demand has been discussed in the previous paragraph). This power is needed to accelerate trains (the reader can revisit Section 3.1). Nevertheless, changes in Swiss Power System in the Zurich area, due to residential and commercial loads do not reach 35 MW in 15 min interval. To overcome this problem SBB is enrolled in a Demand Response research project in its loads, specifically to reduce train hotel load and heating of points (heating of trains from seconds to some minutes). The objective is to reduce peak load by 70 MW in 2023. The concern of this section is to demonstrate the potential available from the use of HVAC loads of trains as DR resource (demand flexibility, DSF). Moreover, the use of on board storage in hybrid trains jointly with DR could help to support changes in demand and opens the possibility for the management of railway load curves during periods of high rates of increase of demand. The use of pantographs in passenger or in power coaches is a well-known and proven concept in European Railways (including Germany, Switzerland, Netherlands or Spain, Figure 24). The main concept proposed is that these coaches can include partial storage to be used for hotel/power loads, or also to be used as a buffer for static (Figure 24a) or dynamic (Figure 24b) storage to support high rates of demand growth, while other trains leave the terminal station. A scenario for the use of these coaches with the management of HVAC load has been simulated in the terminal station of the route Alcazar-Chinchilla: Madrid-Chamartin. Madrid-Chamartin has passenger traffic estimated in 6,144,000 passenger/year; 53 high-speed trains/day, and 39 Intercity and Regional Trains/day in 2018 (i.e., some of the trains being considered in the route Alcazar-Chinchilla in previous sections), excluding suburban services. It is usual, in terminal stations in Spain, that trains are placed on the platforms 20-30 min before they leave the station to perform check-in of passengers. In this case, trains require power for "hotel loads" and are able to store or generate power to or from storage devices. Table 22 shows a timetable for Madrid-Chamartin is the time interval from 18 h to 19 h. It is usual, in terminal stations in Spain, that trains are placed on the platforms 20-30 min before they leave the station to perform check-in of passengers. In this case, trains require power for "hotel loads" and are able to store or generate power to or from storage devices. Table 22 shows a timetable for Madrid-Chamartin is the time interval from 18 h to 19 h. For simulation purposes, "Altaria" and "Alvia" trains to Cartagena and Gijon are supposed to be ready in platforms at 18 h00 (train 11761) and 18 h05 (train 00226). Regional MD service from Madrid to Albacete leaves at 18 h18. It is supposed that some of the trains (ALVIA, similar to HDEMU S-730, but without diesel generation) has a hybrid "last-mile" dynamic storage (results and sizing in Section 3.3) with 8.3 kWh in supercapacitors and 40 kWh in Li-ion batteries (400 V a 100 Ah). Altaria only has a "static" storage to support train hotel loads (battery in the power coach rechargeable through a static pantograph or the dynamic braking of some locomotive or EMU). Hotel load of Altaria is simulated for each of its nine coaches, and the overall train demand (hotel load) with the models proposed in Section 2.4 and parameters previously presented in Table 5, is depicted in Figure 25. An outdoor winter temperature ranging from 2 to 9 • C is used (input X ext in Figure 5a); 2.5 for COP (coefficient of performance of HVAC devices used in the coaches, appliance model in Figure 5a), 50% of occupancy (at Madrid terminal station, considering average rates for occupancy in Reference [70],) and a rate of ventilation of 20 m 3 /passenger-hour. Figure 25 represents the results.  To cover all the "hotel loads", the proposed battery ESS of Altaria (into the service/power coach) is sized at 100Ah@400 V (40 kWh) to cover HVAC demand (average load around 30 kWh, Figure 26a) and other internal loads for 30-40 min without the need to use its internal generator or the external supply from 3 kV DC catenary or through the locomotive. The HVAC "hotel load" of Altaria is a resource to reduce the load from substations of the terminal station. To evaluate the To cover all the "hotel loads", the proposed battery ESS of Altaria (into the service/power coach) is sized at 100Ah@400 V (40 kWh) to cover HVAC demand (average load around 30 kWh, Figure 26a) and other internal loads for 30-40 min without the need to use its internal generator or the external supply from 3 kV DC catenary or through the locomotive. The HVAC "hotel load" of Altaria is a resource to reduce the load from substations of the terminal station. To evaluate the potential of this load, it has been taking into account that Altaria has used the braking energy of its locomotive or catenary in the shed to preheat its coaches to 23 • C. When the unit arrives at the terminal, HVAC loads can be switched-off (Figure 26a), and this DR policy reduces demand by 15-30 kW without significantly reduce the comfort of passengers (i.e., indoor temperature Xi, Figure 26b). Figure 25. Simulation of HVAC loads for Altaria coaches (a) Aggregated electricity demand; (b) state variables (indoor and vehicle temperature, i.e., temperatures Xi and Xv in Figure 5).
To cover all the "hotel loads", the proposed battery ESS of Altaria (into the service/power coach) is sized at 100Ah@400 V (40 kWh) to cover HVAC demand (average load around 30 kWh, Figure 26a) and other internal loads for 30-40 min without the need to use its internal generator or the external supply from 3 kV DC catenary or through the locomotive. The HVAC "hotel load" of Altaria is a resource to reduce the load from substations of the terminal station. To evaluate the potential of this load, it has been taking into account that Altaria has used the braking energy of its locomotive or catenary in the shed to preheat its coaches to 23 °C. When the unit arrives at the terminal, HVAC loads can be switched-off (Figure 26a), and this DR policy reduces demand by 15-30 kW without significantly reduce the comfort of passengers (i.e., indoor temperature Xi, Figure  26b). Temperature (ºC)  Figure 5).
The simulation of the start of MD-Regional is presented in Figure 27a. The route outside the terminal is done at a reduced speed (45-50 km/h) and requires a 1.5 MW of peak power during 40 s and then a flat demand around 65-70 kW. This power is basically obtained from two sources: The Altaria OESS Supercapacitor (to achieve the initial acceleration, with energy requirements 8.3 kWh) and when the steady state is reached (time from 40 to 150 s) with the two batteries of Altaria and Alvia, and the help of DR "generation", due to HVAC control policies. Figure 27b&c show the results. The model for the equivalent supercapacitor was discussed in Section 2.5.  Figure 5).
The simulation of the start of MD-Regional is presented in Figure 27a. The route outside the terminal is done at a reduced speed (45-50 km/h) and requires a 1.5 MW of peak power during 40 s and then a flat demand around 65-70 kW. This power is basically obtained from two sources: The Altaria OESS Supercapacitor (to achieve the initial acceleration, with energy requirements 8.3 kWh) and when the steady state is reached (time from 40 to 150 s) with the two batteries of Altaria and Alvia, and the help of DR "generation", due to HVAC control policies. Figure 27b,c show the results. The model for the equivalent supercapacitor was discussed in Section 2.5.
Moreover, these policies that combine EES and DR benefits the possibilities to recover the energy deployed during regenerative braking. According to Table 22, if both technologies were deployed, there are some trains with similar characteristics that arrive at terminal station and that would use partially the regenerative braking in the substation area (Alvia 11781, Altaria 11929) and that could support the acceleration of MD regional service, contribute to refill of storage systems or control demand for auxiliary loads. Finally, it should be taken into account that terminal stations have conventional and flexible loads (e.g., heating and cooling that can be used to reduce the impact of synchronization in the Public Power Systems), and also commuter services that are not considered in Table 22, but which deploy their activity in the same area, increasing the potential resources for contributing to the reduction of demand peaks. Moreover, these policies that combine EES and DR benefits the possibilities to recover the energy deployed during regenerative braking. According to Table 22, if both technologies were deployed, there are some trains with similar characteristics that arrive at terminal station and that would use partially the regenerative braking in the substation area (Alvia 11781, Altaria 11929) and that could support the acceleration of MD regional service, contribute to refill of storage systems or control demand for auxiliary loads. Finally, it should be taken into account that terminal stations have conventional and flexible loads (e.g., heating and cooling that can be used to reduce the impact of synchronization in the Public Power Systems), and also commuter services that are not considered in Table 22, but which deploy their activity in the same area, increasing the potential resources for contributing to the reduction of demand peaks.

Conclusions
This paper presents alternative solutions for increasing the energy efficiency of diesel-electric and hybrid trains without impairing on its dynamic characteristics. These solutions (on board and off board storage) enhance the lifecycle of these units and the performance of energy infrastructures on low and medium traffic routes. To reach these goals, several different alternatives have been evaluated: Store the energy of the diesel dynamic braking systems; reduce the diesel motor size, install wayside EES or control of trains as DSF and DER resources (specifically, the change in traction mode from diesel to electric or vice-versa, or the change in the service or climate comfort parameters of trains which affects around 20-30% of overall demand) in the same way that Public Power Systems does. For each solution, an energy storage system must be added with the appropriate capacity, or a portfolio of DER policies has been identified and simulated. Train functional models (traction and hotel loads) and DER models have been linked and aggregated to

Conclusions
This paper presents alternative solutions for increasing the energy efficiency of diesel-electric and hybrid trains without impairing on its dynamic characteristics. These solutions (on board and off board storage) enhance the lifecycle of these units and the performance of energy infrastructures on low and medium traffic routes. To reach these goals, several different alternatives have been evaluated: Store the energy of the diesel dynamic braking systems; reduce the diesel motor size, install wayside EES or control of trains as DSF and DER resources (specifically, the change in traction mode from diesel to electric or vice-versa, or the change in the service or climate comfort parameters of trains which affects around 20-30% of overall demand) in the same way that Public Power Systems does. For each solution, an energy storage system must be added with the appropriate capacity, or a portfolio of DER policies has been identified and simulated. Train functional models (traction and hotel loads) and DER models have been linked and aggregated to improve the usefulness of simulations. Super-capacitors and different technologies of batteries have been chosen for this purpose. Dynamic braking energy can, therefore, be recuperated, and energy efficiency improved both in vehicles and in the Railway Power System. Energy savings by 10-20% are reported and nearby 70% improvement in Load Factor and peak shavings (an important concern for Public Power Systems and its future challenges). Moreover, the stochastic nature of some events in railways, for example, time delays with respect to the timetable, has been evaluated. These delays can be a positive or negative effect on energy efficiency through regenerative braking (and also, their impact on timetable performance). Presented simulations are valid for the itinerary chosen in the example, but the same method can be applied through the software to any other railway line powered by other vehicles.
In future developments of this work, detailed physical and thermal models of batteries, supercapacitors behavior, and improved models for "hotel loads" will be developed and validated in order to improve the integration of the ESS in the railway system, especially in on board solutions, in which space, weight and thermal requirements are vital to avoid affecting either the performance of trains or the customer comfort. Finally, the potential contribution and support of the reported flexibility of railway systems, which have been modelled in the paper, can help in the effective balance of RES unpredictability (volatility) in the eco-energy scenario that arises in the 2030-2050 horizon. This possibility will be of interest and consideration.

EStB
Energy Supplied through braking KPI i Key Performance Indicators MKPI5 Key Performance Indicator (RPS)