Journal TransEnergy – a tool for energy storage optimization, peak power and energy consumption reduction in DC electric railway systems

Electriied railways are large users of electrical power at a time when grid supply conversion to renewable energy production is making supply to the grid less predictable and environmental concerns demand reduction in energy use. These developments make it desirable to control and reduce both total energy usage and peak power demand of railway systems. While AC systems have a well-developed ability to regenerate power to the grid, high transmission losses in DC systems make local storage of energy a more attractive option. A model has been created integrating a versatile and conigurable database-driven generic rail network model with a power supply network representative of DC electric railways. The work is intended as a high-level design tool to explore system wide behaviors prior to detailed inal design modelling of speciic technologies. To va-lidate our method, predictions of train motion and power demand have been compared with data from the Merseyrail network in the UK. Simulating a full day of traic for the Wirral Line of Merseyrail (237 services on two routes) with the assumption of energy storage being available at each electrical sub-station revealed the dependence of storage efectiveness on the timetable and traic density at speciic locations. The model is combined with a genetic algorithm to optimise system parameters (storage size, charge/discharge power limits, timetable, train driving style/trajectory) and also enables identiication of cases in which poorly speciied storage technology would have little impact on peak power and energy consumption.


Introduction
Railway electricity demand in systems internationally is rising because of (a) electriication of diesel services [1], (b) longer and more frequent trains in response to increased passenger demand, and (c) the higher power demands of modern rolling stock (improved acceleration and interior comfort, e.g. air conditioning) (Smulders, 2005). Simultaneously with these demand-side changes, power supply networks are also changing. An increased contribution from renewable sources brings environmental beneits but their input to the supply grid is less predictable than previously. Together these developments make it desirable to control and reduce both total energy usage and peak power demand. In addition to the wider grid beneits of reducing peak power demand, existing power supply infrastructure may be utilised to serve higher traic densities if localised power demand spikes can be avoided and energy is delivered from the supply grid at a more uniform rate (Fig. 1).
For AC power supplies, regeneration to the grid is a mature technology so, while energy storage could be applied to reduce power peaks, there is less scope for reduction of overall energy consumption. For DC networks regeneration to the grid remains problematic. While AC supplies typically operate at~25 kV, DC networks commonly operate at 650-1500 V so eiciency in transmission of regenerated DC power is low. The focus here is therefore on energy storage in DCpowered rail networks that are common worldwide, either in 3rd or 4th rail or overhead catenary systems. While models exist combining power and train movement [1][2][3][4][5] the focus here is on integrating storage into the system and enabling quantiication and optimization of its utilization. The paper describes development of a versatile and conigurable multi-train simulator combined with a power network model. These are validated against data from the Wirral Line of Merseyrail in the UK, and an example of energy storage for this network is presented highlighting important design issues for energy storage systems.
The origin of this research was a desire to take a holistic view of Transport Energy use, particularly as electric car use rises with many countries having targets for cessation of fossil-fuel vehicle sales [6]. As the proportion of electric cars in railway station car parks rises it is expected there will be a demand for car charging, but also an opportunity presented by the energy storage pool these cars will together represent [7]. Although agnostic to the exact nature of the energy storage, this paper therefore describes a model considering energy storage in an electriied rail network which may in future be implemented through exchange of energy with parked road vehicles [8], bringing opportunities for peak power bufering for the wider electrical supply network.
The focus on enabling system optimization steers the research to provide both models and methods that permit the user to arrive quickly at a good solution. The task at hand contains highly non-linear dynamics, discontinuities and logical elements, has a complex cost (objective) function and constraint set and possesses a large number of free parameters afecting overall outcome. Such problems are ill suited to conventional mathematical programming methods such as linear or quadratic programming or mixed integer / linear programming, whose assumptions are often violated in practical problems. Instead, heuristic search (a genetic algorithm here) can provide a way forward, swapping the nice mathematical framework and optimality guarantees of mathematical programming for a directed search algorithm that requires a large number, perhaps many thousands, of evaluations of the task, in this case computer simulations of train movements and power transfer across a rail network. A similar approach has been taken for optimization of rail networks for quality of passenger experience [9]. For such an approach to be feasible and robust [10], the evaluation of each trial must be fast, necessitating simple, idealised models that capture the main characteristics of the system. Once an acceptably good solution is arrived at through heuristic search, then a model of higher veracity can be used to determine actual performance and to ine-tune the inal design. In short, the simpliied model and heuristic search provides a good estimate/design without pre-empting the outcome by embedding existing component behaviors. Indeed, it can help deine required component behavior, or the targets of research to develop components able to achieve that behavior such as the converter design research of Zhang et al. [11]. Such a methodology allows the user to explore a large number of alternatives quickly before spending time and energy on the inal design. This work focuses on providing a plausible model for this "quick & dirty" phase of this process.

