P s1;m;d > > : qj;max > > > < qj;min ¼ > qj;M;d > > : if Ps1;m;d > Ps1;max if Ps1;m < Ps1;min otherwise ð20Þ if qj;M;d > qj;max if qj;M;d < qj;min otherwise ð21Þ where Ps1,max and Ps1,min are the maximum and minimum power outputs of slack thermal unit 1, respectively; qj,max and qj,min are the maximum and minimum water discharges of hydro plant j The initialized population of the host nests is set to the best value of each nest Xbestd (d = 1, , Nd) and the nest corresponding to the best fitness function in (19) is set to the best nest Gbest among all nests in the population 3.3.2 Generation of New Solution via Lévy Flights The new solution is calculated based on the previous best nests via Lévy flights In the proposed CSA method, the optimal path for the Lévy flights is calculated by Mantegna’s algorithm [22] The new solution by each nest is calculated as follows: X new ¼ Xbestd ỵ a rand3 DX new d d ð22Þ 280 T.T Nguyen et al / Applied Energy 132 (2014) 276–287 where a > is the updated step size; rand3 is a normally distributed random number in [0, 1] and the increased value DXnew is deterd mined by: DX new ẳv d rx bị Xbest d Gbestị ry bị 23ị where mẳ randx 24ị jrandy j1=b where randx and randy are two normally distributed stochastic variables with standard deviation rx(b) and ry(b) given by: À Á31=b C1 ỵ bị sin p2b rx bị ẳ b1 C 1ỵb b 2 ị 25ị ry bị ẳ 26ị The flowchart of the proposed CSA for solving the problem is given in Fig Numerical results The proposed CSA has been tested on five systems with quadratic fuel cost function of thermal units and two systems with nonconvex fuel cost function of thermal units The proposed algorithm is coded in Matlab platform and run on a GHz PC with GB of RAM 4.1 Selection of parameters where b is the distribution factor (0.3 b 1.99) and C(Á) is the gamma distribution function For the newly obtained solution, its lower and upper limits should be satisfied according to the unit’s limits: > < qj;max if qj;m;d > qj;max qj;m;d ¼ qj;min if qj;m;d < qj;min ; j ¼ 1; ;N2 ; m ¼ 1; ; M À > : qj;m;d otherwise ð27Þ > < Psi;max if Psi;m;d > Psi;max P si;m;d ¼ Psi;min if Psi;m;d < Psi;min ; i ¼ 2; ;N1 ; m ¼ 1; ;M > : Psi;m;d otherwise Initialize population of host nests Psi ,m ,d = Psi ,min + rand1 * ( Psi ,max − Psi ,min ) ð28Þ The power output of N2 hydro units and the slack thermal unit are then obtained as in Section 3.2 The fitness value is calculated using (19) and the nest corresponding to the best fitness function is set to the best nest Gbest 3.3.3 Alien egg discovery and randomization The action of discovery of an alien egg in a nest of a host bird with the probability of pa also creates a new solution for the problem similar to the Lévy flights The new solution due to this action can be found out in the following way: X dis d ẳ Xbestd ỵ K DX dis d ð29Þ where K is the updated coefficient determined based on the probability of a host bird to discover an alien egg in its nest: & K¼ if rand4 < pa otherwise 30ị ẳ rand5 ½randp1 ðXbestd Þ À randp2 ðXbestd Þ q j ,m ,d = q j ,min + rand * (q j ,max − q j ,min ) Calculate all thermal and hydro generations based on the initialization - Set Xd to Xbestd for each nest - Set the best of all Xbestd to Gbest - Set iteration counter iter = Generate new solution via Lévy flights X dnew = Xbest d + α × rand × ΔX dnew - Check for limit violations and repairing - Calculate all hydro and thermal generation outputs - Evaluate fitness function to choose new Xbestd and Gbest Discover alien egg and randomize and the increased value DXdis d is determined by: DX dis d In the proposed CSA method, three main parameters which have to be predetermined are the number of nests Np, maximum number of iterations Nmax, and the probability of an alien egg to be discovered pa Among the three parameters, the number of nests has significantly effects on the obtained solution quality Generally, the higher number of NP is chosen the higher probability for a better optimal solution is obtained However, the computational time for obtaining the solution for case with the large numbers is long By experiments, the number of nests in this paper is set from 10 to 100 depending on system size Similar to NP, the maximum number of iterations Nmax also has an impact on the obtained solution quality and computation time It is chosen based on the complexity and scale of the considered problems For the test systems in this paper, the maximum number of Nmax ranges from 300 for small X ddis = Xbestd + K ì X ddis 31ị where rand4 and rand5 are the distributed random numbers in [0, 1] and randp1(Xbestd) and randp2(Xbestd) are the random perturbation for positions of the nests in Xbestd For the newly obtained solution, its lower and upper limits should be also satisfied constraints (27) and (28) The value of the fitness function is calculated using (19) and the nest corresponding to the best fitness function is set to the best nest Gbest - Check for limit violations and repairing - Calculate all hydro and thermal generation outputs - Evaluate fitness function to choose new Xbestd and Gbest No Iter