Predeﬁned Location Formation: Keeping Control for UAV Clusters Based on Monte Carlo Strategy

: UAV formation keeping is an important research element due to its cooperative formation control. This study proposes a passive positioning model for UAVs based on the Monte Carlo strategy and provides a trajectory programming decision scheme based on the predicted calculation of deviated UAV predeﬁned endpoint locations, effectively improving the efﬁciency of UAVs performing formation-keeping tasks during ﬂight. Then, the simulation after sampling by Gaussian distribution is used to obtain the trajectory planning under simultaneous control of multiple cluster formations, and the feasibility, accuracy and stability of the proposed model are veriﬁed. This study provides useful guidance for UAV formation control applications


Introduction
In recent years, UAVs have been used in a wide range of military and civilian applications, such as for air transport [1], communication in areas affected by natural disasters [2], search and rescue [3], and magnetic measurements [4].UAV formation flying is an organizational model in which multiple UAVs are arranged in a certain formation and assigned according to the mission requirements when performing search and rescue, surveillance or coverage control missions [3,5].Its central concern is to keep the prescribed formation and fully utilize the aircraft's performance [6].This requires positioning adjustments for the UAV in flight.The passive location uses the UAV's signals for location rather than the UAV actively transmitting signals, which reduces the requirements for equipment and scenarios [7].The more stations there are located in the area, the higher their positioning accuracy and the more flexible they are in applications [8].Passive location technology has gradually become a trend in the field of air shows or electronic countermeasures.
UAV formation keeping is an integral part of UAV formation flight, and its essence is an optimization problem.When designing a formation keeping adjustment scheme for a UAV, its formation flight pattern is first determined.Then, an optimal UAV scheduling solution for returning UAVs to standard formation positions for formation flight is created based on the deviation of relative location and relative angle.UAV clusters can achieve effective and accurate location of UAVs by using four-station passive location [9].The other signals except for the signals emitted by these four UAVs are all electromagnetic interference.The current electromagnetic environment is becoming increasingly complex.To avoid interference from external signals, UAVs should maintain electromagnetic silence as much as possible and emit fewer electromagnetic wave signals to the outside [10].
Yao et al. [11] proposed an algorithm based on perturbed fluid and trajectory propagation to solve the three-dimensional path planning problem of UAVs in static environments.A.C. and D.D. [12] proposed a three-dimensional path planning scheme for UAVs based on the Reverse Firefly Swarm Optimization (RGSO) algorithm, based on which the trajectories were further optimized and smoothed to determine the trajectory planning of UAVs.All of Drones 2023, 7, 29 2 of 18 these studies are good at providing a method for UAV trajectory planning or waypoint assignment, which improves the efficiency of UAVs to perform certain tasks.However, there remain very few research results on these topics in order to enable the precise control of the formation time during a quadrotor UAV cluster mission execution, so that the quadrotor UAV cluster can form the desired formation shape efficiently within a predetermined time, or precisely control the beginning and end positions of the UAVs during flight for a period of time to achieve the effect of that the UAVs maintaining a certain formation shape and not deviating from it.Wu et al. [13] studied the use of genetic algorithms mixed with simulated annealing algorithms for the beginning and end locations of UAVs and the planning of the trajectory decision scheme during UAV formation transformation, effectively reducing the UAV computation time.However, they did not consider the study and path planning of the beginning and end locations of the trajectory when the deviating UAV maintains its formation.Li et al. [14] introduced the concept of "predefined time" in their study of UAV formation control and determined a method for calculating stable and accurate predicted time bounds for UAV trajectory planning during formation-keeping missions.However, they did not consider the effect of the initial location where the UAV deviation occurred versus the predicted focus location of the UAV target obtained on the trajectory planning.Inspired by the above discussion, this study focuses on the optimization of the target focus location in the formation keeping trajectory during UAV flight and the corresponding trajectory planning within a certain time frame.
First, to keep the UAV as electromagnetically silent as possible, we established an innovative control method for the transformed leader-follower method with the smallest total electromagnetic wave signal emitted by the UAV as the objective function.Then, we used the circular formation flight pattern as the fundamental research object, and the error in follower UAVs' coordinates as the objective function and built the optimization model to make the UAV location error as small as possible and obtained the precise location for the follower adjustment.Then, this study determines the location adjustment trajectory to be maintained by the UAV formation by considering how to make the change in speed and force smooth when the UAV location changes.To verify the accuracy and stability of the model, we sampled the ideal location coordinates of the follower with Gaussian distribution [15], substituted the initial coordinate data of the random UAV to be adjusted into the model for analysis and verification, and obtained the precise location of the follower adjustment and the control method of the transformed leader-follower method.Finally, this study is extended based on circular formation flight patterns and discusses passive location models for different shape formation flight patterns.The architecture of the paper is organized as follows.Section 2 presents three models: a model for continuous UAV assignment under complex constraints based on the transformed leader-follower method; a model for UAV location adjustment to determine the target location under UAV formation keeping; and a model for trajectory planning to enable UAV formation keeping.Section 3 integrates a set of data from the dataset obtained from Gaussian distribution sampling into the above model for simulation to verify the accuracy of the model.Section 4 obtains the simulation results of the empirical analysis and performs a sensitivity analysis of the weights of distance deviation and angle deviation to determine the accuracy of the model.Section 5 discusses the impact of algorithm computational complexity and battery consumption on the efficiency of UAVs performing formation-keeping tasks.This study provides a decision scheme that enables more accurate target waypoint locations for track planning for UAV cluster formation maintenance and makes UAV adjustment more efficient.