Methodology
The TransEnergy rail and power network modelling tool has been developed using the PostgreSQL open source database [12] originally developed at University of California, Berkeley, and ofering a good balance of performance and memory utilization [13,14]. The calculations to simulate a railway and its power network are not of themselves complex, for example, train movement is dependent on available tractive or braking force, train resistance (all functions of velocity), applied control, and also track gradient (a function of position). Using Newton's second law, the train motion trajectory can be predicted by discretizing the traverse of the network in either time or distance steps [15,4]. Application of train control (representing the driver's behavior) is a function of position and velocity, aiming to achieve a particular timetable. For DC powered systems, the trains can be represented as moving resistive loads on the railway electrical power network, with network losses based on transmission distances and internal properties of the electrical supply sub-stations [16]. Considering multiple trains on the network increases complexity in that the supply voltage to each train depends on current drawn and consequent voltage drop for others within the same electrical section.
The PostgreSQL data store (Fig. 2) holds a representation of the trains, railway and power network infrastructure topology, and a timetable for train movements across a day. The PL/pgSQL procedural language supported by PostgreSQL enables a mechanical model of train movement, and an electrical model in which trains represent moving loads (or regeneration sources) on the power network, to be stored as functions inside the database server. This provides rapid computation with direct access to data, avoiding external data transfer as the model simulates network operation on a time-discretised basis. Optimization is enabled using the ParadisEO C++ evolutionary computation library [17], connecting to the database using C++ client connector library. These areas and some results are explored in the following sections.

