You are on page 1of 6

2016 IEEE 8th International Conference on Intelligent Systems

Application of Firefly Algorithm to Train Operation


Kemal Keskin

Abdurrahman Karamancioglu

Department of Electrical & Electronics Engineering


Eskisehir Osmangazi University
Eskisehir, Turkey
Email: kkeskin@ogu.edu.tr

Department of Electrical & Electronics Engineering


Eskisehir Osmangazi University
Eskisehir, Turkey
Email: akaraman@ogu.edu.tr

AbstractIncreasing demand for energy and environmental


concerns have increased importance of energy-efficient transportation. In this manuscript, an energy-efficient train operation
based on finding optimal speed profile is studied. As a natureinspired metaheuristic approach, Firefly algorithm is employed
to find optimal switching points of the train control signal. In
problem formulation, energy consumption is taken as major part
of objective function and travel time is being included as penalty
factor. In order to verify the obtained results, a simulation is
performed. Besides firefly algorithm, genetic algorithm is also
used to compare results. Two algorithms are simulated on test
track with various grade profiles for several times. Both of
them considered four phases (maximum acceleration, cruising,
coasting and braking) of train motion. Furthermore with the
help of relaxing boundary conditions, algorithms are able to
organize motion phases excluding cruising phase. Simulation
results demonstrated that, compared to the GA, FA provides
more accurate and persistent solutions. In addition, it can be
converged to solution in small iterations, so it is compatible for
using in real time problem solving.
KeywordsFirefly algorithm, train operation, energy efficiency

I. I NTRODUCTION
Due to their high capacity, comfort, safety and low energy
consumption railway systems has taken a significant place
in urban transportation. Investments on urban rail transit
increases day by day. For example in Turkey, urban rail transit
stood just in a few cities at the beginning of this century. But
nowadays, it has increased to 21 cities with total distance
over 750 kilometers. Extension of rail network requires to
add new trains to inventory. It is clear that the major part
of energy consumption in a urban rail transit system is due
to trains. From this point of view, growing energy demand
and environmental concerns has drawn attention to energy
efficiency in rail transportation.
Studies on energy efficient train operation problems have
been a focus of the researchers for decades. As a milestone
in 1968, Ichikawa studied optimal control of train problem
by utilizing maximum principle [1]. The author considered
optimal train operation problem as a bounded state variable
problem. In order to provide energy efficiency, Pontragins
maximum principle was applied. Hoang et al. proposed an
heuristic optimization algorithm to reduce energy consumption
and direct search method was utilized to confirm tunnel
trajectories [2]. The relation between speed profile for given
trajectory and energy consumption of train was realized [4],

978-1-5090-1354-8/16/$31.00 2016 IEEE

[3]. Setting throttle formation to different levels at some


specific points - it can be called as critical speed values may help to reduce energy consumption. In this manner, four
motion phases (maximum acceleration, cruising, coasting and
braking) were defined based on throttle formation. Howlett
showed four phases should be applied successively in order to
decrease fuel consumption [4], [5], [6]. Maximum principle
was used in another research to give an analytical solution
of finding optimal control sequences and equations which
satisfy energy efficient movement of train between successive
stations within fixed time [7]. Also Khmelnitsky was studied to
provide an analytical solution by utilizing maximum principle.
In addition to other research, variable grade levels and speed
limits were considered [8].
Since energy efficient train operation problem consists of
not only discrete but also continuous terms together, it is
complicated such that analytical methods are hard to apply.
In recent years, development in technology have attracted
researchers to use several evolutionary and search algorithms.
Genetic Algorithm (GA) is one of the metaheuristic algorithms
which was utilized frequently in optimal train operation problems. During coasting phase there is no traction force affects
train motion, so energy is not consumed. Finding coasting
points plays a key role in energy saving train operation. In this
manner, Chang and Sim presented a GA based method in the
sense of time and service quality concerns. The authors defined
penalty factors to add these concerns into problem formulation
[9]. GA was compared with Artificial Neural Network (ANN)
in a real test path to confirm its performance [10]. However
GA and Simulated Annealing (SA) differ each other basically,
they can be combined to create a powerful algorithm. An
hybrid algorithm which was based on GA and SA combination
was proposed and used to find cruising and coasting points
[11]. Dynamic programming (DP) method solves optimal
control problems by breaking it down into a collection of
simpler subproblems and gives high accurate results [12].
Miyatake and Ko first formulated train operation as an optimal
control problem and then applied DP, gradient method and
sequential quadratic programming to solve it [13]. Particle
swarm optimization (PSO) is a metaheuristic search algorithm
with advantage of fast convergence. Dominguez et al. used
PSO in the sense of multi objective optimization of automatic
train operation system design. The authors considered not only