Establishment of the Model: Take Circular Formation Flight as an Example
Since other flight formation patterns with different numbers of UAVs can be converted into a combination of several circles, for the convenience of the modeling and analyzing, we assume that m UAVs are flying in a circular formation at the same altitude.Among these m UAVs, one UAV (FY00) is located in the center of the circular formation, and the remaining UAVs (FY01-FY0m-1) are evenly distributed on a certain circumference.The radius of the circumference is R.The UAV adjusts its location using a purely azimuthal passive location method.This method involves a few UAVs in the formation transmitting signals and the rest passively receiving them, and the received direction information is the angle between the lines of a UAV receiving the signal and the UAVs transmitting the signals.To maintain the formation of the UAV clusters in flight, the following model was developed in this study.

Assumptions of the Model
Assumption 1. Assuming that the UAVs all remain at the same altitude.
Assumption 2. Assuming that the UAV clusters make a uniform flight with speed v. Assumption 3. Assuming that the locations of UAV FY00 and FY01 are always in standard position coordinates.

The Establishment of the Transformed Leader-Follower Model
This model considers a reasonable UAV location adjustment scheme so that the m − 1 UAVs except for FY00 are finally evenly distributed on the circumference.The two elements of whether the UAV transmits or receives signals, and the position deviation are considered together, i.e., the distance between every two UAVs is simply considered as a weight, and the UAV location adjustment scheme is determined under reasonable constraints based on the assignment problem in 0-1 programming [16].Assuming that the position of the i UAV at the nth moment is expressed in polar coordinates as ρ n i , θ n i , the coordinates of the i UAV at the next moment (after adjustment) are expressed as The two position coordinates are obtained from the polar coordinate system established at different moments with the UAV FY00 position coordinates as the center of the circle, and the line connecting UAV FY00 and FY01 as the horizontal axis.
The model introduces two factors to determine whether the UAV is the leader (UAVs that transmit signals) or follower (UAVs that receive signals) when in formation: one is the deviation tendency factor ε i and the other is the distance tendency factor ξ ij , where is the degree of deviation of the UAV from its standard location and reflects the priority of the UAV to receive dispatch.ξ ij is the weight of the distance length of the two UAVs on the circumference, reflecting the trade-off between the leader UAVs in the special case where the two transmitting signal UAVs have a small difference in deviation tendency factor but a large difference in distance from the adjusted UAV.This model considers preferentially using the UAV with a smaller deviation tendency factor and distance tendency factor to adjust the other UAVs.

•
Determination of deviation tendency factor ε i Since the UAV FY01 is already in a standard position, we do not consider it to receive signals.Let a random variable be: The initial location of each UAV has some deviation from its standard location.This model prioritizes the adjustment of UAVs with larger location deviations using UAVs with smaller location deviations.The deviation tendency factor depends on the distance deviation and angle deviation of this UAV.The former is the distance of the point from the center of the circle.The latter is the angle between the line of the point and the center of the circle and the horizontal direction.
Let the weights of distance deviation and angle deviation be P 1 and P 2 , respectively.ε i is the sum of distance deviation and angle deviation of m − 1 UAVs.According to the Drones 2023, 7, 29 4 of 18 different weights of distance deviation and angle deviation, the following equation can be obtained.
The standard deviation method is usually used in determining the weights of two indicators.The greater the standard deviation of an indicator, the greater the variability of the indicator value, the greater the amount of information provided, the greater the role in the comprehensive evaluation, and the greater the weight of the indicator [17].
Because of the difference in the magnitude of the distance and angle, to eliminate the influence of the magnitude, the data need to be standardized [18].In normalization, for the convenience of calculation, we define the arc length of the ith UAV as the length of the arc formed by the ith UAV and its neighboring previous UAV, and use this to replace the calculation of the angle weight.The arc length formula l = θ × π × r/180 can be used to convert the angle of the central angle of the circle into the corresponding arc length, thus the two sets of data have the same magnitude.In this case, the standard value of the distance between the UAV and the center of the circle is d = R, and the standard value of the arc length is l = 360 m − 1 × π × r/180.After eliminating the effect of dimensionality, the standard deviations σ 1 , σ 2 of the standardized distance (polar diameter) and angle (polar angle) are calculated separately to determine the weights of the two indicators.Generally, for the purpose of data processing, the data are usually mapped to the range of 0 to 1, which is the normalization of the data.This makes the processing easier and faster.Therefore, the largest value of ε i corresponding to the m − 1 UAVs obtained, needs to be recorded as 1, and the rest are scaled down equally so that all ε i lie in the range of zero to one.

