1 Introduction

Today with rising prices of energy and fossil fuels such as gasoline, the demand for public transport has increased. With the adverse effects from global warming and increasing prices of fossil fuels and decreasing amount of fuels, the use of green energy in transport have become crucial. Improving the transport sector has positive impact on economic and social developments of many other sectors depending on transport. To this end, numerous researches in the field of energy efficiency in rail transport have been carried out [1,2,3,4]. However, none of the approaches have investigated the effectiveness of optimising the different aspects of train systems such as driver profiles and battery storage simultaneously to obtain efficient energy consumption. Another drawback of the current studies is that they mostly consider hypothetical simplified networks that do not resemble the actual real-world railway systems. To improve on this, we employ a comprehensive train model that resembles the complex real-world system and validate against real-world data. We propose optimised network parameters for an existing real-world network.

The objective of this study is to optimise train control and energy storage to reduce energy consumption. Since a railway transportation system is a large nonlinear complex system [5], achieving optimal driving profiles and battery storage for the entire network is a difficult task. From a computational perspective, the train trajectory optimisation problem of railway network under various constraints is a non-convex and highly nonlinear optimisation problem, which makes the challenge of finding an optimum train trajectory alone is hard and it has been shown that the problem is NP-complete [6].

Given the complex and highly nonlinear nature of the problem, exact techniques have failed to optimise train trajectories. Meta-heuristic approaches such as genetic algorithms (GA) [7] and ant colony optimisation [8] have shown great potential in the applicability on complex real-world problems in engineering domains given their ability to work on highly nonlinear problems with limited information. In the literature of train systems, genetic algorithms are applied to search the optimal train speed trajectory under the journey time and maximum operating speed constraints in some preliminary studies in railway networks [9,10,11,12,13]. These studies have only considered simplified versions of real-world systems and single or few parameters to optimise, resulting their proposed models rather inapplicable to actual railway systems. In this study, a GA-based approach is proposed for comprehensive real-world network optimisation based on actual data and system parameters. With the significant improvements of 15%–30% in energy consumption on the tested UK Merseyrail network, our approach shows potential to be deployed on other real-world railway networks.

The rest of the paper is organised as follows. Section 2 describes the foundations of the energy modelling and optimisation of trains, followed by a description of the electrical and mechanical model employed in this work. Section 3 presents the optimisation framework followed by experimental results in Sect. 4, and finally, Sect. 5 presents concluding remarks.

2 Preliminaries

Dynamics of train motion have been analysed in the context of energy efficiency. To analyse these models, the basic physical formulations regarding the motion and power have been used. Basically, the motion of a train depends on the traction, resistance and gradient forces. The complexity of these models differs depending on the number of trains, substations, and the number of internal cars of a train. In general, a train journey between two locations consists of four action phases, namely acceleration, cruising, coasting, and braking. However, in real life, depending on the gradients of the route, speed limits and dynamic factors as time table changes, the actual stages of the journey can be changed. The general physics formula to determine the traction force is:

$$\begin{aligned} Ma = T - R - Mg\sin {\varTheta }, \end{aligned}$$
(1)

where M is the mass of the train, a acceleration, T traction force, R resistance force, g is the gravity and \(\varTheta\) is the gradient angle. The positive a represents the acceleration during the acceleration phase. a becomes zero during the cruising phase hence the traction force is equal to the summation of the resistance and gradient forces. In these two phases, train draws power from the power source (grid or a local storage at a substation if available). Traction force is zero in coasting phase, where the train does not consume any power. In the braking phase, the train generates power through doing work against the train movement. This energy can be used to feed back to the power source (grid or a local storage/battery). Figure 1 describes these phases of train motion and interactions with the power source.

Fig. 1
figure 1

Phases of train motion and interactions between power sources

The work by Douglas et al. [2] considers single train simulation and multiple train simulation. The trains are run on predetermined routes, and each route is considered to have the four basic stages accelerating, cruising, coasting and braking sequentially. This model does not incorporate storing the braking energy. The work by Sandidzadeh et al  [4] takes a similar approach to model the power dynamics of a train network. In addition to the approach by Douglas et al. [2], this work considers the internal carriages of the train within the model. The work by Gavin et al. [3] studies the UK Merseyrail system as a case study to build their models. They have experimented with the test train drives to validate their models. The validation results show that their power consumption predictions closely resemble the actual train power consumption. However, these models do not consider the battery storage parameters and regenerative capabilities were not enabled during the experiments.

The study by Ghaviha et al. [1] shows that by optimising driver profiles, energy consumption can be minimised. They use a dynamic programming algorithm for this. Similarly, the work by Amrani et al. [9] and by Wei et al. [12] employed genetic algorithms to optimise driver profiles on simple networks. Their results show improvements in energy consumption provided from simulations only. In contrast, the work by Zhao [13], the train trajectory optimisation algorithm has been developed and a field test of the obtained trajectory has been carried out on a metro line. The field test results are very similar to the simulation results, proving that the developed train kinematics model is effective and accurate.