692

to minimize energy and time consumption but also to satisfy


service quality [14].
In recent years metaheuristic algorithms which are inspired
by nature has attracted a great deal of attention for solving global optimization problems. One of the nature-inspired
metaheuristic algorithm is Firefly Algorithm (FA). Algorithm
basically takes its main idea from flashing action of fireflies
and it was first formulated by Xin-She Yang [15]. Even though
FA is a new method and has not applied to optimal train
operation problem previously, it has drawn attentions of many
optimization researchers in different areas for instance, [16],
[17], [18], [19].
II. T RAIN M ODEL F ORMULATION
Energy efficient train operation might be satisfied with welldefined train model and train operation. A train model can
be described based on basic physics formulations especially
Newtons second law.

70

where m is the mass of train, v is the velocity of train, x is the


position of the train, Ft is the traction force which is bounded
with maximum traction force Ftmax , 0 Ft Ftmax , Fb is
the braking force which is considered mostly taken a constant
value, R, Rg , Rc are all resistances against to train motion,
basic resistance, resistance caused by track grade, resistance
caused by curves respectively.
In practice basic resistance R includes air and rolling
resistances. It is substantially depends on speed of train and
can be formulated by utilizing Davis equation [20].
R = a + b v + c v2

(2)

where a,b and c refer to parameters which are related train


characteristics. Grade resistance Rg caused by track grade. It
takes positive value for uphill parts of track and takes negative
value for downhill parts of track. Rg can be calculated as
follows:
Rg = m g sin

(3)

where g is gravitational acceleration and is slope of track.


Curve resistance Rc does not have an explicit formulation. In
order to calculate Rc , Roeckls formula [21] can be used.
6.3
m
r 55
4.9
Rc =
m
r 30

Rc =

for

r 300m.

for

r < 300m.

60

(1)

(4)

Speed(km/h)

dx
=v
dt
Ft Fb
dv
=
R Rg Rc
dt
m

III. O PTIMIZATION OF T RAIN O PERATION


During an operation, energy consumption of train mainly
depends on how to operate train through the track. According
to the reference [6], considering a flat, straight and long track,
an optimal train operation must have four motion phases:
maximum acceleration (MA), cruising (CR), coasting (CO),
and braking (BR).
As shown in Fig. 1, at the beginning of motion MA phase
is applied to start train up and reach the cruising speed as fast
as possible. Note that, at some point, it switches to CR phase
and train goes on its journey with a fixed speed value. CO is
a significant phase of train operation for energy efficiency. It
is applied between CR and BR phases. In CR phase, there is
no speed change so acceleration is equal to zero. Train moves
throughout the travel under already gained momentum. When
safe stopping distance is reached, train starts to braking. In
order to provide safe stopping at next stop, BR phase must
start at this point.

50

40
30
20
10

MA

Station 1

CR

CO
Position(m)

BR
Station 2

Fig. 1. Phase sequence for an optimal train operation

When motion phases are considered in energy consumption


manner, it is clear that coasting phase is the most economic
one since no energy is consumed in this phase. However employing coasting phase helps to decrease energy consumption,
it dramatically causes increment of travel time.
Motors of train produce a force which is called as tractive
effort to supply train motion via tractive force. Tractive effort
is a function of trains speed and it can be calculated as follows
P
(5)
v
where P is locomotives power, is the transformation
constant refers to converting motor power to traction effort,
v is the current speed of train and 2650 is for unit conversion
[2].
With the help of this equation, tractive effort and also
consumed power can be calculated as follows. From (5), the
consumed power (P) is defined by the following equation.
Ft = 2650