•
Determination of distance tendency factor ξ ij When the deviation tendency factors of two UAVs are similar, the UAV that is relatively close to the UAV being adjusted is considered for adjustment-that is, to minimize the distance tendency factor of the UAV.
In order to make the adjustment scheme more reasonable, we need to keep the number of wires between the transmitting signal and the receiving UAV as small as possible.That is, the UAV should maintain electromagnetic silence as much as possible, with fewer electromagnetic wave signals to avoid interference from outside signals.This model considers the deviation propensity factor and the distance propensity factor, and defines the product of the two with t i,j−1 as the amount of information, from which the objective function can be obtained as follows.
This model considers the need to keep the UAVs as electromagnetically silent as possible so that up to three UAVs on the circumference transmit signals in a single attempt.The effective location of the UAV cannot be obtained when there is only one UAV transmitting signals on the circumference, so we consider two or three UAVs transmitting signals on the circumference.Theoretically, with a greater the degree of deviation, the UAV needs to be adjusted by the increased number of UAVs.This model prioritizes the adjustment of UAVs with a greater degree of deviation from the standard location.The distance factor of the two factors in position deviation is given priority, and angle deviation is considered when the distance deviation is the same.
Based on the above objectives and constraints, the 0-1 programming model is developed as follows.

The Establishment of the UAV Location Adjustment Model
When the adjusted UAV's location is closer to its standard location, the adjustment scheme is more reasonable.The objective function can be obtained as follows.
The constraint is that the distance deviation and angle deviation of the UAV after adjustment are less than its deviation before adjustment.According to the Gaussian distribution Law, there will be a small number of UAVs with large initial distance deviation or large initial angle deviation.Therefore, it is necessary to introduce the correction coefficient k for distance deviation or angle deviation with large deviation to reduce the impact of excessive deviation on the results.
Based on the above objectives and constraints, the model is developed as follows.

The UAV Location Adjustment Trajectory Planning Model 2.4.1. Minimum-Jerk Trajectory Planning
The displacement function of the UAV for location adjustment can be expressed in vector form as r(t) = x(t) y(t) .
Let there be a total of λ + 1 waypoints including the adjustment start and end points when the UAV is making location adjustments.At the moment T k , each UAV needs to reach the corresponding position coordinates obtained from the UAV location adjustment model in Section 2.3 of this study.We define it as the kth waypoint R k .R 1 represents the starting point of the location adjustment performed by the UAV, and R n+1 represents the end point of the location adjustment performed by the UAV.We record the waypoints as: Thus, we divide the trajectory of the UAV location adjustment, i.e., the route to be planned, into λ segments.
In this study, the minimum-jerk trajectory planning proposed by Vijay Kumar is used to find the optimal path for UAV location adjustment [19,20].Jitter in the desired UAV trajectory can adversely affect the performance of the manipulator's tracking control algorithm [21].To reduce this effect, it is important to make the change in UAV output force as smooth as possible, i.e., to make the change in UAV acceleration as smooth as possible, so that the jerk of the UAV is minimized.
Obtaining minimum jerk involves making the action S of the following equation obtain a minimal value.

∂L ∂r
Substituting L = ( ... r ) 2 into the above equation, the path to obtain the jerk minimization needs to satisfy: The above equation shows that the displacement functions x(t) and y(t) between every two adjacent waypoints can be described by a fifth-order polynomial.
The motion of the UAV in x dimensions, between the kth waypoint and the (k+1)th waypoint, has the following relation.
There are λ segments of the route to be planned, and each segment will have six pending coefficients, so this route planning will have 6λ parameters to be solved for.

