On-O ﬀ Control of Range Extender in Extended-Range Electric Vehicle using Bird Swarm Intelligence

: The bird swarm algorithm (BSA) is a bio-inspired evolution approach to solving optimization problems. It is derived from the foraging, defense, and ﬂying behavior of bird swarm. This paper proposed a novel version of BSA, named as BSAII. In this version, the spatial distance from the center of the bird swarm instead of ﬁtness function value is used to stand for their intimacy of relationship. We examined the performance of two di ﬀ erent representations of defense behavior for BSA algorithms, and compared their experimental results with those of other bio-inspired algorithms. It is evident from the statistical and graphical results highlighted that the BSAII outperforms other algorithms on most of instances, in terms of convergence rate and accuracy of optimal solution. Besides the BSAII was applied to the energy management of extended-range electric vehicles (E-REV). The problem is modiﬁed as a constrained global optimal control problem, so as to reduce engine burden and exhaust emissions. According to the experimental results of two cases for the new European driving cycle (NEDC), it is found that turning o ﬀ the engine ahead of time can e ﬀ ectively reduce its uptime on the premise of completing target distance. It also indicates that the BSAII is suitable for solving such constrained optimization problem.


Introduction
Nowadays, society is facing the increasing depletion of petrochemical energy, the serious destruction of the ecological environment, and increasing car ownership. These factors promote the rapid development of new energy vehicles like the electric vehicle. However, the power battery of the pure electric vehicle has a series of problems, such as high cost, short range and over discharge, which is not conducive to long-distance driving.
As a transitional model of pure electric vehicle, the extended-range electric vehicle (E-REV) can effectively address the shortcomings above. The basic structure of a typical E-REV is shown in Figure 1. The auxiliary engine and power generation device has been added to the mechanism of the electric vehicle, which extends driving distance of electric vehicle. The integration of engine and generator constitute is called the range extender (RE), the main function of which is to charge the battery under the condition of insufficient power supply, for purpose of providing enough power to extend driving distance. Because of separation of the engine from the road load and the balance of the battery load, E-REV can keep the engine at the optimum working efficiency point (85%) and improve the fuel efficiency greatly. Additional E-REV has two energy sources: engine and power battery, so an efficient control strategy is essential to practice the coordination of the two devices, improve vehicle performance, e.g., fuel efficiency and exhaust pollution. The energy management of E-REV has always been a research hotspot [1][2][3]. Under the different driving conditions, the on-off time of RE for the E-REV is optimized with the target distance as the constraint condition. The main principle of the E-REV energy management strategy is that the use of engine is as little as possible as well as keeps the vehicle running in pure electric mode. The traditional control strategy is that when the battery power reaches the minimum threshold, the vehicle enters the extended range mode, the engine starts and drives the generator to produce electricity. Part of the generated electricity charges the battery, and the other part drives the vehicle to continue driving. When the battery power reaches the maximum threshold, the engine shuts down and vehicle enters the pure electric drive mode.
Control method like fuzzy control has been adopted in the energy management. It has been used for powering the battery, to keep the state of charge (SOC) in the designed threshold and avoid overcharge and over discharge [4]. As energy management can be considered an optimization problem, conventional planning methods were applied to the problem, such as dynamic programing, genetic algorithm (GA), and particle swarm optimization (PSO), etc. A hybrid genetic particle swarm optimization (GPSO) algorithm was proposed to optimize the parameters of energy management strategy [5]. In order to solve the problem of frequent start-stop of electric vehicle engines, a nondominant sequencing genetic algorithm was used to optimize the start-stop interval of engines. The optimization effect of the running time of the extender under the two control modes of early opening and early closing is analyzed, in new European driving cycle (NEDC), urban dynamometer driving schedule (UDDS) cycles [6]. Energy management strategy of E-REV based on dynamic programming was designed, and optimal control rules of extender start-stop corresponding to SOC and motor power were established [7]. Driving behavior based on prediction of vehicle speeds was integrated into the energy management of the electric vehicle [8].
In recent years, with the unprecedented development of bionic optimization, a series of novel algorithms have emerged [9][10][11][12][13][14][15][16][17]. These include the teaching and learning optimization algorithm (TLBO, 2011) and its variants, the grey wolf optimizer (GWO, 2014) and its variants, the pigeon swarm algorithm (PSA, 2014), the whale optimization algorithm (WOA, 2016) and the bird swarm algorithm (BSA, 2016). Compared with GA, PSO and other mature algorithms, the optimization performance of these new bio-derived algorithms has been greatly improved. Therefore, the application of these algorithms in engineering attracted the attention of researchers.
The BSA as a novel algorithm, simulates the foraging behavior, defensive behavior and flight behavior of birds. It has the advantages of few parameters and it is easy to adjust. This paper extends the basic idea proposed in [17]. We propose a new method called BSAII with new coefficients for evaluating birds' ability to reach to the center. Then solve the optimization problem of engine on-off control in E-REV with the proposed algorithm. The energy management of E-REV has always been a research hotspot [1][2][3]. Under the different driving conditions, the on-off time of RE for the E-REV is optimized with the target distance as the constraint condition. The main principle of the E-REV energy management strategy is that the use of engine is as little as possible as well as keeps the vehicle running in pure electric mode. The traditional control strategy is that when the battery power reaches the minimum threshold, the vehicle enters the extended range mode, the engine starts and drives the generator to produce electricity. Part of the generated electricity charges the battery, and the other part drives the vehicle to continue driving. When the battery power reaches the maximum threshold, the engine shuts down and vehicle enters the pure electric drive mode.
Control method like fuzzy control has been adopted in the energy management. It has been used for powering the battery, to keep the state of charge (SOC) in the designed threshold and avoid overcharge and over discharge [4]. As energy management can be considered an optimization problem, conventional planning methods were applied to the problem, such as dynamic programing, genetic algorithm (GA), and particle swarm optimization (PSO), etc. A hybrid genetic particle swarm optimization (GPSO) algorithm was proposed to optimize the parameters of energy management strategy [5]. In order to solve the problem of frequent start-stop of electric vehicle engines, a non-dominant sequencing genetic algorithm was used to optimize the start-stop interval of engines. The optimization effect of the running time of the extender under the two control modes of early opening and early closing is analyzed, in new European driving cycle (NEDC), urban dynamometer driving schedule (UDDS) cycles [6]. Energy management strategy of E-REV based on dynamic programming was designed, and optimal control rules of extender start-stop corresponding to SOC and motor power were established [7]. Driving behavior based on prediction of vehicle speeds was integrated into the energy management of the electric vehicle [8].
In recent years, with the unprecedented development of bionic optimization, a series of novel algorithms have emerged [9][10][11][12][13][14][15][16][17]. These include the teaching and learning optimization algorithm (TLBO, 2011) and its variants, the grey wolf optimizer (GWO, 2014) and its variants, the pigeon swarm algorithm (PSA, 2014), the whale optimization algorithm (WOA, 2016) and the bird swarm algorithm (BSA, 2016). Compared with GA, PSO and other mature algorithms, the optimization performance of these new bio-derived algorithms has been greatly improved. Therefore, the application of these algorithms in engineering attracted the attention of researchers.
The BSA as a novel algorithm, simulates the foraging behavior, defensive behavior and flight behavior of birds. It has the advantages of few parameters and it is easy to adjust. This paper extends the basic idea proposed in [17]. We propose a new method called BSAII with new coefficients for evaluating birds' ability to reach to the center. Then solve the optimization problem of engine on-off control in E-REV with the proposed algorithm.
The rest of paper will be organized as follows. Section 2 will outline the background to BSA, the formulation of motions for BSA, and its variants. We also propose another formulation of defense behavior of birds and explain the workflows of optimization with BSAII. Section 3 formulates the energy management in E-REV. Section 4 conducts extensive optimizing simulation, and analyzes the experiment results. Section 5 will present the experiment results of the application of BSAII on energy management of E-REV. Conclusions are drawn at the end of the paper.