Rail network topology and train movement model
The rail network topology is deined by nodes (stations, junctions, electrical sub-stations, neutral sections) connected by lines with properties of length, end nodes, line-speed limit and gradient, the latter two being functions of position. Train routes are deined by the sequence of lines over which a train will run, including the direction, target traverse time for each line, nodes at which to stop, minimum dwell time and planned departure time relative to the start of the route for each stop. Trains are deined with the properties in Table 1 and along with the train routes and timetable are fully conigurable not hard coded. Train control is applied with fully variable traction or braking between zero and the full level available for their current speed. Trains may coast if a control level of zero is set for both braking and traction, but no automatic speed holding mode is implemented, although this could be accommodated if needed, for example to represent a leet with this capability. Fig. 3 shows the network for which the case-study results below  have been generated. A timetable deines which train runs on which route, and the time each train will depart the irst station on its route. Two frames of reference are considered: (i) Infrastructure: gradients and line speeds are deined for each line from the origin node. (ii) Route: taking the origin of a route the train will traverse and considering all the infrastructure over which it will run. A route frame of reference is inherently more suited to simulation of a journey across a range of infrastructure, and translation of infrastructure properties to the route frame of reference is conducted once at the start of each simulation to reduce computational costs at each step in the movement of the trains. To further reduce computational cost, pre-calculation is performed of braking distances for each rolling stock type on the gradients present in the system, and of maximum speeds allowable on approach to line-speed reductions. This is performed once per simulation and values are stored for lookup from the SQL database. The formulation can consider junctions and cases in which a single line is traversed by multiple diferent service routes.
In previous work, for example by Goodwin et al. [15], train trajectory calculations were conducted on the basis of distance steps, this being the logical choice for the deinition of points during the journey at which control changes (application of power or brakes) can be made. While that is satisfactory when considering total energy used across multiple trains each of which may be simulated independently, this is not appropriate for a model considering the power network in which all trains on an electrical section must be simulated synchronously so that power drawn can be summed across the network at each instant. A timediscretised model was therefore used (with a 2-second step in the casestudy), predicting forward motion by solution of Newton's equations at each time-step for each train. Traction voltage available to each train was taken from the previous time-step, and new voltages across the network calculated after the movement of all the trains in service (see Fig. 4). Eq. (1) shows Newton's equation under traction, in which F grad is the force on the train due to the gradient of the line, considered at the front of the train (variation of gradient throughout the length of the train is relevant to long and heavy freight trains and could be accommodated if required, but the short passenger trains of the case-study can be considered at a point). Positive direction was deined as the direction of train forward motion, with upward gradients deined as positive in this direction. The component of train weight parallel to the track on a positive slope acts counter to the train motion, i.e. slows the train, hence F grad will have a negative value on an upward slope and positive value on a downward slope. Eq. (2) takes a similar format for braking, where c B represents the proportion of available brake force being applied.
To enable the optimization described in Section 2.4 the ability to store, modify and replay sequences of train control is included. Although the simulation is time based the control points for later replay (i.e. points at which traction or brake utilization is set) are primarily location dependent and are stored by location rather than time elapsed from journey start. This is because constraints on train operation (line speed limits, stations at which to stop) occur at speciic locations not speciic times during the journey. The translation between the time and location frame of reference imposes some minor uncertainty in replay of control sequences, equal to the distance covered in one timestep, here taken as 2 s. Uncertainty can be reduced by using a smaller timestep, but exploration with the model has shown that 2 s is a good compromise between computational overhead and locational accuracy. Train movement is controlled on a moving block basis, similar to that planned for European Train Control System (ETCS) Level 3 [18,19]. A headway is protected ahead of the train based on the braking distance for its current speed and location.

Electrical power network model
The voltages at which DC rail systems typically operate imply high current lows and consequently short electrical sections are used to reduce transmission losses. For the section of Merseyrail system in the case-study there are 8 sub-stations feeding just over 20 km of doubletrack railway. Each track section may be "single-end", fed by a single sub-station (typically at the outer ends of the network), or "double-end" fed by two substations. Sub-stations are not necessarily coincident with passenger stations, and are modelled as neutral section locations with each side of the neutral section being fed electrically independently [20]. Interactions between separate electrical sections are therefore not modelled. Active regulation of the system voltage was not present on the case study system and is also therefore excluded from the model,  although the versatile nature of the simulation means this could be accommodated in future. The technology of the substations is described by Tomlinson [21], uses 12-pulse rectiication and is designed for ± 6% AC supply variation, although normally this is maintained to much smaller variation. Regulation of the output voltage is 5%, this being due primarily to reactance of the transformer components. In a simple DC source and resistance network, sub-stations such as those described by Tomlinson [21] are represented using an open-circuit voltage and internal resistance [22,23]. Trains drawing power are represented as resistances with their location determining the supply transmission length. Conducting and return rails have a resistance per metre, giving an in-circuit resistance and consequent energy loss that varies with train position. For simplicity these resistances are considered together in the model, with a combined value of 40.61 × 10 −3 Ωkm −1 used for the case-study in Section 3 and 4 [24]. During regeneration trains behave as voltage sources with internal resistance. It is assumed that parallel tracks (with trains running in opposite directions) are electrically bonded so an electrical section can be represented schematically as in Fig. 5 in which four trains are present, this being the maximum number of trains envisaged on a single electrical section at one time. The electrical section network was pre-solved algebraically using Kirchhof's laws Eq. (3)-(5) with application to speciic cases made by efectively "switching out" unneeded trains or sub-stations by setting their internal resistances to a high value. Validation was undertaken against the Qucs open-source circuit simulator [25].
The electrical and mechanical models are linked on the basis of power (P) deined in terms of traction force at a given velocity (v) and transmission energy conversion eiciency (η), which are used with Eqs. (6) and 7 to calculate an equivalent resistance presented to the electrical supply network. The supply voltage available at the train is V line , the auxiliary systems ("hotel") power is P hotel , and the traction force relationship with velocity is given in Table 1.
Regeneration of power to the network during braking is enabled when both the power captured from braking (P brake ) exceeds the hotel power required by the train, and when the train speed is above 2.68 m/ s. Below this speed regeneration is inefective and mechanical braking with no energy recovery takes over. Braking power is dependent on the brake force (Table 1), velocity and transmission energy conversion eficiency (here assumed equal to the case for traction). The voltage source associated with the train (Fig. 5) is conigurable to accommodate the range which may exist on DC systems [26] and is set to 800 V in the current work (V regen ), and the equivalent resistance of the train (Ω train_regen ) is determined by Eqs. (8) and 9.
The electrical model is used to solve each electrical section of the overall network at the end of each time step, with updated locations of trains mapped on to the electrical sections so that current drawn may be calculated and line voltages found for use in the next time-step. This is shown schematically in Fig. 4.