•
At the beginning and end of each segment, each UAV needs to reach the identified coordinates of the corresponding position, i.e., the corresponding polynomial function must give coordinates that coincide with the waypoint.
The above equation expands a total of 2λ equations.

•
When the UAV performs location adjustment, the initial and final velocity of the flight are both v, and the initial and final acceleration are both zero.
The above equation expands a total of 4 equations.

•
The articulation of the kth segment and the (k+1)th segment should be silky smooth, and there should be no abrupt changes in velocity and acceleration.
The above equation expands a total of 2(λ − 1) equations.

•
To ensure further that the moment output can vary smoothly, the continuity of the third-and fourth-order derivatives on the segment boundary needs to be constrained.
The above equation expands a total of 2(λ − 1) equations.
From the above analysis, we can establish a total of 6λ equations, from which we can solve the values of each parameter and determine the motion trajectory of the UAV in x dimensions.The motion planning of each dimension in UAV flight can be seen being as independent of each other.Therefore, the motion planning for the remaining dimensions can be derived in the same way.

UAV Location Adjustment
This study assumes that 10 UAVs fly in a circular formation, with one UAV (FY00) at the center of the circle and the remaining nine UAVs (FY01-FY09) evenly distributed around the circumference of the circle with a radius of 100 m.The coordinates of the UAV location equal a data set with an infinite number of samples, which prevents a complete coverage analysis.From the central limit theorem, it follows that the probability distributions of many random variables obey or approximately obey a Gaussian distribution.Therefore, this study achieves fast model validation by Gaussian distribution Sampling.In this paper, data sets are sampled by Gaussian distribution, and one set of data (Table A1 in Appendix A) are taken for example analysis, and the rest of the data are analyzed in the same way.The analysis is as follows.
(a) Data Standardization The distance and acr-length-related data was standardized as shown in Table 1.
(c) Obtaining the distance and angle weights P 1 , P 2 : Based on the initial UAV location, it can be seen that the angle deviation is very small and brings minimal impact.The results calculated based on P 1 , P 2 also confirm the accuracy of the model in calculating the weights using the standard deviation method.
We calculate ε i and normalize it to obtain the following Table 2.
Analyzing the initial position coordinates of each UAV, the three UAVs numbered FY03, FY06, and FY09 deviated to a greater extent and were adjusted using three UAVs, while the rest of the UAVs were adjusted using two UAVs.The transformed leader-follower model is as follows.
From the above model, the UAVs transmitting and receiving signals can be identified, and the preliminary results were shown in Section 4.1.
Due to the large weight of the distance deviation in the initial position coordinates of this group of UAVs, its influence on the results is greater; therefore, we consider introducing a correction coefficient k 1 for the distance deviation and make the angle deviation correction coefficient k 2 = 1.The UAV location adjustment model is as follows.
The specific schemes for UAVs adjustment obtained without (k 1 = 1) and with (k 1 = 0.5) the introduction of the distance deviation correction coefficient are shown in Section 4.2, respectively.

UAV Trajectory Planning
The speed of the UAV cluster in uniform flight is: v = 16.7m/s[22].We obtained from the simulation that the UAV that deviated from the standard location converged to the standard location after one adjustment.After the two adjustments, the location has completely converged to the standard location.Here, we divide the trajectory of UAV location adjustment into two segments, i.e., λ = 2. From Equation (12) to Equation (15), the following equations are obtained.
Drones 2023, 7, 29 where, , and d 1x and d 2x are the artificially specified distances for each segment of the trajectory.
The above system of equations containing 12 equations is expressed in matrix form, and the values of the 12 parameters can be obtained by finding the inverse of the coefficient matrix to obtain the UAV's trajectory planning equations in x dimensions.
The trajectory planning equations for the nine UAVs are shown in Section 4.3.

Preliminary Scheme of UAV Adjustment Based on the Transformed Leader-Follower Model
The preliminary adjustment scheme for determining the transmitting and receiving signal UAVs is shown below.
In the above figure, the starting segment of the arrow is the UAV transmitting the signal, and the terminating end of the arrow is the UAV receiving the signal.
From Figure 1, the UAV with a smaller deviation tendency factor transmits more signals, while the UAV that receives signals has a larger deviation tendency factor.In the above figure, UAV FY05 received the signals emitted by UAVs FY06 and FY07.Among them, the deviation tendency factor of UAV FY06 is significantly larger, and the reason for choosing this UAV is the smaller distance tendency factor between UAVs FY05 and FY06.Therefore, this model should consider both the deviation tendency factor and the distance tendency factor when adjusting the UAV location.The model is reasonably established.
The above system of equations containing 12 equations is expressed in matrix form, and the values of the 12 parameters can be obtained by finding the inverse of the coefficient matrix to obtain the UAV's trajectory planning equations in x dimensions.
The trajectory planning equations for the nine UAVs are shown in Section 4.3.

