*3.2. PSO Algorithm Applied to Hybrid Electric Power System*

This research implemented PSO to find the minimum instantaneous fuel consumption at each driving moment. The process of the PSO algorithm is described as follows.

1. Initialization: This research applied engine torque as the initial particle position. The initial flying speed was randomly generated. To avoid exceeding the operational range of engine torque during the algorithm search process, the constrained equations were included in the simulation. The engine torque constrained condition is shown in Equation (9). Since the PSO algorithm did not have a practical mechanism to control the speed of the particles, the constrained condition was set for the speed Equation (10). During the particle search process, the battery SOC must be ensured to avoid over-charging and over-discharging. The constrained equation for the SOC upper and lower limits is shown in Equation (11).

$$T\_{E, \text{min}} < T\_E < T\_{E, \text{max}} \tag{9}$$

$$
\upsilon\_{i, \text{min}}^t < \upsilon\_i^t < \upsilon\_{i, \text{max}}^t \tag{10}
$$

$$\text{SOC}^{t}\_{i,\text{min}} < \text{SOC}^{t}\_{i} < \text{SOC}^{t}\_{i,\text{max}} \tag{11}$$

where *TE* is the engine torque, *vi* is the particle speed, and *SOCi <sup>t</sup>* is the battery state of charge at time t, *TE,min* is the lower limit of engine torque, *TE,max* is the upper limit of engine torque, *vi,min* is the lower limit of particle speed, *vi,max* is the upper limit of particle speed, *SOCt i,min* is the lower limit of the SOC, and *SOCt i,max* is the upper limit of the SOC.

2. Apply the objective function: In order to improve the performance of the system, a suitable objective function was designed to allow particles to search for the objective value. The lowest instantaneous equivalent fuel consumption was the best solution of this optimization problem. So, instantaneous equivalent fuel consumption was applied as the objective function as in Equation (12).

$$F\_{\alpha bj} = \dot{m}\_{cq} + \beta = \dot{m}\_c (T\_{E,} \omega\_E) + \mathcal{W}(SOC)\dot{m}\_b + \beta \tag{12}$$

where . *meq* is the sum of the instantaneous equivalent fuel consumption, . *me*(*TE*, ω*E*) is the instantaneous fuel consumption of the engine, . *mb* is the equivalent fuel consumption of the battery's electrical energy, β is a penalty value to avoid the particle searching process violating restrictions, and *W(SOC)* is the weight factor to prevent the power of the battery from being depleted.

The instantaneous fuel consumption of electric power was calculated by Equation (13). The battery power consumption was converted to the equivalent fuel consumption, . *mb*, by the engine BSFC corresponding to the engine torque and speed.

$$\dot{m}\_b = \frac{\left(\zeta\_{\text{discharge}} \ast \overline{\text{BSFC}} \ast \frac{P\_{\text{MG}}}{\eta\_{\text{laut}} \ast \eta\_{\text{lAG}}} + \zeta\_{\text{charge}} \ast \overline{\text{BSFC}} \ast P\_{\text{MG}} \ast \eta\_{\text{laut}} \ast \eta\_{\text{lMG}}\right)}{1000 \ast 3600} \tag{13}$$

where . *mb* is the conversion of battery power consumption into equivalent fuel consumption, *BSFC* is the BSFC corresponding to engine torque and speed, *PMG* is the electric motor power, η*batt* is the battery operating efficiency, η*batt* is the electric motor working efficiency. ζ*discharge* is the battery discharge factor, and ζ*charge* is the battery charge factor.