Energy storage model
Energy storage is modelled as being located in sub-stations on the grid side of the sub-station internal resistance, shown schematically in Fig. 5. In the current implementation it is assumed that the grid capacity for supply and regenerated power is unlimited, although use in excess of a limit can be penalised, i.e. this is a soft constraint in the optimisation. Energy storage is deined by the parameters in Table 2 that describe energy stored and not a speciic storage or converter technology (battery, lywheel, super-capacitor, etc.). The approach is agonistic to the underlying technologies that are described in, for example, Li et al. [27], and Cornic [28], as these are more relevant to high veracity inal design modelling, not to the heuristic search whole network modelling of interest here.
The implicit assumption is that if energy is stored it can be provided at the voltage needed to feed the train supply system. The eiciency of the storage (ratio of returned energy to stored energy) is considered during the charging stage, meaning less energy is stored than enters the storage, but whatever is stored is fully available for use.
To be efective energy storage systems should aim to have energy available to supply trains, but also retain free capacity to accommodate energy from braking trains, i.e. they should not be allowed to become fully charged or discharged. The use of stored energy is subject to management, shown schematically in Fig. 5 by the 'Control' boxes linking the battery and grid energy supplies to the rail system. For example stored energy may be used in preference to drawing energy from the grid (an energy-use reduction strategy), or it may be held in reserve and used only to remove very high peaks in demand (peakpower reduction strategy). The number of charge cycles and consequent life of the storage can also be managed, with storage management an area of research for deployment of the TransEnergy model (). In the case-study simulations (Section 4) stored energy is deployed for energy use reduction, and state of charge is managed using upper and lower limits beyond which trickle (dis)charging to grid is enabled provided that grid power low is low. These limits are conigurable but have not yet been subject to optimization.