Preliminary Scheme of UAV Adjustment Based on the Transformed Leader-Follower Model
The preliminary adjustment scheme for determining the transmitting and receiving signal UAVs is shown below.
In the above figure, the starting segment of the arrow is the UAV transmitting the signal, and the terminating end of the arrow is the UAV receiving the signal.
From Figure 1, the UAV with a smaller deviation tendency factor transmits more signals, while the UAV that receives signals has a larger deviation tendency factor.In the above figure, UAV FY05 received the signals emitted by UAVs FY06 and FY07.Among them, the deviation tendency factor of UAV FY06 is significantly larger, and the reason for choosing this UAV is the smaller distance tendency factor between UAVs FY05 and FY06.Therefore, this model should consider both the deviation tendency factor and the distance tendency factor when adjusting the UAV location.The model is reasonably established.

Specific Scheme of UAV Location Adjustment
The deviation tendency factor   determines the adjustment order of the UAV.The larger the   of the UAV, the earlier the adjustment of it.Therefore, the specific order in which the UAVs were adjusted was: FY09 was adjusted by FY01, FY07, and FY08; FY03

Specific Scheme of UAV Location Adjustment
The deviation tendency factor ε i determines the adjustment order of the UAV.The larger the ε i of the UAV, the earlier the adjustment of it.Therefore, the specific order in which the UAVs were adjusted was: FY09 was adjusted by FY01, FY07, and FY08; FY03 was adjusted by FY01, FY02, and FY05; FY06 was adjusted by FY03, FY04, and FY09; FY04 was adjusted by FY02 and FY08; FY07 was adjusted by FY03 and FY09; FY08 was adjusted by FY04 and FY06; FY05 was adjusted by FY06 and FY07; and FY02 was adjusted by FY01 and FY05.
From Table 3, if the correction coefficient is not introduced, it can be seen that the UAV locations have been significantly improved when the objective function is smallest, but there are still individual UAVs with a large degree of deviation from the standard location.This is due to the minimization of the objective function with the sacrifice of a certain UAV-that is, ignoring the adjustment of the deviation location of the UAV.To avoid this case, this model introduced a correction coefficient of k = 0.5.Due to the large weight of the distance deviation and its influence on the results, only the distance deviation was corrected.We calculate the standard deviation of distance and angle deviation quantities before and after the introduction of correction coefficient.
From Equation (24), The standard deviation of the two deviation quantities was significantly reduced after the introduction of the correction coefficient, and the UAV was adjusted to be close to its standard location whether the correction coefficient was introduced or not.This verified that it is reasonable to introduce the correction coefficient.Since the UAVs cannot maintain a strict relative standstill in formation flight, the coordinates obtained from the adjustment will be somewhat different from the standard coordinates, but the model is reasonable within the error allowance.
The specific scheme of the UAV adjustment before and after the introduction of the correction coefficient was plotted as follows.
From Figure 2, the UAV location with the correction coefficient represented by the red pentagram is closer to the standard location than the UAV location without the correction coefficient represented by the blue pentagram, and both obtain better results than the initial location.

Results of UAV Trajectory Planning
Table 4 shows the trajectory equation for UAV location adjustment, based on wh we obtain the results of UAV trajectory planning as shown in Figure 3. From Figur when the location adjustment of the UAV's trajectory is one segment, the UAV clu