In these works, however, they have considered battery storage parameters to be fixed and only driver profile parameters were optimised. Moreover, in the current literature, the feedback aspect of the energy has not been considered. When considering energy saving, using the regenerative energy from the braking is a very important aspect. It is also observed that the validation of energy models against real-world data has not been carried out by majority of the exiting work. In order to overcome the limitations in the current literature, this study considers a novel model incorporating regenerative energy, both driver profile and battery storage parameters and that is validated against real-world data from the UK railway network.

2.1 A real-world inspired train power model

For the optimisation approach in this paper, we employ the real-world inspired railway network model presented in Fletcher et al. [14]. For completeness purposes, we present a brief description of the model formulation and validation in the following.

The rail network topology is defined by nodes (stations, junctions, electrical substations, neutral sections) connected by lines with properties of length, end nodes, line-speed limit and gradient, the latter two being functions of position. Routes are defined by the sequence of lines over which a train will run (direction, target traverse time for each line), nodes at which to stop, minimum dwell time and departure time relative to the route start. A timetable defines which train runs on each route, and the time the train will depart. DC rail system voltages typically imply high current flows, needing short electrical sections to reduce losses. Substations are represented using open-circuit voltage and internal resistance [15, 16]. Trains drawing power are represented as resistances with their locations determining supply transmission length. Conducting and return rails have a resistance per metre, giving an in-circuit resistance and energy loss that varies with train position. In 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 a section can be represented as in Fig. 2 where four trains are present. The electrical section network was pre-solved using Kirchhoff’s laws. Specific cases are realised by setting the internal resistance of unneeded components to a high value and validated against the Qucs circuit simulator  [17]. Energy storage is located in sub-stations, on the grid-side of the sub-station internal resistance. Energy storage/battery parameters ignore specific technology and focus on capacity, charge/discharge rates, and efficiency. For a comprehensive description of the model formulation, we refer the interested reader to Fletcher et al. [14].

Fig. 2
figure 2

Electrical model for a sample case of two substations and two trains drawing power from the grid and two trains regenerating. The local power storages are located at the substations

2.2 Model validation with real-world data

Validation uses data for the Merseyrail Wirral line in the UK. Gradients and line speeds are taken from Network Rail [18] and on-board and sub-station energy use from  [3, 19]. Train location monitoring using GPS tracking was used for comparison with simulator predictions. Predicted movement between a specified set of stations, simulated on the basis of flat-out running, with the corresponding GPS trajectory. The experimental results showed that there is a very close agreement with model predictions and actual train run. For a comprehensive description of the model validation, we refer the interested reader to  [14].

3 Optimisation of energy consumption

This section presents the optimisation of the energy consumption for a train network based on the electrical model described in the previous section. The objective of the optimisation process is to minimise the energy drawn from outside sources. We employ genetic algorithms to implement this optimisation process.

3.1 Variables

The variables for the optimisation are the driver profile parameters of the trains representing acceleration and braking for the trains in the network and the energy storage parameters. The driver profile parameters represent the control parameters for each time step for each train. Control parameters can vary between the maximum allowable acceleration or brake and this is a feature of a train. We model this by a real-valued control parameter in the range of \(-\)1 to +1 where negative values represent brake and the positive values acceleration. The feasible values for the energy storage parameters are bounded by the standard limits in practice. The considered storage parameters are the maximum storage of battery, the maximum regenerative power supplied to the grid, the battery storage upper limit, the storage lower limit, the maximum grid charge power, the maximum grid discharge power, the maximum regenerative charge power, the maximum regenerative discharge power and the maximum grid supply power of the battery.

Generally, an optimisation process must consider objectives and constraints. In this project, the broader objective is to understand what enables more energy efficient driving and storage, whereby we can decrease the cost, and improve adherence to timetable and speed limits. While these objectives are well defined, the constraints on their achievement are complex.

3.2 Objectives

Minimising energy consumption is the objective. The problem can be formulated as follows:

$$\begin{aligned} Find \, \varvec{X} =[x_1, x_2, \ldots , x_n] \end{aligned},$$
(2a)
$$\begin{aligned} Minimise \, C_{\rm e}(\varvec{X} )= \varSigma _{j=0}^{m}{E_{v_j}} \end{aligned},$$
(2b)

where \(\varvec{X}\) is a vector of variables containing the driver and battery parameters for whole network, n is the number of parameters, m is the number of trains in the network, \(C_{\rm e}(\varvec{X} )\) represents energy consumption within the network, \(\{v_1, v_2, \ldots , v_m\}\) represents the set of trains within the network and \(E_{v_j}\) represents the net energy consumption for train \(v_j\), respectively.