Evolutionary computing optimization framework
Optimization of realistic and complex dynamical systems is challenging. While the formal approaches of mathematical programming are highly advanced they frequently rely on assumptions that do not conform to the objectives of the engineer, leading to solutions that may not address the original engineering concerns. This has stimulated the growth of heuristic search algorithms that permit the speciication of mathematically diicult but physically meaningful problems. It is well known that there is no such algorithm that is universally best for any given problem in the absence of substantial prior knowledge about its solution [29] so an evolutionary optimization algorithm is chosen here. Broadly speaking, the method is based upon the principles of natural selection and is a form of directed search, whereby a population of potential solutions is generated by choosing (within realistic bounds) a set of parameters for each member. A simulation of each member is then run and its performance assessed by whatever measure is appropriate, allowing for complex, non-linear dynamical processes and mathematically inconvenient (e.g. non-smooth, multi-modal) objective functions. A strategy for selecting and combining the parameters of the members of the current population then deines the next generation and the process is repeated until a satisfactory performance is reached. In this sense, heuristic methods reach acceptable, rather than globally optimal, solutions. The speciic implementation used here, a so-called (μ+λ) evolutionary algorithm, is implemented using the open-source genetic algorithm (GA) library ParadiseEO described by Humeau et al. [17]. For the GA the population represents a variable of interest e.g. driver proile. "Fitness" for selection to pass into the next generation is evaluated through a cost function that captures the objectives and the constraints of interest (see   Eq. (10)). Algorithm 1 outlines the evolutionary optimization process in general.
In Step 1, a population P comprising μ individuals, = … X j µ 1, , j is generated within the feasibility region. In Step 2, random selection is employed to select "parents" to apply genetic operators. Uniform mutation is applied in Step 3 where a set of genes is chosen and a random mutation is applied to each chosen gene according the mutation rate parameters. In Step 4, the cost function invokes the simulation with the driver proile and storage parameters assigned to individual, X j , as the input and retrieves energy consumption, speed limit violations, delays and power limit exceedances as the outputs at the end of the simulation. Fitness for the individual is evaluated based on Eq. (10). In Step 5, we use the ittest μ individuals as survivors. Table 3 provides a list of GA parameters and the values used in our initial experiments.
What is of crucial importance in evolutionary methods is that evaluation of each simulation can be achieved quickly because a large number of experiments must be carried out at each generation [9]. The TransEnergy model has speciically been designed to meet this requirement, through the storage and reply of train control strategies, allowing the strategies themselves, the parameters of the network, or the parameters of the train to be optimised. A feasible network control strategy is required to initialise the optimization with the quality of repeated runs judged through the value of a cost function such as the weighted sum across all trains shown conceptually in Eq. (10) in which n, m, p and q are relative weightings. The function could be extended to include energy storage provision and/or maintenance costs for a more holistic optimization.
In a previous work by Goodwin et al. [15] initialization of train trajectories was performed using random control strategies (locations of brake/traction control application) with viable trajectories selected to proceed further in the optimization process. This led to signiicant wasted computation as many non-viable trajectories were generated. To overcome this, an initialization process with "lat out" running of trains using full acceleration and braking was developed to calculate an initial control sequence representing a viable but probably sub-optimal operating strategy for the network. Application of the evolutionary computing process is demonstrated for trajectory optimization in Fig. 6 in which an energy saving of around 15% is achieved relative to this latout initialization. The data plotted is extracted for a single train of three active on the network during the optimization for movement non-stop from Birkenhead North to Leasowe.

Train movement and electricity consumption validation
Validation was undertaken using data for the Merseyrail Wirral line in the UK. Gradients and line speeds were available from Network Rail [31]. Data were available from previous studies [24,20] for both onboard and sub-station energy use. To supplement these data train location monitoring was undertaken using GPS tracking to provide a record of train trajectories against which the predictions of the simulator could be validated. Fig. 7 shows predicted train movement between Birkenhead Park and West Kirby with seven intermediate stops, simulated on the basis of lat-out running, alongside GPS train trajectory data collected for the same route. The origin of movement is taken at James Street station, but underground sections for which GPS data were unavailable are excluded from the plot. It can be seen that there is very close agreement in the trajectories, particularly at the start of each stage of the journey. As speed increases there is divergence caused by the simulation of latout running whereas drivers in reality reduce speed or use coasting. A consequence of this behavior is that the lat-out running initialization case leads to trains predicted to arrive at their stops early with extended dwell times, but this is corrected during the optimization process. Comparison between modelled and GPS tracked trains would not be Table 3 Genetic algorithm (GA) parameters.