Results of UAV Trajectory Planning
Table 4 shows the trajectory equation for UAV location adjustment, based on which, we obtain the results of UAV trajectory planning as shown in Figure 3. From Figure 3, when the location adjustment of the UAV's trajectory is one segment, the UAV cluster moves at the moment T k to the coordinate position at the moment T k+1 calculated by the above model according to the black curve's trajectory.The accuracy of the above model can be verified.When the UAV's location adjustment trajectory is divided into two segments, the connection between the first segment of the trajectory, indicated by the green line, and the second segment of the trajectory, indicated by the light blue line, is smooth.That is, there is no abrupt change in speed and acceleration as the UAV moves from the first trajectory to the second trajectory.Jerk means a change in force, and a drastic change in power can make the UAV less controllable.Therefore, the UAV should ensure that the change in force during the location adjustment flight is as smooth as possible, i.e., the change in acceleration is smooth.Although the trajectory is not the shortest trajectory connecting waypoints, such a trajectory ensures the smooth flight of the UAV.Since the dimensions between trajectories are independent of each other, the model of this study can also be extended to three-dimensional UAV location adjustment simulation.Since the dimensions between trajectories are independent of each other, the m of this study can also be extended to three-dimensional UAV location adjustment s lation.
From Figure 4, the adjusted position coordinates of all UAVs selected by Gau distribution sampling are closer to the standard position coordinates than the initia sition coordinates.The trajectories of the UAV clusters in the sample set all conver the ideal coordinate points.The model developed in this paper is reasonable and a rate.Since the dimensions between trajectories are independent of each other, the model of this study can also be extended to three-dimensional UAV location adjustment simulation.
From Figure 4, the adjusted position coordinates of all UAVs selected by Gaussian distribution sampling are closer to the standard position coordinates than the initial position coordinates.The trajectories of the UAV clusters in the sample set all converge to the ideal coordinate points.The model developed in this paper is reasonable and accurate.In the adjustment scheme for the UAV, we applied the standard deviation meth  In the adjustment scheme for the UAV, we applied the standard deviation method to determine the weights of the distance deviation and the angle deviation quantity.To verify the stability of the model, we change the distance deviation weight P 1 and angle deviation weight P 2 = 1 − P 1 to analyze the sensitivity of the weights in the above data to the polar coordinate values of the UAV's adjusted location.

2023, 7, x FOR PEER REVIEW 13
From Figure 5a, when the distance deviation weight P 1 is larger, the distance deviation quantity obtained is smaller (the image reflects that the amplitude of the distance from the standard value becomes smaller and smaller as P 1 increases), and the distance (polar diameter) is closer to the standard value.From Figure 5b, the larger the angle deviation weight P 2 (P 2 = 1 − P 1 ), the closer the line representing the angle (polar angle) is to the standard value, represented by the red line.That is, the larger the angle deviation weight, the more the polar angle deviates from the standard value.
The relationship between distance and angle deviation quantity and weight P 1 (P 2 ) is as follows.

Sensitivity Analysis of the Simulation Results of UAV Adjustment on the Weights 𝑃 1 , 𝑃 2
In the adjustment scheme for the UAV, we applied the standard deviation method to determine the weights of the distance deviation and the angle deviation quantity.To verify the stability of the model, we change the distance deviation weight  1 and angle deviation weight  2 = 1 −  1 to analyze the sensitivity of the weights in the above data to the polar coordinate values of the UAV's adjusted location.
From Figure 5a, when the distance deviation weight  1 is larger, the distance deviation quantity obtained is smaller (the image reflects that the amplitude of the distance away from the standard value becomes smaller and smaller as  1 increases), and the distance (polar diameter) is closer to the standard value.From Figure 5b, the larger the angle deviation weight  2 ( 2 = 1 −  1 ), the closer the line representing the angle (polar angle) is to the standard value, represented by the red line.That is, the larger the angle deviation weight, the more the polar angle deviates from the standard value.The relationship between distance and angle deviation quantity and weight  1 ( 2 ) is as follows.