Bird Swarm Intelligence
Bird swarm foraging is easier to collect more information than individual foraging. It has survival advantages and good foraging efficiency. BSA is inspired by foraging behavior, defense behavior and flight behavior in the foraging process of birds. It is based on information sharing mechanism and search strategy in the foraging process of birds. The core of social behaviors and interactions in the bird swarm put forward a novel optimization algorithm BSA. Ideally, the basic principles of BSA can be elaborated as the following five rules [17].
(1) Each bird freely converts between defense and foraging behavior, which is a random behavior.
(2) In the process of foraging, each bird can record and update its own optimal information and global optimal information about the food. This information is used to find new sources of food. At the same time, the whole population share the social information. (3) During the defense, each bird tries to move toward the center, but this behavior is influenced by competition among populations. Birds with high alertness are more likely to approach the center than low-alert birds. (4) The swarm flies to another place each time. The identity of a bird converts between a producer and a beggar. That is, the most alert bird becomes a producer, while the lowest alert birds become a beggar. Birds with alertness between the two birds randomly become producers or beggars. (5) Producers actively seek food, and beggars follow the producers at random.
The above five rules are described in mathematical terms as follows: We suppose the size of the swarm is M, the number of dimensions is N. Foraging behavior in rule (1) is formulated; x t+1 where, x t i is the position of each bird, t represents the current number of iterations, i =1, 2 . . . M. c 1 and c 2 are non-negative constants which represent cognitive and social acceleration coefficients independently. r 1 and r 2 are the random numbers with uniform distribution in [0,1]. p i and g record the historical optimal location of the ith bird and the historical optimal location of the whole swarm respectively.
According to the Rule (3), birds in the swarm are trying to get close to the central area, but there is a competitive relationship between birds. These behaviors can be expressed as follows; Among them, a 1 and a 2 are the constants of [0,2], pFit i represents the optimal value of the ith bird, sumFit represents the sum of the optimal value of the whole swarm. ε is the smallest real number in a computer. mean j is average value of positions in the jth dimension. r 3 is the random number between (0, 1), r 4 is the random number between (−1, 1). k i. A 1 controls a bird approaching to center position of the whole swarm and A 1 r 3 ∈(0,1). A 2 represents the competitiveness of ith bird versus kth bird. The greater A 2 means compared with ith bird, the kth bird is more likely to move to the center of the swarm. According to the Rule (4), every once in a while FQ, birds may fly to another place for seeking food, some birds may become producers, others will become beggars, behavior of producers and beggars are regulated their new position according to; r 5 is a Gaussian random number that satisfies the variance of 0 and the mean of 1. r 6 is the random number between (0, 1), and FL stands for the beggars getting food information from producers, FL∈[0,2]. The workflow of BSA for solving optimization problem is illustrated as Figure 2. According to the Rule (4), every once in a while FQ, birds may fly to another place for seeking food, some birds may become producers, others will become beggars, behavior of producers and beggars are regulated their new position according to; r5 is a Gaussian random number that satisfies the variance of 0 and the mean of 1. r6 is the random number between (0, 1), and FL stands for the beggars getting food information from producers, FL∈ [0,2]. The workflow of BSA for solving optimization problem is illustrated as Figure 2.