P =

where r is radius of the curve.

693

Ft v
2650

(6)

(6) gives us instant power of train. In order to find total energy


consumption, power is integrated over time.
Z T
E=
P dt
(7)
0

Considering the continuous time system dynamics in differential equations (1), state variables can be transformed into
discrete time in time interval [0, T ] for N steps as,
vk+1 = vk + ak t


vk + vk+1
t
xk+1 = xk +
2
k {0, , N }

(8)

where vk , xk , ak denote speed, position and acceleration of


train at step k respectively. t represents step size:
T
t =
N
For k {0, , N }, the quantities Fk and vk determines
instantaneous power at the k th step by (6), and the total
energy consumption throughout the journey is the sum of
consumptions at each step:
E=

A. Genetic Algorithm
As one of evolutionary algorithms, the genetic algorithm,
is a kind of heuristic search method that is used widely for
finding global optimum solutions. Genetic algorithm has been
utilized to find a solution for optimization problems in various
research areas such as optimal control problem, timetable
problems, vehicle routing problems, power electronics design.
Specifically considering works related to railway systems can
be found in [2], [9], [10], [11].
Genetic algorithms search procedure is inspired by natural genetics analogically. Algorithm starts with an initial
population including chromosomes that represent candidate
solutions. Each chromosome is assigned a score with regard
to fitness function (objective function). New generations are
created by applying genetic operators (crossover, mutation)
to chromosomes. In this manner, after several generations,
chromosomes which have better scores survive.When the
termination condition is met, the chromosome with best score
corresponds to optimal or suboptimal solution. A pseudo code
for generic genetic algorithm is given with Algorithm 1 below.
Algorithm 1: Generic Genetic Algorithm

N
X
Fk v k
t
2650

k = 0, 1, , N

(9)

begin
g0
initialization P1 (g)
evaluation P1 (g)
while not termination criteria do
recombination P1 (g) P2 (g)
evaluation P2 (g)
selection P1 (g) and P2 (g) P1 (g + 1)
g g + 1

k=0

Energy consumptions of each phase can be calculated singularly by utilizing formula mentioned above. After that they can
combined together in order to calculate total energy consumption. In MA phase, tractive effort takes attainable maximum
value. It is considered after MA phase CR phase comes. So
the speed value at point k1 stays same until this phase ends. In
this phase Fk value is variable and equals to sum of opposing
resistance values. When train reaches point k2 , CR phase ends
and CO phase starts. For subsequent phases (CO and BR),
no energy is consumed due to zero tractive effort. Therefore,
defining cruising start time as tCR = k1 t and coasting start
time as tCO = k2 t, we can write optimization problem
below as:
k2
k1
X
X
Fk v k
Fk vCR
min
t +
t
tCR ,tCO
2650
2650
k=0

k=k1+1

0 Fk Fmax
0 vk vmax ;

v(0) = 0;

v(N ) = 0

(N k2 )t stopping distance
k1 k2 N
This optimization statement corresponds to a train operation
between successive stations [11].
IV. A LGORITHMS
The genetic algorithm (GA) is the most widely used heuristic algorithm, therefore, it is traditional to compare performances of other heuristic algorithms to the GA. For this reason
a very brief introduction of GA is presented prior to the firefly
algorithm.

B. Firefly Algorithm
Firefly Algorithm is a metaheuristic optimization tool which
is inspired by lightning behaviour of fireflies. It was proposed
by Xin She Yang in 2008 [15]. Algorithm mainly depends
on light intensity changes. Different flashings have various
meanings, constitutively two of them has more importance:
attracting mating partners and attracting the hunt. Additionally,
flashing works as a warning system for external threats [15].
Firefly algorithm has three main rules [15].
1) All fireflies has no gender. Any of them can be attracted
to other fireflies.
2) Attractiveness is comparative to brightness. For instance,
considering two flashing fireflies, one which has less
glitter moves will move towards to more glitter one.
When distance increases, attractiveness and brightness
decrease expectedly. If both fireflies are not glitter
enough to attract other one, then random movement
occurs.
3) The view of objective function defines the brightness of
a firefly. Brightness can basically be relative to the value