Discussion
When the formation of UAVs is more complex (the formation is a shape containing curves or the number of UAVs is large, etc.), the graph of the formation can also be converted into a combination of several circles, and then the actual position coordinates of the UAVs can be determined and adjusted according to the model of this study.Using a conical formation of several UAVs as an example (Figure A1 in Appendix B), the process of adjusting the location of the UAVs is as follows: a certain UAV is first identified as the origin of the polar coordinate system, and the cone is converted into a number of circular combinations.The UAV on any of the circumferences can determine its actual initial position coordinates by the received azimuth information, and then the specific adjustment scheme of the UAV is determined by the above model.
In this study, the relationship between the two weights and the model has been analyzed and a set of data obtained by sampling have been calculated to reflect that different parameter selections may lead to different adjustment results.Figure 6 reflects the relationship between the quantity of distance deviation and the quantity of angle deviation we obtained for the adjusted position in the polar coordinate system as the weight of distance deviation P 1 and the weight of angle deviation P 2 are changed.It can be seen that as P 1 increases, the deviation quantity from the distance of the calculated adjustment Drones 2023, 7, 29 14 of 18 position becomes smaller and smaller, and conversely as P 2 decreases, at the same time the deviation quantity from the angle of the calculated adjustment position becomes larger and larger.However, when P 1 exceeds a certain value, the objective accuracy of the adjusted position decreases instead.It is calculated that when P 1 is greater than 0.976, the above rule is not fully obeyed, which means that the angle offset will become larger and larger when P 2 is too small.That means we have to consider both weights in an integrated way, and the change in the weights affects the degree of distance and angle correction, so the weights should be studied more deeply when developing the adjustment scheme for the UAV.
In this study, the relationship between the two weights and the model has been analyzed and a set of data obtained by sampling have been calculated reflect that different parameter selections may lead to different adjustment results.Figure 6 reflects the relationship between the quantity of distance deviation and the quantity of angle deviation we obtained for the adjusted position in the polar coordinate system as the weight of distance deviation  1 and the weight of angle deviation  2 are changed.It can be seen that as  1 increases, the deviation quantity from the distance of the calculated adjustment position becomes smaller and smaller, and conversely as  2 decreases, at the same time the deviation quantity from the angle of the calculated adjustment position becomes larger and larger.However, when  1 exceeds a certain value, the objective accuracy of the adjusted position decreases instead.It is calculated that when  1 is greater than 0.976, the above rule is not fully obeyed, which means that the angle offset will become larger and larger when  2 is too small.That means we have to consider both weights in an integrated way, and the change in the weights affects the degree of distance and angle correction, so the weights should be studied more deeply when developing the adjustment scheme for the UAV.The effect of other parameters mentioned in the model on the results can also be further analyzed-for example, the bias correction coefficient introduced in the model in this study.Since the deviations of the UAV deviations obey the Gaussian distribution law, there will be a small number of UAVs with large initial position deviations or large initial angle deviations, resulting in a certain weight being too large and having a huge impact on the results.Therefore, the introduction of deviation coefficients makes the calculation results converge faster, the search range that meets the constraints becomes smaller, and the adjusted coordinates become closer to the standard coordinates.To adjust the UAV position coordinates more accurately, the value of the correction coefficient The effect of other parameters mentioned in the model on the results can also be further analyzed-for example, the bias correction coefficient introduced in the model in this study.Since the deviations of the UAV deviations obey the Gaussian distribution law, there will be a small number of UAVs with large initial position deviations or large initial angle deviations, resulting in a certain weight being too large and having a huge impact on the results.Therefore, the introduction of deviation coefficients makes the calculation results converge faster, the search range that meets the constraints becomes smaller, and the adjusted coordinates become closer to the standard coordinates.To adjust the UAV position coordinates more accurately, the value of the correction coefficient needs to be reduced, but also the adjustment speed of the UAVs needs to be slowed down.Therefore, through the above analysis, this study considers both the UAV position adjustment accuracy and the adjustment speed to obtain a more reasonable value of the deviation correction coefficient, i.e., k is 0.5.In addition, the model can incorporate the study and analysis of the time dimension.When adjusting the drones, every two adjustment processes can be transformed into multiple adjustments at discrete moments, which will be studied in our subsequent work.
This study enables the UAV cluster to perform formation keeping tasks by using the Monte Carlo strategy to calculate the UAVs' trajectory end positions, and then perform UAV flight planning simulations based on the coordinates of the initial deviation of the UAVs from their standard positions by using knowledge of dynamics [23].The Monte Carlo strategy is a numerical simulation method that takes probabilistic phenomena as the object of study, and a calculation method that presumes the unknown characteristic quantity by obtaining the statistical value according to the sampling method [24].The specific implementation steps of the Monte Carlo method performed in this study are to first determine the number of generations of iterations and the important parameters in the model such as the convergence factor, randomly generate the endpoint target of the UAV according to the mean distribution and set the initial objective function value to infinity.Then, the two deviation weights are calculated together, and the objective function value is calculated for the matrix that meets the constraints in each set of results, and the objective function value of each time is compared with that of the previous one, and the smaller one is kept with the corresponding solution.The specific procedure is shown in Appendix C.
The computational complexity of the algorithm is an important indicator of the efficiency of the algorithm [25].The computational complexity of the method provided in this study is O(n*m) for each UAV in the cluster using the asymptotic expression, where m is the number of UAVs in the cluster and n is similar to the number of populations in a genetic algorithm.When the number of UAVs in a cluster is much larger than the number in the example in this study, the time complexity is O(nˆ2), which improves the computational efficiency for traditional algorithms such as global search.The genetic algorithm (GA) with excellent computational efficiency has problems such as complex dimensionality and nonlinear constraints in formation-keeping tasks [26], and the method provided in this study reduces the time complexity and improves the task execution efficiency compared to the genetic algorithm, although the number of iterations is larger, and the simulation results imply a reduction in the time to keep the UAV cluster in formation.In addition, for the assignment problem in the leader-following model in this study, 0-1 planning is more convenient for this complex assignment problem.Algorithms such as the Hungarian algorithm [27] are more efficient for similar problems, but their limitations are not applicable to the complex constraints in this study, and algorithms such as simulated annealing [28] are suitable for optimization problems under complex constraints, but they tend to fall into local optima.Therefore, we will provide more objective hybrid algorithms in subsequent studies to solve the continuous assignment problem containing nonlinear electromagnetic interference with complex constraints as the number of UAVs in a formation increases.Finally, the algorithm provided in this study is generalizable, and our method is still applicable for different clusters-for example, when scheduling multiple UAV clusters simultaneously in active or passive localization environments, the time complexity of our algorithm will rise to O(nˆ3), and it can still accurately calculate the formation focus coordinates and trajectories of all UAVs, as in Figure 4. Additionally, for the UAV that deviates beyond the range of the target UAV transmitting with the signal, it will plan the trajectory based on the UAV that transmits the signal closest to it and reduce the amount of deviation before using the model of this study for decision planning to adjust the scheme.
When the processor of the UAV runs the program, the battery consumption of the UAV shows a non-linear dynamic process as the computational complexity of the algorithm increases [29,30].The battery depletion can slow down the flight speed of the UAV, thus affecting the formation adjustment and subsequent flight time of the UAV.Therefore, it is feasible to introduce the battery consumption model into this study for calculating the adjustment time of the UAV.Wang., Kang.and Liu.[29] considered the nonlinear decay process of battery capacity in studying the optimal scheduling problem of an electric bus fleet.Their study was the same as this study in that it considered a multi-stage decision problem that includes the assignment problem.Due to the increased complexity of the environment in which UAVs fly in formation, replacing the algorithm in this study with dynamic programming and recursive equations leads to an increase in the computational complexity of the algorithm, which exacerbates battery consumption and affects the efficiency of UAV formation adjustment even more.Therefore, formation maintenance of UAVs is a comprehensive decision problem that requires the consideration of many factors.Later, we will study the UAV formation-keeping algorithm based on different environmental complexities, considering battery consumption, for UAV users to choose.