Related Improvement Methods
As a relatively new optimization algorithm, there is not much research on improvement of BSA. The algorithm is improved by defining inertia weight, with linear differential decline strategy, and linearly adjusting cognitive coefficient and social coefficient. Then different models are optimized

Related Improvement Methods
As a relatively new optimization algorithm, there is not much research on improvement of BSA. The algorithm is improved by defining inertia weight, with linear differential decline strategy, and linearly adjusting cognitive coefficient and social coefficient. Then different models are optimized [18]. Levy flight strategy is applied to position initialization or iteration of BSA [19][20][21]. In [20], the random walk mode of Levy flight strategy increased the diversity of population and conduced to jumping out of local optimum. Inertia weight modified by random uniform distribution improved the search ability of BSA, besides, linear adjustment of cognitive and social coefficients was used to improve the solution accuracy. Boundary constraints were adopted to modify candidate solutions outside or on the boundary in the iteration process, which improves the diversity of groups and avoids premature problems. On the other hand, accelerated foraging behavior by adjusting the sine-cosine coefficients of cognitive and social components was achieved in [22].

BSAII
In the defensive state, a bird should not only move to the center as far as possible, but also compete with other neighbors. The parameters A 1 and A 2 are two factors that reflect ability of a bird moving to the center and competition with its neighbor bird respectively. In the traditional version of BSA, the fitness function was used to evaluate the weight coefficients of birds flying towards the center and affected by other birds. The function is one-dimensional, based on which the central position of the bird swarm is not accurate.
In this paper, we use spatial coordinates of birds to formulate A 1 and A 2 . Based on the position of the bird group's center coordinate, the European distance between a bird's position and the center is calculated separately, and the traction and competitiveness of a bird flying toward the center are judged. We used other representations as; where pd i is the normalized Euclidean distance between coordinates of a bird p i and the center of the swarm meanp.
An example of normalized Euclidean distance is shown in Figure 3. The red points are the four coordinate positions distributed in two-dimensional space, and the blue pentagonal star represents the central position determined by the average coordinate values of the four points, which is considered as the center point of the swarm. Pd 1 -pd 4 in the figure mean the normalized Euclidean distance between four points and the center one, which range from 0 to 1.
Foraging and flying behaviour are formulized as Equations (1), (5) and (6), the same as in the previous version of BSA.
Initially, we set parameters, i.e., maximum number of iterations T, size of population M, flying interval FQ, c 1 , c 2, a 1 and a 2 , and created populations x randomly.
For each cycle, within each time interval, we only need to consider two behaviours of birds, foraging and defence. A bird behaviour is determined randomly, if the bird is looking for food, it would update position using Equation (1). Otherwise, the bird is on the defensive, and tries to move to the centre of the swarm. As each bird wants to fly to the centre, it is inevitable to compete with others. We used A 1 and A 2 related to normalized European distance to evaluate centralized flight of the bird, shown as Equations (7) and (8). Meanwhile the new position is regulated via Equation (2). If the swarm stays at one site for FQ, it needs to move to the next location as a whole. In the flying process, each bird plays a different role, i.e., beggar or producer. Birds move to new positions according to Equations (5) and (6) respectively. The outline of BSAII can be written as Algorithm 1.
An example of normalized Euclidean distance is shown in Figure 3. The red points are the four coordinate positions distributed in two-dimensional space, and the blue pentagonal star represents the central position determined by the average coordinate values of the four points, which is considered as the center point of the swarm. pd1-pd4 in the figure mean the normalized Euclidean distance between four points and the center one, which range from 0 to 1.  (1), (5) and (6), the same as in the previous version of BSA. Initially, we set parameters, i.e., maximum number of iterations T, size of population M, flying interval FQ, c1, c2, a1 and a2, and created populations x randomly.
For each cycle, within each time interval, we only need to consider two behaviours of birds, foraging and defence. A bird behaviour is determined randomly, if the bird is looking for food, it would update position using Equation (1). Otherwise, the bird is on the defensive, and tries to move to the centre of the swarm. As each bird wants to fly to the centre, it is inevitable to compete with others. We used A1 and A2 related to normalized European distance to evaluate centralized flight of the bird, shown as Equations (7) and (8). Meanwhile the new position is regulated via Equation (2). If the swarm stays at one site for FQ, it needs to move to the next location as a whole. In the flying process, each bird plays a different role, i.e., beggar or producer. Birds move to new positions according to Equations (5) and (6) respectively. The outline of BSAII can be written as Algorithm 1. Step 2: Initialize the original positions of birds, Step 3: Calculate the fitness function f(xi), find local and global optimal solutions.
Step 4: For r = 1:T 1 While r is not an exact multiple of FQ do If (Pi<P) Bird forages for food according to Equation (1). Otherwise Bird conducts defensive action based on Equations (2), (7), and (8). End if End while 2 Bird swarm is divided as producers and beggars, and flying to other site. The producers fly to new position of Equation (5), and the beggars follow the producers moving to Equation (6). 3 Calculate the fitness function f(xi), update the local and global optimal solutions.
Step 5: Output the optimal results.