3.3 Constraints

The constraints are imposed by the timetable, speed limits and the power spikes. We consider a maximum allowed delay of 0, speed limits as per the actual speed limit values imposed by the government based on the location of the train, and a maximum allowed current drawn from a substation at a time step of 1000 A (a constraint on power spikes). We consider solutions violating these constraints as infeasible.

3.4 Evolutionary optimisation framework

The class of popular heuristic optimisation algorithms namely genetic algorithms (GA) are used in this study to optimise train control and substation energy storage. Owing to their general purpose appeal and ease of use, evolutionary algorithms have gained a wide popularity in past decades [20, 7, 21]. In essence, evolutionary algorithms mimic the natural evolution process to solve real-world problems. The optimisation framework is built using the genetic algorithm library ParadiseEO [22], which is available under an open source licence granting the rights to access the source code, to copy, modify and redistribute the code. Algorithm 1 outlines the evolutionary optimisation process in general. The algorithm is initialised with a population, P, consisting of \(\mu\) instances which represent different driver profiles and energy storage parameters (within a pre-determined range or selection). In each iteration, \(\lambda \le \mu\) offspring are produced by selecting a subset, C, of the population, P, consisting \(\lambda\) parents and applying genetic operators to the selected individuals. Based on the fitness a subset, D, of \(\mu\) individuals survives from the population, P, for the next iteration and the process continues until a desired termination criteria is met. We can specify a certain number of generations as the termination condition or else until a certain fitness level is reached.

figure a

3.4.1 Initialisation of population

A GA individual in the population represents a potential train control/driver profile and battery storage setting (together we call them railway parameters) instance. Such an individual is represented by a real-valued vector, where each GA gene [7] represents a real valued railway parameter described in Sect. 3.1; i.e. this numerically captures the full description of a particular instance of the railway parameter setting. Initialisation of the optimisation can start with a population of randomly selected combinations of railway parameters (chosen within realistic bounds), or using heuristics. In our case we use a hybrid approach, initialising the search using (i) existing standard values, and (ii) a proportion of randomly generated cases (i.e. combinations of higher capacity batteries or acceleration and brake at the same time which are feasible but do not exist at present). This hybrid approach aims to give a good starting point to the simulation without limiting the diversity in the population. In this way, we can preserve diversity and still bias the process towards likely good solutions.

3.4.2 Selection

Each step of the genetic simulation process requires the existing railway parameters to be taken in pairs as “parents” from which the next generation of railway parameters are created. We employ random selection to choose which railway parameters to combine as parents at each step, these having previously through the survivor selection stage of the previous generation ensuring only the best-performing are considered. This approach is simply a way to achieve mixing of the different railway parameters which may be combined, working towards finding especially high-performing combinations.

Based on the fitness value and constraint violations, feasible individuals are sorted and the best, \(\lambda\) individuals are selected for next generation as parents.

3.4.3 Genetic operators

Genetic operators are applied to the selected parents to create new offspring from them. These operators are inspired by the biological evolutionary operators of “crossover” and “mutation”. Crossover is the process by which the next generation inherits genes from multiple (typically two) parents to create new offspring. Once two parents are selected, we choose the value for a given control table parameter (a “gene”) uniformly at random from either parent, a process of “uniform crossover”. The mutation process makes a small random change to this newly created offspring.

The mutation operator is designed to apply a small random perturbation to a chosen railway parameter. At each generation, a set of control parameters are chosen for mutation based on a probability distribution.

The aim is to form new railway parameter settings which differ slightly from the current, thereby allowing a wide range of combinations to be explored in a rigorous way, but without the computational overhead of attempting to simulate every combination of every parameter. Each generation is tested (“fitness test”, see Sect. 3.4.4) to see whether its members are better or worse than the proceeding, with the best going forward in a repeat of the process.

3.4.4 Fitness function

The cost function in Eq. (2) introduced at the beginning of this section serves as the fitness function in the GA. The basic architecture of the optimiser and train simulation model interaction is as shown in Fig. 3.

Fig. 3
figure 3

Block diagram of the optimisation process

4 Experimental results

4.1 Experimental set-up

Experiments are conducted to find an optimal control strategy and storage settings for a rail network to achieve minimum energy consumption. The hyper-parameter setting for the GA includes a population size of 20 and crossover rate of 80%. The mutation rate is kept higher (of 10%) at the beginning of the optimization process to help the exploration of the search space and it is gradually decreased (of 0.1%) to support exploitation when the process becomes closing to convergence.

The experiments are based on two real-world scenarios on Merseyrail network in the UK with firstly, a simpler case of three trains running on a specified route and secondly, all trains in the network running during a busy time of the day. In both cases trains are set to run following the actual time table and actual routes.

