# Sequential Convex Programming for Nonlinear Optimal Control in UAV Trajectory Planning
## 3 Problem Formulation
### Sequential Convex Programming
Number of agents = 4 Simulation length = 30 s Discretization step-size, dt = 0.2 s Cost Threshold, \(f_{threshold}\) = 0.05 Run time for the first step of the algorithm = 4.86 s Total run time = 67 s 3 Number of agents = 6 Simulation length = 30 s Discretization step-size, dt = 0.2 s Cost Threshold, \(f_{threshold}\) = 0.05 Run time for the first step of the algorithm = 6.75 s Total run time = 94 s 4 Number of agents = 8 Simulation length = 30 s Discretization step-size, dt = 0.2 s Number of inequality constraints without distance constraints = 7200 Total number of inequality constraints with distance constraints = 11,400 Cost Threshold, \(f_{threshold}\) = 0.05 Number of iterations for convergence = 2 Run time for the first step of the algorithm = 10.85 s Total run time = 168 s Figure 2: **(a)** Trajectories for two quadcopters in the absence of collision avoidance constraints. **(b)** Collision-free trajectories for two quadcopters. Figure 3: (**a**) Trajectories for four quadcopters in the absence of collision avoidance constraints. (**b**) Collision-free trajectories for four quadcopters. Figure 4: (**a**) Trajectories for six quadcopters in the absence of collision avoidance constraints. (**b**) Collision-free trajectories for six quadcopters. Figures 5 and 6 show the variation of position and velocity as time of eight quadcopters in the absence of collision avoidance constraints. Figures 9 and 10 show the variation of position and velocity as time of eight quadcopters with collision-free constraints. During the execution of the second stage of the algorithm, the trajectories were automatically adjusted by the algorithm to prevent collision. Figures 2b, 3b, 4b and 8a,b demonstrate that deviation in the trajectories was minimal while ensuring that the trajectories did not intersect or collide. In these specific case studies, the minimum distance was defined as 1 m (d\({}_{\text{min}}\) = 1). Depending on the quadcopter's size and the size of the environment, this parameter was chosen accordingly. The selection of this parameter can be adjusted based on the dimensions of the quadcopter and the surrounding environment. Figure 11 shows the objective value plotted against the number of iterations. It can be seen from Figure 10 that the objective function value rose suddenly after the first iteration and continued to decrease from the second iteration onwards. This behavior was expected since, for the first iteration, the optimization problem was solved without the collision constraint. Following the first iteration, the collision constraint was taken into account, which reduced the objective value and resulted in a collision-free optimal trajectory. Figure 5: Trajectories for eight quadcopters in the absence of collision avoidance constraints. \[s.t.f_{i}(x)\leq 0,\forall i=1,2,\ldots,m\]0 Position vs. time of eight quadcopters in the absence of collision avoidance constraints. \[s.t.f_{i}(x)\leq 0,\forall i=1,2,\ldots,m\]1 Velocity vs. time of eight quadcopters in the absence of collision avoidance constraints. \[s.t.f_{i}(x)\leq 0,\forall i=1,2,\ldots,m\]2 (a) Collision-free trajectories for eight quadcopters. (b) Collision-free trajectories for eight quadcopters. \[s.t.f_{i}(x)\leq 0,\forall i=1,2,\ldots,m\]3 Velocity vs. time of eight quadcopters with collision-free constraints. \[s.t.f_{i}(x)\leq 0,\forall i=1,2,\ldots,m\]4 Position vs. time of eight quadcopters with collision-free constraints. ## 5 Conclusions

In this study, an algorithm is presented that enables the generation of collision-free trajectories for a multi-agent quadcopter fleet. The non-convex optimization problem was iteratively solved using sequential convex programming that approximates non-convex constraints by using convex constraints. Through the simulation, we can see that this method allows for quadcopters to take off from a given initial position and fly to the desired final position within a specified flight time. It is guaranteed that the quadcopters will not collide with each other.