Energy Management of E-REV
Energy management of E-REV in this paper mainly refers to optimize the on-off timing of RE in E-REV so as to reduce the running time of engine. This problem can be mathematically summed up as a constrained objective optimization problem. In this paper, the penalty function method is used to solve this optimization problem.

Constrained Optimization Problem
Optimization problem with constraints is formulized as, ℎ and are equality and inequality constraints respectively. The feasible region Ω of the problem is defined as Ω = ∈ ℎ ( ) = 0, ( ) ≥ 0 . A popular method to solve constrained optimization problems is penalty function method. The penalty function [23] is constructed as;

Energy Management of E-REV
Energy management of E-REV in this paper mainly refers to optimize the on-off timing of RE in E-REV so as to reduce the running time of engine. This problem can be mathematically summed up as a constrained objective optimization problem. In this paper, the penalty function method is used to solve this optimization problem.

Constrained Optimization Problem
Optimization problem with constraints is formulized as, h i and g j are equality and inequality constraints respectively. The feasible region Ω of the problem is defined as Ω = x ∈ R n h i (x) = 0, g j (x) ≥ 0 . A popular method to solve constrained optimization problems is penalty function method. The penalty function [23] is constructed as; Therefore, the objective function is transformed to; where δ > 0 is penalty factor. The bigger δ is, the heavier the punishment will be. When x∈Ω, x is a feasible point, P(x,δ) = f (x), the objective function is not subject to additional penalties. While x Ω, x is an infeasible point, P(x,δ) > f (x), the objective function is subject to additional penalties. When the penalty exists in the objective function, the penalty function should be sufficiently small to make P(x,δ) reach the minimum value, so that the minimum point of P(x,δ) approximates the feasible region Ω sufficiently, and its minimum value naturally approximates the minimum value of f (x) on Ω sufficiently. The constrained optimization problem converts to unconstrained optimization problem, which is expressed as; min P(x, δ k ) (13) here δ k is positive sequence, and δ k → +∞ .

