## 5 Experimental and Results
### Particle Swarm Optimization  
Particle swarm optimization was developed by [PERSON] and [PERSON] in 1995. [PERSON] and [PERSON] proposed the computation technique based on the social behavior of swarms of ants, fish and birds to find the location of food. The individual of swarms, called the particle, will share the information of the location of food. The shared information is the intelligence or the knowledge of the particle. The knowledge of the particle is also the swarm knowledge and intelligence. Each individual or particle in a swarm behaves in a distributed way using its own intelligence and the collective or group intelligence of the swarm. As such, if one particle discovers a good path to food, the rest of the swarm will also be able to follow the good path instantly, even if their location is far away in the swarm [26].  
The initial input (\(u_{0}(k)\)) and output data (\(y_{0}(k)\)) are taken from one-shot experimental data with the initial PI-P gain parameters \(q^{0}=\left[K_{P1}\ K_{P2}\ K_{I}\right]^{T}\) (\(q^{0}\) is a matrix of initial PI-P controller parameters where \(K_{P1}\), \(K_{I}\) and \(K_{P2}\) are proportional, integral and proportional gains, respectively). Because the PSO algorithm is used for FRIT optimization, the data are treated as numbers of particles \(n\), where each particle consists of PI-P gains organized in a matrix. Each particle is updated using personal best (Pbest) and global best (Gbest) values in each iteration. Pbest is the best position achieved by a particle to date, and Gbest is the best position achieved by any particle. The velocity and position of the particle are updated after the values of Pbest and Gbest have also been updated. Pbest and Gbest are updated using Equation (56) and Equation (57). The velocity is updated using Equation (58), and position is updated using Equation (62). Figure 10 shows the flowchart of the PSO algorithm for FRIT optimization.  
The algorithm of PSO for FRIT optimization is described as follows:  
Step 1: input:  
- Input data \(u_{0}(k)\), output data \(y_{0}(k)\) and reference data \(M(k)\).  
- Determine the minimum and maximum value of speed and position of the particle.  
- Number of iterations.  
- Set matrix position, velocity, Pbest and Gbest.  
Step 2: process:  
For each particle \(k\) = 1,2,3,...,N in the \(i\)-th iteration,  
- The PI-P controller is calculated using:  
\[C_{1}(q_{1k}(i),z)=z\left(C_{1}\left(q_{1k}(i)\,,s\right)\right) \tag{50}\]  
\[C_{1}\left(q_{1k}\left(i\right),s\right)=K_{P1k}\left(i\right)\left\{1+\frac{K _{lk}\left(i\right)}{s}\right\} \tag{51}\]  
\[C_{2}\left(q_{2k}\left(i\right)\right)=K_{P2k}\left(i\right) \tag{52}\]  
- The fictitious reference signal is calculated using:  
\[\widetilde{r}\left(q_{k}\left(i\right),k\right)=C_{1}\left(q_{1k}\left(i \right),z\right)^{-1}u_{0}\left(k\right)+\ C_{1}\left(q_{1k}\left(i\right),z \right)^{-1}y_{0}\left(k\right)C_{2}\left(q_{2k}\left(i\right)\right)+y_{0} \left(k\right) \tag{53}\]  
The maximum number of iterations is considered to end the loop and to stop the iterations. The performance index is not considered to end the loop because there is no standard value of the performance index to obtain the optimal controller parameter. In this paper, 100 iterations are used to obtain the optimal controller parameters, because the state of controllers searched by FRIT becomes saturated if the number of iterations is more than 100 iterations.  
Figure 10: Flowchart of PSO (particle swarm of optimization) algorithm for FRIT.