GA parameter Value
Parent population size 10 Ofspring population size 10 Adaptive mutation rate Starting rate of n/10 genes to mutate where n is the number of decision variables. After every 100 generations, its halved to support algorithm convergence. Mutation quantity 1/17 (For each chosen gene, a proportion of +−1/17th of its value is added to itself). This number is chosen after trial runs. Number of generations 1000 Fitness function (Eq. (10)) parameters m = 1, n = 1, p = 100, q = 10 Fig. 6. Trajectory for one of three trains active on the network illustrating optimization saving around 15% energy relative to lat-out running, travelling from Birkenhead North to Leasowe. expected to give complete agreement, but has some very positive indings. First, the predictions are very good in the acceleration phase of each journey stage, for which the assumption of using maximum acceleration is reasonable. Second, the inter-station times are predicted to be lower than timetabled, showing that by adopting a more realistic driving style real behavior can be more closely approximated. The lat out driving simulation is successful in simulating an upper bound on behavior within which optimization can identify better driving styles. Considering energy use validation it is important for two reasons to replicate train motion and not just the stopping pattern: (i) diferent trajectories lead to diferent energy consumption; (ii) diferent journey times lead to diferent auxiliary energy power consumption. These behaviors interact so a shorter journey time may use more traction energy but have a lower overall energy consumption. A simulation was conducted to match train trajectory observed [32] for the journey from Birkenhead North depot running to Hoylake. Fig. 8 shows the modelled energy consumption and the measured data (the position origin is taken close to the Bidston East Junction while energy monitoring commenced prior to this, hence is non-zero at the position origin). For the measured data, energy consumption was monitored in one of the two power cars of the train and it is assumed here this can be doubled to represent the whole train, although separate monitoring shows that consumption can difer by approximately 2% between the cars [32]. With good agreement achieved between modelled and actual train speed proile, total energy consumption is predicted to within 3.5% of that measured. Given the simplicity of the traction system model and the unknown driver control strategy that results in the observed speed proile, this represents excellent agreement. To give context alternative models for several railways worldwide achieved prediction within 4.3% of real system measurements [33], in the range +1.87% to −2.31% relative to transit database entries [34], and to within 2.42% [35]. In making this comparison only energy use and not regeneration to the network is considered because the class 507/508 trains running on this route do not have regeneration capability.
Having shown that the model can replicate energy use monitored onboard, Fig. 9 shows results for energy monitored at an electrical substation. The data is for trains moving from West Kirby to Hoylake with a single train running, this section being electrically fed from Hoylake by a single sub-station. Current was monitored at the sub-station [20] without parallel collection of data on the exact train locations, speeds or driving style so two cases are simulated: (i) "lat out" driving, and (ii) a train using a speed proile matched to a GPS trace of real train movement. The diference between ive measured current traces (Fig. 9) indicates the variation of driving style and trajectory that exists on the real system. Comparing the predicted current drawn with the measured data it can be seen that there is good similarity on the form of the curves, particularly when modelling the real driving trajectory. The lat-out running case incurs a higher and earlier peak in current demand than the more realistic speed proile, as would be expected for a case that is used to initialise the optimization process rather than to represent real world driving. The fall away in current demand with time is well represented by the modelled real-world driving trajectory, and the model is successful at predicting sub-station demand even though it is based on simple representations of the track and train systems. Table 4 compares journey times, average current and total electrical charge delivered (the product of current and time) across eight measured journeys and the two modelled cases. This shows that lat-out running is predicted to have average current just over 18% higher and charge transferred of 11% higher than the maximum of these quantities observed in the experimental data. Interestingly the measured journeys included one that is 10 s faster than the modelled lat-out running case, showing that the real train slightly outpaces its computer representation. Modelling a GPS-derived train trajectory brings the predicted quantities within the range of those measured on the network. This suggests that while the "lat-out" initialization case would represent 10-20% higher current and charge transfer than normal operation, after optimization to more realistic driving trajectories the electrical model is well positioned to capture real network electrical behavior.