Problem Formulation
A certain type of electric vehicle is selected as research object, and basic parameters of vehicle are the same with that in [24]. Assuming that the SOC of battery power in electric vehicle should be kept between 20% and 80%. In order to reduce the uptime of engine in E-REV, and make full use of the power in the battery, this paper optimizes the uptime of the engine with constraint of distance. The objective function of the optimization problem is engine running time t, defined as Equation (14); T cycle is the time period, and L is the driving distance under one test condition, e.g., the NEDC cycle. We choose an E-REV as research object, whose main parameters are listed in Table 1. cycle condition was selected. The simulation results including SOC change curve under the NEDC cycle were obtained. The results showed an approximate linear relationship between the driving distance of electric vehicles and the SOC of battery.
x is SOC, %. y is driving distance of E-REV, km. k and b are constant coefficients, in relation to battery working mode. When driving distance can be accomplished with one charge and discharge cycle, the distance when engine starts and shuts down are calculated based on Equations (16) and (17).
t on and t off are timing of engine start-up and shutdown independently, which are represented as SOC.
The equality constraint is the requirement of trip range distance D, k i , i = 1,2,3, are driving distance per unit charge under different conditions, the specific values are shown in Table 2.
When the target distance exceeds one charge and discharge cycle, the engine repeatedly starts and closes. If there are n charge and discharge cycles in the whole trip. Evaluation is processed based on total uptime of the engine.
The target trip distance is calculated as Equation (20).