For benchmarking purposes, we run simulations based on an expert control strategy as well. The expert control strategies for each train are generated manually based on the physical laws of motion and train physics, and by adhering to the system constraints. The idea is to mimic human expert behaviour. The respective speed profiles generated by expert control strategy for the first experiment are shown in red in Figs. 4 and 5. The initial railway parameter setting for the optimisation process is based on this expert strategy. The respective parameters are as explained in Sect. 3.1.

Fig. 4
figure 4

Minimisation of objective value (energy consumption) over the generations during the optimisation process

Fig. 5
figure 5

Speed profile for a train taking the route from A to B based on expert and optimised parameters

The experiments were run on a linux ubuntu 17.04 64 bit PC with Intel Core i7-7700HQ CPU @ 2.80GHz x 8 processor, 15.5 GB memory and a GeForce GTX 1050 Ti/PCIe/SSE2.

4.2 Fitness over generations

Figure 6 describes the fitness variation over generations. The fitness criteria represents energy consumption as described in Sect. 3.4.4. The optimised speed profiles for the trains are shown in blue in Figs. 5 and  6. It is observed that the optimal speed profiles have slightly lower speeds than the initial expert strategy (shown in red). It can be understood that with lower speed, the probability of having speed limit violations and power spikes are less. Nevertheless, with the delay constraint, it is guaranteed that no delays (delays with respect to the train time table) are associated with the optimal speed profiles.

The respective power profile for all the substations is shown in Fig. 7. A total energy consumption reduction of around 15% can be evident in this power profile.

Fig. 6
figure 6

Speed profile for a train taking the route from A to B based on the expert and the optimised parameters

Fig. 7
figure 7

Power profile for the network describing the total power drawn from the grid for the expert and the optimised parameter settings

4.3 Relative importance of driver profiles versus energy storage variables

We conduct further experimentation to study the relative importance of the variables representing railway parameters. The variables of this optimisation process are categorised to two main categories: the variables determining the driver profile and the variables determining the battery storage. In this experiment we optimise each category while keeping the variables of the other category fixed. The results for optimising driver profile and battery storage are shown in Fig. 8. The optimisation of the battery parameters achieved slightly better fitness (lower energy consumption) within 500 generations than the optimisation of the driver profile parameters. When we are provided with a limited budget and costs associated with re-configuring parameters, higher important parameters can be prioritised accordingly.

Fig. 8
figure 8

Minimisation of objective value (energy consumption) over the generations during the optimisation process for optimising the driver profile parameters and the battery storage parameters only

4.4 Real-world scenario on Merseyrail peak hours

We further extend our experiments for a more complex real-world case. This is the complete Merseyrail network in the UK. We run the GA to optimise driver profiles and battery parameters for the Merseyrail network during a busy time. The constraints are considered as hard constraints, meaning speed limit violations, spikes and delays do not occur during this optimal setting. Figure 9 describes the energy consumption reduction over the algorithm run and it is observed that optimised driver profiles and battery storage have reduced the energy consumption by 25%. Figure 10 demonstrates the respective total power consumption for the expert (in red) and optimised (blue) parameter settings. The respective expert and optimised battery storage parameter values are presented in Table 1. Figures 11 and  12 present the respective speed profiles for two routes namely Birkhead north to Hoylake and Hoylake to James Street. In both cases, it is observed that the optimised speed profiles yield to lower speeds and less energy consumption. Nevertheless, these profiles adhere to the timetables as considered within the optimisation process.

Fig. 9
figure 9

Minimisation of energy consumption over the generations during the optimisation process for Merseyrail network

Fig. 10
figure 10

Power profile for the Merseyrail network describing the total power drawn from the grid for the expert and the optimised parameter settings

Table 1 Initial and optimised values for battery parameters for a electrical substation
Fig. 11
figure 11

Speed profile for a train taking the route from Birkhead North to Hoylake based on the expert and the optimised parameters

Fig. 12
figure 12

Speed profile for a train taking the route from Hoylake to James Street based on the expert and the optimised parameters

5 Conclusion and future work

Energy optimisation for a highly complex nonlinear real-world DC electric railway system is presented in this work. A comprehensive set of parameters are optimised simultaneously covering the driver profile and the battery storage settings using evolutionary algorithms. Optimised results show a 15%–30% reduction in total power consumption for two different scenarios in the UK Merseyrail network. Relative importance of different railway parameters are studied where battery parameter optimisation results in slightly higher reduction in energy consumption than driver profile parameter optimisation. Future work will concentrate on extending the experiments to different subsets of parameters and timetable slots for the network to investigate on the effects from different structural and temporal system features on the performance and their inter-dependencies.