694

of objective function for maximization problems. Also


it can be defined various ways.

823

Vertical
position
(m)

822,5

Two topics are significant for firefly algorithm: light intensity and attractiveness. Basically, the light intensity I(r) can
be defined related to the inverse square law [15]

0.5%

822

0.8%

821,5

- 0.75%

821

Is
I(r) = 2
r

820

where Is refers to the intensity at source and r is the distance


between fireflies. Attractiveness is directly related to the light
intensity seen by neighbor fireflies. Let is attractiveness of
a firefly, it can be defined as [15]
= 0 er

k=1

where xi,k is the kth component of the spatial coordinate xi


of ith firefly. Finally the movement of firefly i to firefly j is
determined by [15]
2

Horizontal position (m)


0
50
100
150
200
250
300
350
400
450
500
550
600
650
700
750
800
850
900
950
1000
1050
1100
1150
1200
1250
1300
1350
1400
1450
1500
1550
1600
1650
1700

819,5

Fig. 2. Test track level changes and length

(11)

where 0 denotes to attractiveness at r = 0 and is light


absorption coefficient. The distance between two fireflies i and
j at points xi and xj can be defined as following [15]
v
u d
uX
rij = kxi xj k = t
(xi,k xj,k )2
(12)

xi = xi + 0 erij (xj xi ) + i ,

0.25%

820,5

(10)

(13)

Considering given three rules and definitions above, algorithms pseudo code is given in Algorithm 2. Detailed information about algorithm can be found in [15]
Algorithm 2: Firefly Algorithm [15]
Objective function f (x), x = (x1 , , xd )T ;
Generate initial population of fireflies xi (i = 1, 2, , n);
Light intensity Ii at xi is determined by f (xi );
Define light absorption coefficient ;
while (t < M axGeneration) do
for i = 1:n all n fireflies do
for i = 1:n all n fireflies do
if (Ii < Ij ) then
Move Firefly i towards j;
end
Vary attractiveness with distance r via
exp[r];
Evaluate new solutions and update light
intensity;
end
end
Rank the fireflies and find the current global best g
end
Postprocess results and visualization

V. E XPERIMENTAL S TUDY
Energy efficient train operation problem is considered for a
test path which has various grade levels and speed limitations.
A train model based on formulations in (1) is implemented
in computer environment. Furthermore a real-like test path is
modeled. Considering all these, switching points for CR and
CO phases are calculated by FA. With proposed speed profile,
train motion is simulated. In order to show its efficiency,
obtained results are compared with GA.
A. Test Environment
During test A light weight tram is modeled which has 571
hp power in total and maximum operating speed is 70 km/h.
A real-like track is modeled with uphill and downhill sections.
Variation in level with regard to track length and also gradient
are given in Figure 2.
The experiments are performed on Intel(R) Core(TM) i74710HQ CPU 2.5 GHz and Microsoft Windows 10 operating
system. A MATLAB program is implemented to simulate train
motion and apply speed profiles.
B. Test I
A track which is 1700 meters in length with two uphill parts
followed by a downhill and an uphill section is designed for
test. It is considered that train operation has all motion phases.
Firefly algorithm is employed as a global optimization tool to
find optimum switching points for CR and CO phases. Initial
parameters for the algorithm are set as follows: population
size: 30, iteration size: 35, alpha: 0.5, beta: 0.2, gamma: 1,
lower bounds [30,1000] and upper bounds [1700,1700]. Here
upper bounds are selected same and in a large interval. The
aim of that is relaxing algorithm to modify number of motion
phases. In other words, CR phase can be omitted from phase
sequence if it is required.
There is a trade off between time and energy consumptions. As one of them rises, then the other one goes down.
Throughout the journey, a time limit is set to satisfy schedule.
In this way, time concerns are taken into account while energy
consumption is minimizing.
In order to optimize energy efficiency of train operation,
FA and GA are employed. Obtained results are given in

695