Computational Experiment
In order to verify the effectiveness of BSAII algorithm, 20 benchmark functions were used in computational experiments, including unimodal and multimodal examples [25,26]. BSA, particle swarm optimization (PSO), artificial bee colony (ABC) and differential evolution (DE) were used as algorithms for comparison. In general, two aspects were taken into account to evaluate performance of algorithms: (1) proximity to the real optima in single operation, and (2) stability and accuracy of optimal results using different algorithms in multiple operations. Tables 3 and 4  other cases were 20. The number of iterations was set to 1000. Other parameters used in simulation were tuned according to Table 5. FQ is the flying interval, and this was set to three. FL is the following coefficient, and this value was a random number between 0.5 and 0.9. c 3 and c 4 are acceleration constants. w is inertia weight linearly decreasing from 0.9 to 0.5 [27]. CR is crossover probability, and F is the mutation rate [28]. f oodnumber is the number of the food sources which is equal to the number of employed bees. limit is a predetermined number of cycles [29]. All algorithms were programmed with MATLAB 2018a. The simulation environment was on a computer with Intel ® core ™ i5-8400 CPU @ 2.80 GHz.  Id. Function First of all, each algorithm ran once with 1000 iteration independently. Convergence performance on 20 benchmark functions is shown in Figure 4. Based on the graphical results, except for f 11 , f 14 , and f 19 , BSAII could reach the real optima in other 17 functions. In addition, better results can be obtained by BSAII, compared with other four algorithms. Therefore, it can be shown that the performance of BSAII algorithm outperforms other algorithms.
Additionally, each algorithm was independently performed for 50 times on 20 test instances. Due to randomness of initial solutions for all algorithms, multiple performance indexes were used for comparing the performance of BSAII with different algorithms. Table 6 gives the minimum (MIN), maximum (MAX), mean (MEAN) and standard variation (SD) of 50 trials on each case. We can make the following remarks from results of Table 6: 1.
On instances of f 1~f 7 , f 12 , f 17 , and f 20 , BSAII performed better than other algorithms, in terms of convergence rate and accuracy of optimal solution. Since the four indexes had the smallest values compared with these obtained by other algorithms.

2.
On instances of f 8 , it was evident that both BSAII and DE could get the real optima (0 in Table 3), better than the other algorithms.

3.
On instances of f 9 and f 10 , BSAII and BSA were better than PSO, ABC, and DE in terms of performance indexes.

4.
On instances of f 13 , f 15 and f 18 , BSAII, BSA and DE converged to the real optimal value, with the same accuracy. But the convergence rate of BSAII and BSA in the early stage was faster than DE.

5.
Only on instance of f 11 , DE acquired the best performance over other algorithms. Solutions found by BSAII and BSA occasionally fell into local optimum. 6.
Only on instance of f 16 , BSA converged to the real optimal value (-3600) every time. It was obvious that BSA was better than the other algorithm on this example. While BSAII fell into local optimum at times and was not convergent to -3600. But the average value of 50 trials was closer to the optimum than that obtained by other algorithms. 7.
The statistical results of f 14 and f 19 were somewhat complicated. The minimum of optimal fitness on f 19 was found by BSAII, but the other three performance indexes of MAX, MEAN, and SD were slightly worse than in DE. BSAII would fall into local optimum when solving benchmark function of f 14 .
Overall, we claimed that BSAII produced better convergence and more stable performance than BSA, PSO, ABC, and DE, in most cases.  Figure 4. Convergence of benchmark functions using BSAII, BSA, particle swarm optimization (PSO), artificial bee colony (ABC) and differential evolution (DE).

Optimization of On-Off Control Mode
This paper selects NEDC condition for research. The NEDC working condition test consists of two parts: the urban operation cycles and the suburban operation cycle ( Figure 5). The urban operation cycle consisted of four urban operation cycle units. The test time of each cycle unit was 195 s, including idling, starting, accelerating and decelerating parking stages. The driving distance of the whole NEDC was 10.93 km and the testing time was 1184 s. The maximum velocity was 120 km/h, and average velocity was 33 km/h.

Optimization of On-Off Control Mode
This paper selects NEDC condition for research. The NEDC working condition test consists of two parts: the urban operation cycles and the suburban operation cycle ( Figure 5). The urban operation cycle consisted of four urban operation cycle units. The test time of each cycle unit was 195 s, including idling, starting, accelerating and decelerating parking stages. The driving distance of the whole NEDC was 10.93 km and the testing time was 1184 s. The maximum velocity was 120 km/h, and average velocity was 33 km/h. In this paper, two instances with different target distances for E-REV are analyzed. One is shortdistance driving, in which the battery can complete the trip with one charge-discharge cycle. Another case is long-distance driving, and the battery needs multiple charge-discharge processes.

