3.3.1. Initialization and Parameter Setting

Initially, four particles were generated randomly. In this research, vehicle performance was improved by optimizing the instantaneous fuel consumption and the engine torque was applied as the particle's position. The particles' initial position and speed were assigned as follows.

$$
\begin{bmatrix} \mathbf{x}\_1^t & \mathbf{x}\_2^t & \mathbf{x}\_3^t & \mathbf{x}\_4^t \end{bmatrix} = \begin{bmatrix} \ T\_{E,1}^t & T\_{E,2}^t & T\_{E,3}^t & T\_{E,4}^t \end{bmatrix} = \begin{bmatrix} 0 & 10 & 20 & 30 \end{bmatrix} \tag{14}
$$

$$
\begin{bmatrix} v\_1^t & v\_2^t & v\_3^t & v\_4^t \end{bmatrix} = \begin{bmatrix} -1 & -2 & 2 & 4 \end{bmatrix} \tag{15}
$$

The lower speed limit, *v<sup>t</sup> <sup>i</sup>*,min, and upper speed limit, *vt <sup>i</sup>*,max, were set between (–10–10). If the value of the speed vector was too large, it would cause the particles to jump out of the area with a good solution. If the value of the speed vector was too small, it would cause the particles to fall into the local minimum value. For the better solution, the particle speed was usually set to 10–20% of the search range [18]. The learning factors were both set as 2.

### 3.3.2. Evaluate Each Particle

The objective value of each particles position was measured. In the initial state, random particles were first moved by the random speed and the updated position of the particles was compared with the initial random position to obtain the local optimal position, *Pbest*. Then, based on their own experience and group experience among the particles, the particles moved to the new positions. To avoid unreasonable particle positions and over-charge or over-discharge of the battery, some constraints were set as follows.

$$0 < T\_E < 220\tag{16}$$

$$0.4 < \text{SOC} < 0.6\tag{17}$$