TABLE I
F IREFLY ALGORITHM TEST RESULTS
Iteration
1
2
3
4
5

CR Switching point (m)


242
243
244
244
248

CO Switching point (m)


1376
1376
1376
1374
1365

Energy consumption (kwh)


4.86
4.86
4.86
4.86
4.85

Algorithm running time (s)


133
142
102
88
142

TABLE II
G ENETIC ALGORITHM TEST RESULTS
Iteration
1
2
3
4
5

CR Switching point (m)


337
702
414
404
307

CO Switching point (m)


1404
1446
1393
1391
1446

Energy consumption (kwh)


5.15
6.21
5.31
5.28
5.20

Table I and II. For firefly algorithm, CR and CO switching


points which refer to a point that motion phase switches
to another and at the same time energy consumption and
algorithm running time are given in Table I. Table II represents results for genetic algorithm. The energy efficient train
operation problem is solved several times by utilizing both
these algorithms. Metaheuristic algorithms usually can provide
different solutions for same problem. FA differs from others
when it is compared in persistency and accuracy. For instance,
as seen from Table I, all parameters stay roughly same at
each iteration except algorithm running time. For the test,
algorithms function counts are fixed to 1040. Time limit is
defined as a penalty factor and it is taken as 105 seconds.
When energy consumptions are taken into consideration, FA
saves about 8.5% more energy as against GA.

Algorithm running time (s)


94
183
108
195
190

Fig. 3. Map for Test II

C. Test II
results show that not only for computational time but also
performance of solution, FA exhibits outstanding performance
in comparison to GA.

696

70

Speed
(km/h)

60

50

40

30

20

10

Firefly Alg.
Genetic Alg.

Time (s)
0
0
3,8
7,6
11,4
15,2
19
22,8
26,6
30,4
34,2
38
41,8
45,6
49,4
53,2
57
60,8
64,6
68,4
72,2
76
79,8
83,6
87,4
91,2
95
98,8
102,6
106,4
110,2
114
117,8
121,6
125,4
129,2
133
136,8
140,6
144,4
148,2
152
155,8
159,6
163,4
167,2
171
174,8
178,6
182,4
186,2
190
193,8
197,6
201,4
205,2

In this test, a path with multiple stations is considered.


Figure 3 demonstrates stations and path features. There are
two critical curvatures which limit the train speed specifically
at point A and point B, speed is restricted to 35 km/h and
15 km/h respectively. Grade levels of path is also taken into
account, and train stops at all stations.
Genetic and Firefly algorithms were applied to find the
problem with the test conditions described above to the
optimum energy efficient train operation. Function counts for
both algorithms are set to 1000. Travel time is restricted to 205
seconds. Since metaheuristic algorithms may give different
results each run, sufficiently many algorithm runs have been
performed. Figure 4 demonstrates speed vs time graph of two
algorithms results.
When the speed profile found by utilizing FA is applied
to the train, it reached last station in 205 seconds with 8.43
kwh energy consumption. On the other hand, when the GA
solution is applied, it finished the travel in 205 seconds as
well and 8.71 kwh energy consumption. When computational
times of algorithms are compared, FA outperforms GA, more
specifically, FA spends half the time spent by GA. Obtained

Fig. 4. Speed vs. Time - GA and FA