Distance = 100 km
The control strategy was to start the engine and recharge the battery when the power reduced to 20%, and shut down the engine when the battery was charged to 80%. According to the established model, the driving distance of the vehicle at engine start-up was 58 km. The driving distance of the vehicle was 80km when engine was shut down ( Table 7). The engine was working in a full chargedischarge cycle, the uptime of the engine in E-REV was 2383 s. Figure 6 shows the variation of SOC. It can be observed from the figure, that when the battery dropped to 52% after charging, the vehicle's distance reached 100 km.  In this paper, two instances with different target distances for E-REV are analyzed. One is short-distance driving, in which the battery can complete the trip with one charge-discharge cycle. Another case is long-distance driving, and the battery needs multiple charge-discharge processes.

Distance = 100 km
The control strategy was to start the engine and recharge the battery when the power reduced to 20%, and shut down the engine when the battery was charged to 80%. According to the established model, the driving distance of the vehicle at engine start-up was 58 km. The driving distance of the vehicle was 80km when engine was shut down ( Table 7). The engine was working in a full charge-discharge cycle, the uptime of the engine in E-REV was 2383 s. Figure 6 shows the variation of SOC. It can be observed from the figure, that when the battery dropped to 52% after charging, the vehicle's distance reached 100 km.

Distance = 200 km
The distance exceeded 124 km, so more than one charge and discharge cycles would be repeated in the process of driving motion. According to Equation (20), there were three incomplete chargedischarge cycles. Working time of engine during vehicle in motion was 5959 s ( Table 8). The SOC curve is shown as Figure 7. From the figure, it is evident that vehicle completed the target distance in the charging mode, while the battery SOC reached 50%.

Distance = 200 km
The distance exceeded 124 km, so more than one charge and discharge cycles would be repeated in the process of driving motion. According to Equation (20), there were three incomplete charge-discharge cycles. Working time of engine during vehicle in motion was 5959 s ( Table 8). The SOC curve is shown as Figure 7. From the figure, it is evident that vehicle completed the target distance in the charging mode, while the battery SOC reached 50%.

Distance = 100 km
BSAII was adopted to minimize the working time of engine so as to reduce fuel consumption and gas pollution. The trip distance was set to 100 km. The optimization problem and the constraints satisfied Equations (14)- (17). The number of iterations was set to 1000. Start-up and shut-down time of engine can be obtained by simulation, which are shown in Table 9. According to Table 9, it was obviously found that the early shutdown of the engine could help reduce fuel consumption and

Distance = 100 km
BSAII was adopted to minimize the working time of engine so as to reduce fuel consumption and gas pollution. The trip distance was set to 100 km. The optimization problem and the constraints satisfied Equations (14)- (17). The number of iterations was set to 1000. Start-up and shut-down time of engine can be obtained by simulation, which are shown in Table 9. According to Table 9, it was obviously found that the early shutdown of the engine could help reduce fuel consumption and exhaust emissions of engine. The trade-off relation between the working time t with iterations is shown in Figure 8. The variation of SOC in the battery can be observed in Figure 9. The working time reduced to 36.4%, compared with the traditional control strategy. BSAII was adopted to minimize the working time of engine so as to reduce fuel consumption and gas pollution. The trip distance was set to 100 km. The optimization problem and the constraints satisfied Equations (14)- (17). The number of iterations was set to 1000. Start-up and shut-down time of engine can be obtained by simulation, which are shown in Table 9. According to Table 9, it was obviously found that the early shutdown of the engine could help reduce fuel consumption and exhaust emissions of engine. The trade-off relation between the working time t with iterations is shown in Figure 8. The variation of SOC in the battery can be observed in Figure 9. The working time reduced to 36.4%, compared with the traditional control strategy.   When the target distance was set to 200 km, it meant that the engine needed to be turned on and off repeatedly. The working hours of engine was calculated using Equation (19), and the distance constraint was formulized as Equation (20). The optimal on-off mode found by BSAII is illustrated in Table 10. According to the results, there were three charge-discharge cycles during driving process.

