Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 10, No. 1, 2024 1 Research on Formation Reorganization Optimization and Trajectory Planning for Robotic Swan Light Performance on Water Surface Zhanchong Zhou, Huailin Luo, Tao Zhang School of Mechanical Engineering, Sichuan University of Science & Engineering, Yibin Sichuan, 644005, China Abstract: This paper proposes a method for a robotic swan light performance on the water surface, conducting an in-depth study on the reorganization and trajectory planning of the formation. In response to the reorganization needs of the performance formation faced by the water surface robot group, this scheme takes into account the performance requirements of individual robots and the collaborative effect of the entire group, realizing optimal aesthetic adjustment of the formation reorganization allocation. At the same time, the scheme also includes a trajectory planning method, which ensures the smooth and continuous motion of the swan water surface robots on the water through the distributed model predictive control (DMPC) framework, while avoiding potential collisions, enhance the lighting effects of the swan water surface performance by the robot swarm. Keywords: Collective Performance; Trajectory Planning; Formation Reorganization Allocation; Distributed Model Predictive Control. 1. Introduction With the rise of the night economy [1], cities are seeking novel forms of night-time entertainment to attract tourists and enhance their image. The performance of a group of swan robots on the water surface, with its unique charm that combines technology and art, has become a new driving force for the development of the night economy [2-3]. he performance of the swan robot group on the water surface creates dynamic visual art through the interaction of lights and water, not only enriching the city's night scene but also providing a new audience experience. Compared with traditional performances, the light swan robot group performance on the water surface is safer, more environmentally friendly, and has high flexibility and innovation. In addition, they can quickly spread through social media, enhance the promotional effect of the event, attract more tourists, and drive the development of related industries [4-5]. Fig 1. Schematic diagram of the lighting swan water surface robot group performance effect This paper proposes a formation reorganization allocation scheme and trajectory planning method for the performance of swan robots on the water surface, exploring the factors that affect the performance effect of formation reorganization and conducting multi-objective optimization. At the same time, the method of Distributed Model Predictive Control [6] (DMPC) can effectively solve the path planning problem of swan robots, ensuring the coordinated movement of the robot group on the water. Figure 1 shows the rendering effect of the swan robot group performance on the water surface using the UE engine. 2. Problem Description Fig 2. Schematic diagram of the formation reorganization position optimization problem. Compared to drone swarm control for three-dimensional spatial formation performances, the swan water surface robot group performance is limited to the two-dimensional space on the water surface, which restricts the freedom in constructing 2 spatial images [7]. Therefore, to enhance the viewing pleasure of the performance, it is necessary to frequently reorganize the formation to showcase the dynamic beauty and swan-like autonomy of the water surface robots. By precisely controlling the reorganization allocation and the coordinated movements between robots, a variety of visual effects can be created. Frequent formation reorganizations imply the need for a variety of formation shapes as support. Therefore, it is not feasible to manually set the reorganization allocation and trajectory planning for each formation reorganization as in drone swarm performances. It is necessary to develop optimization methods for formation reorganization and trajectory planning to achieve the best group performance effect. Taking a group of 12 water surface swan robots as an example, let the initial formation notation of each swan robot be E1, E2, ..., E12, and the formation notation after reorganization be D1, D2, ..., D12. Figure 2 illustrates the optimization problem of formation reorganization positions. 3. Formation Reconfiguration Plan 3.1. Individual Performance Requirements When individual swan surface robots move from their initial positions to desired positions, it is important to consider the performance requirements such as energy consumption and rotation range of the robots. The energy efficiency and the extent of motion are crucial factors that can affect the overall performance and longevity of the swan robots during their operation on the water surface. Ensuring optimal energy use and a wide range of motion can enhance their ability to perform complex maneuvers and maintain prolonged operational times. 3.1.1. Energy Consumption When allocating the reorganization of the formation for each swan surface robot, it is necessary to reduce the overall energy consumption. The total distance each swan surface robot travels to reach the designated reorganization position should be as small as possible. This involves calculating the difference in distance between the initial position and the designated formation position of the swan surface robot, using the chordal distance for the calculation. The chordal distance is the straight-line distance between two points on the surface, which is an important factor in minimizing energy consumption during the movement of the robots: , , , , (1) ∑ (2) At the same time, each swan surface robot has a limited and equal amount of energy. It is necessary to ensure that the variance in the distance each swan surface robot travels from its initial position to the designated formation position is minimized. This prevents an individual robot from being repeatedly assigned to a distant desired position after multiple reorganizations, which could lead to excessive energy consumption, shutdown, and an inability to complete subsequent group performances, thereby affecting the performance effect. ̅ (3) In the formula: represents the distance from the initial position to the designated reorganization position for the swan surface robot; represents the total sum of the chordal distances; , , , are the initial position coordinates of the swan surface robot; , , , are the designated formation position coordinates of the swan surface robot; is the total number of swan surface robots participating in the group performance; represents the variance of the distances. 3.1.2. Turning Maneuver Range If the swan surface robot is underactuated, it cannot perform rapid large turns, which will affect the overall fle- xibility and response speed in the group performance. Therefore, the smaller the turning angle between the initial position and the designated formation position of the swan surface robot, the less time is required for the turning maneuver, reducing the time needed for formation reorganization and enhancing aesthetic appeal of the performance. However, to not reduce the flexibility of individual swan surface robots to reach various expected positions, it is not suitable to restrict the maximum turning angle of individuals. Instead, the sum of the turning angles for each individual will be calculated as follows: θ arctan , , , , (4) θ =∑ θ   (5) 3.2. Coordination Requirement During the formation reorganization process, it is necessary for the swan surface robots to have the best possible collaborative effect, taking into account the influence between the swan surface robots. 3.2.1. Reorganization Time Coordination During the reorganization process, the time difference for the swan surface robots to reach their respective desired positions needs to be as small as possible. Generally speaking, the smaller the time difference, the faster the formation is formed, and the better the performance effect will be; (6) In the formula: represents the time difference; is the time when the first swan surface robot arrives at the expected designated position, is the time when the last swan surface robot arrives at the expected designated position. 3.2.2. Avoid Intersecting Coordination During the reorganization process, to reduce the risk of collisions between the swan surface robots, the movement trajectories of each individual should avoid intersections. Moreover, frequent trajectory intersections can cause visual confusion and degrade the viewing experience [8]. The calculation method for the number of trajectory intersections is as follows: 1) Arrange the x-axis coordinates of the initial positions of the swan surface robots in ascending order from smallest to largest to obtain an ordered matrix: 1 2 . . . . . . (7) 2) Obtain the corresponding x-axis coordinate matrix for the expected positions: 1 2 . . . . . . (8) Compare the positions of the (1≤ ≤n-1) and (1≤ ≤n) surface swan robots; if > ,it is recorded as one instance of lateral trajectory intersection, and all other cases are considered non-intersecting. 3) Sequentially judge the situations of , , . . . , and accumulate to obtain the intersection factor Z. 3 4. Formation Reorganization Optimization In the process of optimizing the reorganization of swan surface robot formations, various factors such as energy consumption, turning maneuver range, time coordination, and avoiding intersecting coordination must be considered. Therefore, the formation reorganization allocation optimization problem is classified as a multi-objective optimization problem, which is solved using the NSAG-II algorithm for multi-objective optimization. The optimization target variables involved are , , θ and Z. Since time coordination needs to consider collision avoidance and movement distance during the motion process, it is optimized in the subsequent trajectory planning. Thus, the formation reorganization allocation is planned under ideal non-collision conditions, with a constant speed, using the distance variance as an approximate substitute for the time coordination optimization target. Assuming the number of swan surface robots and the expected positions for reorganization are both ,the allocation scheme is defined as the following matrix:: ⋯ (9) (9)In the formula, the element in the first row and first column of the matrix represents the allocation of the swan surface robot numbered 1 to the designation in the expected formation, the element in the first row and second column represents the allocation of the swan surface robot numbered 2 to the designation in the expected formation, and so on, ∈ 1,2,3, … ,12 . 4.1. The NSGA-II Multi-objective Optimization Solution Process 1) Define initial parameters: including population size, number of variables, variable ranges, number of iterations, initial crossover, mutation probability; 2) Define the optimization objective function; 3) Randomly initialize the population: randomly generate the allocation scheme P matrix, and calculate the objective function value for each individual; 4) Perform genetic iterative computation and merge: including selection, crossover, and mutation operations to generate a new offspring population, and merge the parent and offspring to form a new population; 5) Conduct non- dominated sorting: quickly sort the new population based on the objective function values, calculate the crowding distance, and select individuals to enter the next generation based on the sorting and crowding distance; 7) Return to step 4 for computation, and so on until the set termination conditions are met and the Pareto solution set is generated. Fig 3. Flowchart of the NSGA-II algorithm. 5. Formation Reorganization Simulation Results and Data Analysis 5.1. Simulation The initial formation coordinates of the swan surface robots and the expected formation coordinates are set as shown in Table 1, and the corresponding two-dimensional coordinate graph is shown in Figure 4. Table 1. Corresponding Coordinates of Initial and Desired Formations Initial formation designation Corresponding coordinates Desired formation designation Corresponding coordinates E1 (0,13) D1 (20,-9.5) E2 (5,13) D2 (18.6,-4.5) E3 (10,13) D3 (15,-0.8) E4 (15,13) D4 (10,0.5) E5 (20,13) D5 (5,-0.8) E6 (25,13) D6 (1.3,-4.5) E7 (-5,80) D7 (0,-9.5) E8 (0,80) D8 (1.3,-14.5) E9 (5,80) D9 (5,-18.1) E10 (10,80) D10 (10,-19.5) E11 (15,80) D11 (15,-18.1) E12 (20,80) D12 (18.6,14.5) 4 Fig 4. Diagram of initial formation coordinates and the distribution of desired formation coordinates. Table 2. Parameter Settings for the NSGA-II Algorithm Parameters Parameter values population size 100 number of iterations 200 crossover probability 0.8 mutation probability 0.2 variables 1-12 permutations The resulting three-dimensional Pareto solution set graph is as follows: Fig 5. Pareto Front Diagram 5 5.2. Team Formation Simulation Optimization Data Analysis In order to intuitively analyze the high-dimensional Pareto solutions optimized by NSGA-II, PCA [9-10] (Principal Component Analysis) is used, which is a method of dimensionality reduction and dimensionless processing for the data on the Pareto front. At the same time, the k-means clustering algorithm is applied to the reduced data to categorize the data into 4 clusters as shown in Figure 6, and the number of clusters in each category is calculated as shown in Figure 7. Fig 6. Two-dimensional Dimensionality Reduction Clustering Diagram of Pareto Solutions. Fig 7. Cluster Count Statistical Chart To assess whether the division of data into 4 cluster groups aligns with the characteristics of the 4 optimization objectives of the data, the silhouette coefficient curve of the clusters was calculated, as shown in Figure 8. It was found that the optimal number of cluster groups is 3 with a silhouette coefficient of 0.773, and the second-best allocation of cluster groups is 4 with a silhouette coefficient of 0.755. The difference is small, which is quite consistent with the 4 target optimization characteristics of the data. Fig 8. Silhouette Coefficient Curve Chart Calculate the average values of the four target values , , θ and Z for each cluster as shown in Table 2,The analysis shows that clusters 1, 2, and 3 have advantageous performance in the target values of ,Z, θ respectively, Cluster 4 data shows superior performance in the other target values while having a high interlacing frequency Z. Randomly select data from cluster 1, and its formation reorganization optimization allocation plan and its allocation plan diagram are shown in Figure 9. 6 7 3 2 1 4 5 8 9 10 11 12 (10) Fig 9. Formation Reorganization Allocation Scheme Diagram for Category 1 Data Table 3. Average Objective Values for Each Cluster category (m) Z(times) θ (rad) category 1 360.46 3.61 1.54 37.57 category 2 383.98 3.21 3.30 16.13 category 3 365.05 4.36 1.24 55.26 category 4 363.31 5.42 1.57 21.93 Randomly select data from cluster 2, and its formation reorganization optimization allocation plan and its allocation plan diagram are shown in Figure 10. 5 6 2 4 1 3 7 8 9 10 11 12 (11) Randomly select data from cluster 3, and its formation reorganization optimization allocation plan and its 6 allocation plan diagram are shown in Figure 11. 6 5 4 12 1 3 9 7 8 10 11 2 (12) Fig 10. Formation Reorganization Allocation Scheme Diagram for Category3 Data Fig 11. Formation Reorganization Allocation Scheme Diagram for Category 3 Data Randomly select data from cluster 3, and its formation reorganization optimization allocation plan and its allocation plan diagram are shown in Figure 12. 6 5 2 3 4 1 9 7 8 10 11 12 (13) Fig 12. Formation Reorganization Allocation Scheme Diagram for Category 4 Data 6. Trajectory Motion Planning Model Establishment 6.1. Distributed Model Predictive Control (DMPC) Distributed Model Predictive Control (DMPC) is an advanced control strategy that allows multiple agents, such as drones or robots, to independently plan and execute their trajectories from an initial position to a target position without a central coordinator. The core of this method lies in each agent's ability to solve an optimization problem based on its own dynamic model and predictive capabilities to find the best control input sequence. At each time step, each agent will share its predicted future state with other agents. Using this shared information, agents can predict and detect potential collisions. Moreover, DMPC has high scalability and is adaptable for controlling the reorganization performance of different numbers of swan water surface robot formations. 6.2. Model Establishment 6.2.1. State Description The model's objective is to generate collision-free trajectories that will drive N agents from their initial positions to their final positions while being subject to constraints on state and actuation. The swan water surface robots are modeled as unit mass points in two-dimensional space, with each swan water surface robot's motion described by position, velocity, and acceleration. The dynamic equations are as follows: 1 v a (14) v 1 v a (15) Equation(14)describes the position update, where , , a are the position, velocity, and acceleration of the swan water surface robot at time step ,respectively, with being the discretized time step; Equation (15) describes the change in the velocity of the swan water surface robot as a function of acceleration and time. When generating trajectories for multiple swan water surface robots and humans, various constraints need to be considered. The actuation capacity of the swan water surface robots is limited, with maximum and minimum value restrictions imposed on acceleration [13], as followers: a a a (16) During the performance formation reorganization process, facing different water surface environments, the available space for movement varies, and it is necessary to complete the reorganization within the designated water surface area. The position state p is subject to constraints, as follows: (17) To avoid collisions between the motion trajectories of swan water surface robots and other individuals, a scaling matrix Θ is used to define the collision[14-15] constraint between water surface swan robot and .This constraint ensures that the distance between the agents is greater than a certain minimum distance within the predicted time steps. The expression for the collision constraint is as follows: Θ 0 0 (18) ∥∥Θ ∥∥ (19) In equation(18) and are the scaling factors along the x-axis and y-axis, respectively. By adjusting the values of and ,the collision distance boundaries of the swan surface 7 robot can be modified in the corresponding axis directions to meet the requirements of various performance environments. 6.2.2. Distributed Model Predictive Control Model Establishment Use equations(13)and(14)to establish a linear model[16- 17],expressing the state of the Swan surface robot within a prediction range of length, | , | , | represent the predicted values of , , based on the available state information at time , ∈ 0,1,2, … , 1 ,The model equations are as follows: 1| 1| 0 | | /2 | (20) Where is the 3×3 identity matrix, and 0 is the 3×3 zero matrix, the acceleration is chosen as the input of our model system. 6.2.3. Establishment of the Cost Function In order to enable the group of Swan surface robots to achieve continuous, smooth, and elegant motion trajectories and reach the desired target positions with minimal time differences during formation reconfiguration, the following cost function is established: 1)Target Distance Cost Function: The objective is to continuously drive our surface swan robot to the desired position , ,over the remaining time steps . The cost function is defined as follows: , ∑   ∥∥ | , ∥∥ (21) 2)Control Input Variation Cost Function: The objective is to minimize the variation of acceleration and smooth the trajectory. The cost function is defined as follows: , ∑   ∥ | 1| ∥ (22) 3)Temporal Coordination Cost Function: The objective is to achieve temporal coordination among the surface swan robots during formation reconfiguration, such that the difference in distances each surface swan robot covers to reach the desired formation position is minimal at every moment: ∑   ∥∥ | , ∥∥ (23) , ∑   ∥∥ | , ∥∥ (24) Where and are symmetric positive definite weight matrices, and the total cost function is the sum of equations(22), (23)and(24)as follows: , , , (25) 6.2.4. Model Simulation Verification Fig 13. Scheme Trajectory Distribution Char Choose the P_4 high interleaved allocation scheme for motion trajectory model simulation verification, resulting in an effective collision avoidance trajectory, as shown in Figure 13: Analysis of the trajectory distribution diagram shows that the trajectory of individual 5 has more interweaving with individuals 3, 4, 10, and 11. The following are the distance difference diagrams for each time step between individual 5 and individuals 3, 4, 10, and 11: Fig 14. Distance Difference Chart between Individual 5 and Individuals 3, 4, 10, 11 7. Conclusion This article addresses the group performance of swan surface robots, proposing factors that affect the performance of formation reconfiguration: energy consumption, turning maneuver range, reconfiguration time coordination, and avoidance of interweaving coordination. These factors are classified as a multi-objective optimization problem and optimized using the NSGA-II algorithm to obtain the Pareto solution set. PCA and k-means clustering algorithms are used to cluster the allocation schemes with different dominant factors, allowing the selection of different types of allocation schemes according to various performance requirements. At the same time, a smooth and continuous elegant motion trajectory for the swan surface robot is established based on distributed model predictive control, avoiding potential collisions and enhancing the performance effect of the lighted swan surface robot group. References [1] Gao Shunli. "How to Expand 'Night Scenery' and 'Night Tours' into the Night-time Economy" [J]. China Economic Weekly, 2024, (01): 108-110. [2] Du Haiyi. Preliminary Exploration of the Development Model of Night Scene Economy in Cultural Tourism [J]. Modern Marketing (End of the Month Edition), 2020, (10): 22-1256/ f.2020.10.087. [3] Zhu Lei. Research on the Product Design of Intelligent Landscape Lighting for Bochi Mountain Park under the Night Economy [D]. Guangdong University of Technology, 2021. 00119. [4] Du Haiyi. Preliminary Exploration of the Night Scene Economy Development Model in Cultural Tourism [J]. Modern Marketing (End of the Month Issue), 2020, (10): 22- 1256/ f.2020.10.087. 8 [5] Light Up 2020! New Year's Eve Light Shows Across the Globe" [J]. Journal of Lighting Engineering, 2020, 31(01): 92. [6] Shu Y.-P., Liu C., Meng Y.-Z. Fault-Tolerant Collision Avoidance and Obstacle Avoidance Control for Quadrotor UAV Formation Based on DMPC [J]. Journal of Control and Detection, 2024, 7(01): 21-31. [7] Wang Yingchun. Unveiling the Secrets Behind Drone Performances [N]. Hainan Daily,2022-02-21(B11).2022. 001025. [8] Chen Xi, Chen Leiyin. A Study on the Integration of Interactive Light Art Installations into Public Spaces [J]. Screen Printing, 2023, (18): 99-101. 2023.18.029. [9] Tian Yuezong. A Study on Fault Diagnosis Method for Electrical Equipment in Thermal Power Plants Based on PCA [J]. Popular Electricity, 2024, 39(07): 46-48. [10] Wang Qiuping. Analysis of Influencing Parameters in the Hot Rolling Process Based on Principal Component Analysis [J]. Shanxi Metallurgy, 2024, 47(06): 39-41. [11] Zhang Yalin. Research on the Customization of the Best Tourist Route in Scenic Spots Based on the K-Means Clustering Algorithm [J]. Computer Programming Skills and Maintenance, 2023, (11): 65-68. 2023.11.018. [12] Zhou Rongrong, Chen Dong, Liu Siyuan. Research on the Optimization Model of Fresh Food Transportation Path Based on K-Means Clustering Algorithm [J]. Journal of Agricultural Big Data, 2022, 4(01): 89-97. [13] Hao Wenkang, Chen Qifeng. Energy-saving Control of UAV Formation Based on Fuzzy Constrained Distributed Model Predictive Control [J]. Systems Engineering and Electronics, 2024, 46(03): 1021-1030. [14] Wei Ruixuan, Lv Minghai, Ru Changjian, et al. Research on Collision Avoidance Control for UAV Formation Reconstruction Based on DE-DMPC [J]. Systems Engineering and Electronics, 2014, 36(12): 2473-2478. [15] Li Bo, Qu Yuan, Xu Jing. Research on Online Trajectory Planning for Multiple UAVs Based on DMPC-PSO in Complex Dynamic Environment [J]. Journal of Inner Mongolia Normal University (Natural Science Edition), 2018, 47(06): 491-498. [16] Wang P, Ding B.A synthesis approach of distributed-model predictive control for homogeneous multi-agent system with collision avoidance[J]. International Journal of Control, 2014, 87(1): 52-63. [17] P. Ru, “Nonlinear model predictive control for cooperative control and estimation,” Ph.D. dissertation, 2017.