Sensitivity study
To better understand the validation a sensitivity study was undertaken focused on the substation inner resistance, and the combined electrical resistance of the supply and return rails. These are diicult to measure directly and for the case study had to rely on data reported in literature about the studied system. Combinations of ± 20% change in substation inner resistance and ± 20% change in the combined supply and return rail resistance were considered. Predictions were made for the train and the substation energy supply for a single train movement between two stations on a single end fed electrical section, with the results summarised in Table 5.
For the energy drawn at the train the predictions show low Fig. 8. On-board energy consumption. Fig. 9. Substation current: measured (I-VIII) [20] and predicted for two different driving styles.  sensitivity to the system resistance parameters. This is because, for example, where additional resistance is present in the supply and return rails and the train experiences lower supply voltage (but still within its working capability) the energy drawn is maintained through higher current draw, which was not limited in the modelled system. At the substations there was slightly greater sensitivity of predicted energy consumption to changes in system resistances. As would be expected lowering system resistances reduces energy losses and hence reduces overall energy drawn from the grid, but the efect is mild, with around ± 3% change in energy drawn for the change of ± 20% in system resistances. The sensitivity study indicates that the agreement found between predicted and measured energy consumption at the train is insensitive to the system resistances, and it would actually be very diicult to speciically tune the system resistances to achieve better agreement in train energy consumption. The sensitivity is greater for substation energy consumption values, but this is the area in which validation data is subject to unknown driver behavior so it is not possible to exactly replicate conditions of the experimental data collection in any case.

Energy storage results and discussion
A full day of the Merseyrail Wirral line autumn 2018 timetable was simulated (237 services, both ways on two routes) to evaluate the impact of energy storage on total energy used and peaks in power demand. All cases were modelled using "lat out" driving conditions and it was assumed energy storage was available at every sub-station. Although the Class 507/508 trains on this line cannot regenerate power to the network they were taken to follow the regeneration behavior described in Section 2.2. Modelling train movements and power network for a full day timetable required just over 30 min on an Intel i7 laptop CPU.
The model is agnostic to the energy storage technology and this is simply referred to as "storage" in the discussion below, but to ensure realistic capacity and charge rates ( Table 2) these were based on battery storage typical of grid scale application [36]. Batteries may be described by their "C" rate, i.e. the discharge rate they can support relative to their maximum capacity, deined such that a 1C rate means that the full capacity will be discharged in 1 h Diferent battery technology can support particular C rates but a rate around 1 is common, and this was selected as the maximum charge and discharge rate. Trickle charging or discharging of batteries aiming to prevent them becoming fully charged or discharged was at 0.1C. Three sizes of energy store were considered (Table 2) and in each case identically sized stores were placed at every sub-station. A baseline case, without storage present, was also run. Fig. 10 shows typical behavior of a sub-station with energy storage during the passage of a train through the supplied electrical section. Prior to the train beginning to move (time=0) the energy store is at 50% capacity. Total demand from the substation (dotted line) rises as the train moves into the considered electrical section (at around 60 s) and energy is delivered from storage (dashed line). Stored energy falls (thick solid line) but the storage reaches its discharge rate limit (dashed line becomes horizontal around 100 s) and the grid (thin solid line) supplies requirements in excess of this. A similar process happens during regeneration as the train brakes (160-200 s) where the charging rate limit of the storage means excess power is returned to the grid, or may be lost in braking resistors. The presence of storage has successfully reduced peaks in power demand and absorbed some regenerated energy, however, it is clear that the charge/discharge rate limit is preventing it fully meeting train demand during acceleration or full capture of regenerated power. After the train has left the electrical section the substation demand falls to zero and the storage is returned to its original charge state by trickle charging from the external grid over the period 200-600 s. In this case there is no additional train demand during the period but, in busier areas of the network, further train demand may occur before this recharge process is complete. This would lead to depletion of the battery with the potential that it could no longer act to reduce peak demand on the network. Clearly, selecting charge rates and capacity to match the traic frequency in speciic areas of the network is crucial to achieving beneits from energy storage.