VI. C ONCLUSION
In this study, a nature-inspired optimization approach for
energy efficient operation of a train is proposed. As a global
optimization problem, energy efficient train operation problem
can be considered as finding an optimal speed profile. The
objective function is defined as energy consumption along the
journey. Furthermore punctuality and speed limits are taken
into account. GA which is a popular optimization tool and
FA are employed to optimize this problem. Obtained results
showed that FA produces better solution with high accuracy
when it is compared to GA. Besides that even lower function
count size FA preserves its persistency to finding optimal
solution. Therefore FA can be good alternative solver for realtime problems.
R EFERENCES
[1] K. Ichikawa, Application of optimization theory for bounded state
variable problems to the operation of train, Bull. Jpn. Soc. Mech. Eng.,
vol. 11, no. 47, pp. 857-865, Oct. 1968
[2] H. H. Hoang, M. P. Polis, and A. Haurie, Reducing energy consumption
through trajectory optimization for a metro network, IEEE Transactions
on Automatic Control, vol. 20, no. 5, pp. 590-595, 1975.
[3] J. Cheng, P. Howlett, Application of Critical Velocities to the Minimisation of Fuel Consumption in the Control of Trains, Automatica, vol.
28, no. 1, pp. 165-169, Jan. 1992.
[4] P. Howlett, An Optimal Strategy for The Control of A Train, J. Austral.
Math. Soc. Ser. B 31, pp. 454-471, 1990.
[5] J. Cheng, P. Howlett, A Note on the Calculation of Optimal Strategies
for the Minimization of Fuel Consumption in the Control of Trains,
IEEE Transaction on Automatic Control, vol. 38, no. 11, pp. 1730-1734,
Nov. 1993.
[6] P. Howlett, The Optimal Control of A Train, Annals of Operations
Research, vol. 98, no. 1-4, pp. 65-87, Dec. 2000.
[7] Liu, R. and Golovitcher, I., Energy-efficient operation of rail vehicles,
Transportation Research Part A: Policy and Practice, vol. 37, no. 10, pp.
917-932, Dec. 2003.

[8] E. Khmelnitsky, On an Optimal Control Problem of Train Operation,


IEEE Transaction on Automatic Control, vol. 45, no. 7, pp. 1257-1266,
Jul. 2000.
[9] C. S. Chang and S. S. Sim, Optimising train movements through
coast control using genetic algorithms, IEE ProceedingsElectric Power
Application, vol. 144, no. 1, pp. 65-73, Jan. 1997.
[10] S. Acikbas, M.T. Soylemez, Coasting point optimisation for mass rail
transit lines using artificial neural networks and genetic algorithms, IET
Electric Power Applications, vol. 2, no. 3, pp. 172-182, May 2008.
[11] K. Keskin, A. Karamancioglu, A hybrid optimization algorithm for
energy efficient train operation, Innovations in Intelligent SysTems and
Applications (INISTA), 2015 International Symposium on, pp. 1-6, Sep
2015.
[12] R. Franke, P. Terwiesch, M. Meyer, An algorithm for the optimal control of the driving of trains, Proceedings of the 39th IEEE Conference
on Decision and Control, pp. 2123-2128, Dec. 2000.
[13] M. Miyatake, H. Ko, Optimization of Train Speed Profile for Minimum
Energy Consumption, IEEJ Transactions on Electrical and Electronic
Engineering, vol. 5, no. 3, pp. 263-269, May 2010.
[14] M. Dominguez, A. Fernandez-Cardador, A. P. Cucala, T. Gonsalves, A.
Fernandez, Multi objective particle swarm optimization algorithm for
the design of efficient ATO speed profiles in metro lines, Engineering
Applications of Artificial Intelligence, vol. 29 pp. 43-53, Mar. 2014.
[15] X. S. Yang, Nature-Inspired Metaheuristic Algorithms, Luniver Press,
2008.
[16] J. Kwicien, B. Filipowicz, Firefly algorithm in optimization of queueing
systems, Bulletin of The Polish Academy Of Sciences, Technical
Sciences, Vol. 60, No. 2, pp. 363-368, 2012.
[17] M. Mitic, Z. Miljkovic, Bio-inspired approach to learning robot motion trajectories and visual control commands, Expert Systems with
Applications, Vol. 42, pp. 2624-2637, 2015.
[18] K. Tesch, K. Kaczorowska, Arterial cannula shape optimization by
means of the rotational firefly algorithm, Engineering Optimization,
Vol. 48, No. 3, pp. 497-518, 2016.
[19] X. S. Yang, Firefly Algorithm, Levy Flights and Global Optimization,
Research and Development in Intelligent Systems XXVI, pp. 209-218,
2010.
[20] T. Davis, Transportation Energy Data Book, 20th ed. Washington, DC,
2000.
[21] D. Huerlimann, A. B. Nash, OPENTRACK - Simulation of railway
networks, user manual version 1.3., ETH Zurich: Institute for Transportation Planning and Systems, 2003.

697