Conclusions
This study proposes a decision model for UAV location adjustment based on the Monte Carlo strategy, and a trajectory programming decision model based on predicted calculation of deviated UAV predefined endpoint locations.We validated its accuracy, generalizability and stability using the initial UAV position coordinate data sampled from Gaussian distribution.The model proposed in this study has low computational complexity, effectively improving the efficiency of UAVs performing formation-keeping tasks during flight.However, the model in this study does not take into account the effect on UAV scheduling when the distance between two nodes is greater than the signal propagation and reception range of the UAV.This study will be followed up by considering the effect of battery consumption on UAV formation maintenance at different environmental complexities, as well as providing three-dimensional dynamics models and algorithms for UAV flight at different altitudes in the future.for i = 1 to n do

8:
Create a matrix X k consisting of random solutions that obey the 9: average distribution.

Figure 2 .
Figure 2. Specific adjustment scheme figure for UAVs.

Figure 2 .
Figure 2. Specific adjustment scheme figure for UAVs.

Figure 3 .
Figure 3. Track figure of UAV location adjustment.

Figure 3 .
Figure 3. Track figure of UAV location adjustment.

Figure 4 .
Figure 4. Trajectory simulation of UAV cluster formation keeping with Gaussian distrib sampling.

Figure 4 .
Figure 4. Trajectory simulation of UAV cluster formation keeping with Gaussian distribution sampling.

4. 4 .
Sensitivity Analysis of the Simulation Results of UAV Adjustment on the Weights P 1 , P 2

Figure 4 .
Figure 4. Trajectory simulation of UAV cluster formation keeping with Gaussian distribution sampling.

Figure 5 .
Figure 5. Polar diameter and polar angle values with different distance and angle deviation weights.(a) Polar diameter values with different distance deviation weights.(b) Polar angle values with different angle deviation weights.

Figure 5 .
Figure 5. Polar diameter and polar angle values with different distance and angle deviation weights.(a) Polar diameter values with different distance deviation weights.(b) Polar angle values with different angle deviation weights.

Figure 6 .
Figure 6.The relationship between distance and angle deviation quantity and weight  1 ( 2 ).

Figure 6 .
Figure 6.The relationship between distance and angle deviation quantity and weight P 1 (P 2 ).

4 :
: k, i, j, r, minresult, m, n, number o f U AVs; 2: minresult = In f ; m = Iteration generation; 3: Define a three-dimensional null matrix Y for storage.For simultaneous control of multiple UAVs in multiple clusters :

Table 1 .
Standardized distance-and arc-length-related data.
(b) Calculation of the standard deviation of the distance (polar diameter) and angle (polar angle) σ 1 , σ 2 :

Table 2 .
The value of the normalized deviation tendency factor ε i .

Table 3 .
Specific scheme table of UAV location adjustment.