Full day timetable modelling
Following full timetable simulation it was found that storage was performing diferently in diferent substations depending on the traic density in the area. Results are extracted in Table 6 for two cases: (i) Substation 1 (Hoylake) at which all but the smallest battery studied was able to retain charge throughout the day, and (ii) substation 8 (Birkenhead North) at which all but the largest battery considered discharged during the day with a low mean charge held relative to capacity. The results are highly non-linear with variation in storage capacity due to charge/discharge rate limits and particularly the case of total discharge of storage. The primary diference between the locations is the traic density, with the Birkenhead North station supporting double the frequency of trains, prior to these separating on the individual lines to West Kirby or New Brighton. While depleted storage retains its ability to store regenerated electricity (i.e. bufering return of power to the grid) there is a great reduction in its ability to bufer power demand of trains, and peak power drawn from the grid is therefore only reduced for the largest battery considered.
The behaviors observed point to important areas for future exploration with the model. For example, the limit of 1C charge/  discharge rate, which is realistic for battery-based storage, greatly limits the proportion of regenerated power the storage can accommodate, and its ability to meet demands from accelerating trains. Similarly, the low "trickle charge" rate selected was insuicient to support the timetable at the busier substation while being much more satisfactory at the less busy Hoylake substation. Exploring the same timetable with storage capable of higher power transfers (e.g. representing super-capacitors or lywheels) would allow selection of appropriate technology for particular locations. Alternatively, it would be possible to explore the increase in train services possible relative to the current timetable for diferent storage technology at speciic locations. The energy storage coniguration explored here was conigured so that stored energy is always used irst, in preference to the grid connection. While this may appear useful for total energy use reduction it is important to consider that energy storage has an eiciency (here set to 95%). Results for substation 1 show that a small energy store is able to achieve some marginal net energy use reduction but, in the coniguration considered, is insuicient to reduce peak power drawn from the grid below the level without storage in the system. At substation 8, which supports a higher traic density, storage is more successful at reducing net energy consumption, which is reduced for all storage sizes relative to the case without storage. At both substations use of a larger store is more efective at reducing peak grid power drawn, but the ineiciency of the storage can lead to an increase in net energy use as more energy lows in and out of storage. These storage losses are real, but their size relative to the case without energy storage is partly an artefact of the system boundary for considering net energy consumption: the battery losses are considered, but transmission loss of regenerated energy back to the grid after it has left the railway substations is excluded since the model has no representation of the external supply grid. Such external losses, and also the location of losses relative to the energy metering boundary are factors to consider in the design of a storage system. Depending on supply constraints (and also the inancial charging regime for electricity) the same storage considered here may be more efectively used only for capping peaks in power demand. This may also enable a lower charge cycle count to accumulate over the day which is important for storage technology such as lithiumbased batteries. Such options for the management of storage technology, alongside the potential to optimise train trajectories and driving styles to work better with energy storage, are areas for future exploration with the developed model. An important application is expected to be in enabling more train services with existing power supply infrastructure, for example by optimizing energy storage to support the supply voltage in poorly supplied areas of the network.

Conclusions
A model has been created integrating a versatile database-conigurable rail network model and power supply network representative of a DC electric railway. It is intended as a high-level design tool to explore system wide behaviors prior to detailed inal design modelling of speciic technologies. Predictions of train motion and power demand have been validated against data from the Merseyrail network in the UK. The validation showed good agreement: On-board energy predictions were marginally (3.5%) low relative to measured data, this difference being comparable to the uncertainty in the experimental data and to the uncertainty found by other researchers in similar cases. Substation charge low predictions were comparable to measured data and indicated signiicant dependence on driving style. Deployment of energy storage across the modelled network and simulating a full day of traic has revealed the dependence of storage efectiveness on the timetable and traic density at speciic locations. The model is combined with a genetic algorithm to optimise system parameters (storage size, charge/discharge power limits, timetable, train driving style/trajectory) and also enables identiication of cases in which poorly speciied storage technology would have little or no positive impact on peak power and energy consumption. The developed model will enable these to be explored in further research, a particular application being the potential for pooling batteries of parked road vehicles within a charging and power bufering approach to transport energy management. Further work in applying the developed methods may also consider combining the trackside energy storage with onboard energy storage, exploring the impact of charge management requirements/characteristics of speciic storage technologies, and a cost-beneit and life-cycle assessment of the conigurations.

Declaration of Competing Interests
The authors declare that they have no known competing inancial interests or personal relationships that could have appeared to inluence the work reported in this paper.