Research Article

Multi-UAV DMPC Cooperative Guidance with Constraints of Terminal Angle and Obstacle Avoidance

Algorithm 2

Pseudocode of PSO algorithm.
1:  // Initialization
2:  Set the parameters of the algorithm: , , , , population size , the maximum number of iterations , and maximum number of invalid iterations .
3:  Randomly generate the initial positions of particles , , which include the assumed control input sequence .
4:  Randomly generate the initial velocities of particles .
5:  Initialize the current iteration as and number of invalid iterations as .
6:  // Main loop
7:  while do
8:   for := 1 to do
9:     Correct using (91)
10:     Correct and obtain , with algorithm 1
11:     Calculate using (90)
12:     Determine the individual best position
13:   end for
14:   Determine the global best position
15:   Record the global best fitness value at current iteration
16:   if then
17:     
18:   else
19:     
20:   for := 1 to do
21:     Update the position of particle as , using (88)
22:     Update the velocity of particle as , using (89)
23:   end for
24:   Update the current iteration as
25:  end while
26:  Determine the optimal control input sequence at as
   
27:  //Results
28:  return