Distance = 200 km
When the target distance was set to 200 km, it meant that the engine needed to be turned on and off repeatedly. The working hours of engine was calculated using Equation (19), and the distance constraint was formulized as Equation (20). The optimal on-off mode found by BSAII is illustrated in Table 10. According to the results, there were three charge-discharge cycles during driving process. In the last cycle, the engine turned off when SOC in battery reached 30%, and the electric power

Distance = 200 km
When the target distance was set to 200 km, it meant that the engine needed to be turned on and off repeatedly. The working hours of engine was calculated using Equation (19), and the distance constraint was formulized as Equation (20). The optimal on-off mode found by BSAII is illustrated in Table 10. According to the results, there were three charge-discharge cycles during driving process. In the last cycle, the engine turned off when SOC in battery reached 30%, and the electric power which was just enough to complete the entire distance (200 km). The convergence curve in the optimization problem is shown as Figure 10. After optimization, the total running time of engine was 5168 s, a 13% reduction in contrast to 5959 s under the traditional control strategy. The SOC of the battery power for electric vehicles while the car was in motion is shown in Figure 11. In the last cycle, the engine turned off when SOC in battery reached 30%, and the electric power which was just enough to complete the entire distance (200 km). The convergence curve in the optimization problem is shown as Figure 10. After optimization, the total running time of engine was 5168 s, a 13% reduction in contrast to 5959 s under the traditional control strategy. The SOC of the battery power for electric vehicles while the car was in motion is shown in Figure 11.

Conclusions
This paper proposed another version of BSA, named as BSAII. In the version of BSAII algorithm, the spatial coordinates of birds in solution-space instead of the fitness function were used to determine the distance from the center of the whole bird group. Based on this method, the coefficients A1 and A2 were more accurate than that in BSA. We examined the performance of two different representations of defense behavior for BSA algorithms, and compared their experimental results

Conclusions
This paper proposed another version of BSA, named as BSAII. In the version of BSAII algorithm, the spatial coordinates of birds in solution-space instead of the fitness function were used to determine the distance from the center of the whole bird group. Based on this method, the coefficients A1 and A2 were more accurate than that in BSA. We examined the performance of two different representations of defense behavior for BSA algorithms, and compared their experimental results with other bio-inspired algorithms, including PSO, ABC, and DE. It was evident from the statistical and graphical results highlighted that the BSAII outperformed other algorithms on most of the

Conclusions
This paper proposed another version of BSA, named as BSAII. In the version of BSAII algorithm, the spatial coordinates of birds in solution-space instead of the fitness function were used to determine the distance from the center of the whole bird group. Based on this method, the coefficients A 1 and A 2 were more accurate than that in BSA. We examined the performance of two different representations of defense behavior for BSA algorithms, and compared their experimental results with other bio-inspired algorithms, including PSO, ABC, and DE. It was evident from the statistical and graphical results highlighted that the BSAII outperformed other algorithms on most of the instances, in terms of convergence rate and accuracy of the optimal solution. Besides this, it was the first time that BSAII has been applied to the energy management of electric vehicles, which helps to reduce engine fuel consumption and exhaust emissions. Based on the analysis in the previous section, it is clear that: • The BSAII performed statistically superior to or equal to the BSA on 16 benchmark problems. On these problems, it obtained the real optimal solution. However, in the case of Rosenbrock function (f 14 ), it was prone to falling into local optimum.

•
The energy management of electric vehicles in this paper referred to minimization uptime of RE. The uptime was determined by the time interval between engine on and off. Two instances with different target driving distances were optimized with BSAII. Results indicated that the uptime of engine could be reduced by 36.4% with a target distance of 100 km, and 13% with a target distance of 200 km, respectively, in the NEDC condition. Hence we can draw a conclusion that based on the optimization strategy of BSAII, the on/off timing of the engine can be accurately controlled, which can effectively shorten the uptime of the engine, reduce fuel consumption and exhaust emissions, and also facilitate the next external charging.
It is hoped that in future work, more approaches will be designed to avoid the problem of local optimum, without sacrificing the convergence rate in BSA.

Conflicts of Interest:
The authors of the manuscript declare no conflicts of interest with any of the commercial identities mentioned in the manuscript.