**Step 2: Fitness evaluation**

The corresponding fitness values of the particles are evaluated**. Step 3: Determination of personal and global best**

The best individual location of a particle (*P* ! *<sup>1</sup>*) is sorted, the particle having the best fitness value is determined for the current generation, and the best location ( *g* ! *<sup>1</sup>*) is updated.

## **Step 4: Velocity and position update**

The velocity and position of the ith particle are updated based on Eq. (75).

Here, an example of the design and optimization of a shell and tube heat exchanger is presented. This example was used by Karimi et al. (2021) [36]. Their aim was to minimize the total annual cost (*Ctot*) for a shell and tube heat exchanger based on optimization algorithms. The total annual cost is the sum of the initial cost for the construction (*Ci*) of the heat exchanger and the cost of power consumption in the shell and tube heat exchanger (*Cod*). Hence, the total annual cost was considered as an objective function that should be minimized using GA and PSO. Process input data and physical properties for this case study are presented in **Table 4**. Also, bounds for design parameters are listed in **Table 5**. The objective function can be written as follows:

$$\mathbf{C}\_{\text{tot}} = \mathbf{C}\_{i} + \mathbf{C}\_{od} \tag{76}$$

The results show that the use of PSO has been led to lower Ctot, which means that the minimization of cost function was performed better using this algorithm. Also, the use of PSO resulted in lower Δp and A as well as higher U (**Table 6**).


**Table 4.**

*Process input data and physical properties for three case studies [36].*


**Table 5.** *Bounds for design parameters [36].* *Heat Exchanger Design and Optimization DOI: http://dx.doi.org/10.5772/intechopen.100450*


**Table 6.**

*Optimal parameter of heat exchanger using GA and PSO algorithms [36].*
