Track optimization method and system based on improved particle swarm optimization
By improving the particle swarm optimization algorithm, the aircraft trajectory is optimized using specified initial particle values, Monte Carlo method, gradient descent method and second-order consistency theory. This solves the problems of premature convergence and local optima in trajectory optimization of traditional particle swarm optimization algorithm, and realizes the optimization of aircraft performance.
Patent Information
- Application Number
- CN202511615630.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-10
AI Technical Summary
Traditional particle swarm optimization algorithms suffer from premature convergence, getting stuck in local optima, and difficulty in balancing global and local search capabilities in aircraft trajectory optimization, making it difficult to effectively optimize performance indicators such as fuel consumption, maximum flight time, and maximum range of aircraft.
An improved particle swarm optimization algorithm is adopted, which updates particles by specifying initial particle values, Monte Carlo method, gradient descent method and second-order consistency theory. Combined with inertia weight and perturbation term mechanism, the cost function is optimized to obtain the global optimal position.
The algorithm's global search capability and convergence speed have been improved, premature convergence has been prevented, and the aircraft's trajectory has been optimized to achieve optimal or suboptimal flight performance, especially maximum range and flight time.
Smart Images

Figure CN121500751A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent optimization algorithm and aircraft trajectory optimization, and particularly relates to a trajectory optimization method and system based on an improved particle swarm algorithm. BACKGROUND
[0002] In recent years, aircraft trajectory optimization improvement has been widely concerned as a method that can effectively improve the flight efficiency of aircraft. However, most of the current trajectory optimization for aircraft only considers threat avoidance and minimization of the range, but other flight performance indicators such as fuel consumption, maximum flight time, maximum range, etc. also need to be considered in the flight process of the aircraft. Therefore, a robust and versatile trajectory optimization algorithm needs to be designed to reduce fuel consumption, improve maximum flight time, improve maximum range, and other aircraft performance indicators to achieve optimal or suboptimal performance.
[0003] The traditional particle swarm algorithm has been widely used in path optimization, parameter optimization, neural network optimization and other optimization fields due to its high solution accuracy, fast convergence speed, and simple implementation. However, the traditional particle swarm algorithm still has problems such as premature convergence, falling into local optimal solution, and difficulty in balancing global and local search ability during optimization and solution process. Therefore, the traditional particle swarm algorithm cannot be directly applied to aircraft trajectory optimization.
[0004] Currently, some designers choose to combine the traditional particle swarm algorithm with other optimization algorithms to improve the particle swarm algorithm, such as introducing the grey wolf algorithm, the pelican algorithm, etc. Another part of the designers chooses to improve the traditional particle swarm algorithm by changing the weight coefficient, learning factor and other parameters of the traditional particle swarm algorithm, or by changing the particle optimization strategy.
[0005] Therefore, it has become a problem to be solved how to improve the traditional particle swarm algorithm and effectively apply it to aircraft trajectory optimization. SUMMARY
[0006] In view of the deficiencies of the prior art, the present application provides a trajectory optimization method and system based on an improved particle swarm algorithm.
[0007] In a first aspect, the present application provides a trajectory optimization method based on an improved particle swarm algorithm, comprising:
[0008] Obtaining performance indicators of interest during the flight process of the aircraft, constructing a cost function according to the performance indicators, and constructing constraints of the command trajectory and the flight state;
[0009] The cost function is sampled, and the sampled points of the cost function are used as particles. An improved particle swarm optimization algorithm is used to optimize the cost function to obtain the global optimal position. The global optimal position is used as the final trajectory optimization result. The improved particle swarm optimization algorithm includes: initializing particles by specifying initial values, randomly assigning each particle to a team using the Monte Carlo method, updating the global optimal particle with the smallest fitness value for the first time using the gradient descent method, and updating the velocity and position of the particles for the second time based on the optimal positions of each particle in the team and the optimal position of the particle itself in the team, using the second-order consistency theory.
[0010] The step of optimizing the cost function using an improved particle swarm optimization algorithm to obtain the global optimal position includes:
[0011] Step S1: Initialize the particles using the method of specifying initial particle values, and initialize various parameters of the improved particle swarm algorithm;
[0012] Step S2: Use the Monte Carlo method to randomly assign each particle to a team;
[0013] Step S3: Update the current inertia weight using the terminal weight, initial weight, current iteration number, and maximum iteration number; calculate the fitness value of each particle based on the cost function and the current particle position coordinates.
[0014] Step S4: Compare the fitness value of each particle with its own best fitness value, and record the position coordinate with the smallest fitness value as the current particle's best position; compare the best fitness value of each particle with the global best fitness value, and record the position coordinate with the smallest fitness value as the particle's global best position, and the corresponding particle is the global best particle.
[0015] Step S5: Use gradient descent to update the global optimal particle with the smallest fitness value for the first time; based on the optimal position in the team and the optimal position of the particle itself, use second-order consistency theory to update the velocity and position of the particle for the second time, and constrain the position and velocity of all particles.
[0016] Step S6: When the current iteration number is less than the iteration number threshold, sort the current particles according to their fitness values from smallest to largest, and take the particles with smaller fitness values first. Each particle, for The velocity of each particle is subject to a perturbation term. It decreases as the number of iterations increases;
[0017] Step S7: When the current iteration number is greater than or equal to the iteration number threshold, sort the particles according to their fitness values from largest to smallest, and select the particles with the largest fitness values first. Individual particles, targeting The process proceeds to step S1, where the particles are re-initialized using a method that specifies initial particle values.
[0018] Step S8: For all but For other particles of a given particle, if the current iteration count is less than the maximum iteration count, the current iteration count is incremented by 1 and the process proceeds to step S3 to recalculate the current inertia weight; if the current iteration count is equal to the maximum iteration count, the global optimal position and corresponding fitness value of the particle are output.
[0019] The method of initializing particles using specified initial values includes:
[0020] Step S11: Determine the dimension of the set of possible optimal positions in the input parameters and the coordinate dimension of the search target. If they are equal, then use the set of possible optimal positions for the corresponding number of pairs. Initialize the particle positions and then... The initial velocity vector of each particle is set to 0. If they are not equal, proceed to step S12.
[0021] Step S12: Use the coordinates of the search center as the initial position of the next particle, and randomly sample within the search radius to obtain the initial velocity of the current particle;
[0022] Step S13: Determine whether the initial value setting in S11 and S12 has been completed, and whether the number of particles that have completed the initial setting is less than [a certain number]. If so, then the initial values of the current particle's position and velocity are sampled at the boundary; otherwise, proceed to step S14. The calculation formula for boundary sampling is as follows:
[0023] ;
[0024] in, For the first Initial position vector of the particle; To be Convert the vector to binary bits; The search radius vector; Search for the lower bound vector; For the first Initial velocity vector of the particle; A vector of random numbers that follows a standard normal distribution. for A dimensional column vector of all 1s;
[0025] Step S14: Remove The initial values of the remaining particles other than the first particle are initialized using a random sampling algorithm. The random sampling calculation formula is as follows:
[0026] ;
[0027] in, For interval A vector of random numbers that are uniformly distributed within the vector.
[0028] The Monte Carlo method is used to randomly assign particles to teams, including:
[0029] The Monte Carlo method is used to randomly assign each particle to a team, ensuring that the number of particles in each team is no more than a set value and no less than 2.
[0030] Under the condition that a minimum spanning tree exists in the communication topology, the adjacency matrix of each team's particles is generated based on the Monte Carlo method.
[0031] The process involves updating the particle's velocity and position a second time based on the optimal position within the team and the particle's own optimal position, using a second-order consistency theory. This includes:
[0032] If the current iteration count is a multiple of the set number of steps for exchanging team members, select the second-best fitness particle in each team, and randomly exchange the second-best fitness particle in each team based on the Monte Carlo method, while ensuring that the number of particles in each team remains unchanged.
[0033] Based on the optimal position in the team, the optimal position of the particle itself in the team, and the adjacency matrix, the velocity and position of the particle are updated a second time using the second-order consistency theory.
[0034] Based on the optimal position in the team and the optimal position of the particle itself, the velocity and position of the particle are updated a second time using second-order consistency theory. The calculation formula is as follows:
[0035] ;
[0036] in, For the team The Middle Particles The position vector at the next iteration; For the team The Middle The position vector of the particle at iteration t. For the team The Middle Particles The velocity vector at the next iteration; For the team The optimal position in; For the team Adjacency matrix in The corresponding element; For the team The Middle The optimal position of the particle itself; For the team The Middle The velocity vector of the particle at iteration t. For the team The Middle Particles The velocity vector at the next iteration As the first learning factor, As the second learning factor, The inertia weight at iteration t. For interval A vector of random numbers that are uniformly distributed within the matrix. This represents the number of particles in the team.
[0037] The current inertia weight is updated using the terminal weight, the initial weight, the current iteration number, and the maximum iteration number, calculated as follows:
[0038] ;
[0039] in, The inertia weight at iteration t. For terminal weight, As the initial weight, This represents the current iteration number. This represents the maximum number of iterations.
[0040] The gradient descent method is used to update the global optimal particle with the smallest fitness value for the first time. The calculation formula is as follows:
[0041] ;
[0042] in, This represents the globally optimal position of the particle before the first search. This represents the globally optimal position of the particle after the first search. For the search step size, It is the negative gradient of the particle's global optimal position, i.e., the optimal search direction.
[0043] Take the one with the smaller fitness value 100 particles, of which 100 particles are present. The calculation formula is as follows:
[0044] ;
[0045] in, As the first weighting coefficient, This is the second weighting coefficient. This represents the current iteration number. The maximum number of iterations, Set the number of particles for this optimization requirement.
[0046] The pair The velocity of each particle is subject to a perturbation term, and the calculation formula is as follows:
[0047]
[0048] in, The numbering system used to sort particles according to their fitness values from smallest to largest; To apply interference to particles speed; Before applying interference, the particles speed, To determine the number of particles with small fitness values, For interval A vector of random numbers that are uniformly distributed within the vector.
[0049] Secondly, the present invention also provides a trajectory optimization system based on an improved particle swarm optimization algorithm, comprising:
[0050] The function construction module is used to obtain the performance indicators of interest during the flight of the aircraft, construct the cost function based on the performance indicators, and build the constraints between the command trajectory and the flight state.
[0051] The particle optimization module is used to sample the cost function, using the sampled points of the cost function as particles, and employing an improved particle swarm optimization algorithm to optimize the cost function, obtaining the global optimal position, and using the global optimal position as the final trajectory optimization result. The improved particle swarm optimization algorithm includes: initializing particles by specifying initial particle values, randomly assigning each particle to a team using the Monte Carlo method, updating the global optimal particle with the smallest fitness value for the first time using the gradient descent method, and updating the particle velocity and position a second time based on the optimal positions of each particle in the team and the optimal position of the particle itself, using second-order consistency theory.
[0052] Thirdly, this application proposes an electronic device, including: one or more processors, and a memory for storing instructions, which, when executed by the one or more processors, cause the one or more processors to execute the aforementioned trajectory optimization method based on an improved particle swarm optimization algorithm.
[0053] Fourthly, this application proposes a computer-readable storage medium storing executable instructions that, when executed, cause a processor to perform the aforementioned trajectory optimization method based on an improved particle swarm optimization algorithm.
[0054] Fifthly, this application proposes a computer program product, including a computer program or instructions that, when executed by a processor, implement the aforementioned trajectory optimization method based on an improved particle swarm optimization algorithm.
[0055] Beneficial effects:
[0056] This application proposes a trajectory optimization method and system based on an improved particle swarm optimization (PSO) algorithm. On one hand, it addresses the problems of premature convergence, getting trapped in local optima, and difficulty in balancing global and local search capabilities in traditional PSO algorithms. It improves the algorithm's global search capability by specifying initial particle values; it introduces gradient descent to solve for the global optimum position obtained in each iteration, thereby improving the algorithm's local search performance; it redesigns the particle velocity update method based on a second-order consensus algorithm, effectively improving the convergence speed while enhancing global search performance; furthermore, it prevents premature convergence by employing a last-place elimination mechanism and applying interference terms to particles with low cost values; and it increases population diversity by dividing particles into several teams and establishing a particle exchange mechanism between teams. On the other hand, by constructing a cost function for the optimization objective and designing constraints on the command trajectory and flight state, the improved PSO algorithm can optimize different optimization objectives during aircraft flight, such as maximum range and maximum flight time, to obtain optimized flight trajectories. Attached Figure Description
[0057] Figure 1 A flowchart of a trajectory optimization method based on an improved particle swarm optimization algorithm according to an embodiment of the present invention;
[0058] Figure 2 A schematic flowchart of a trajectory optimization method based on an improved particle swarm optimization algorithm according to an embodiment of the present invention;
[0059] Figure 3 A graph showing the variation of fitness values in an embodiment of the present invention;
[0060] Figure 4 An embodiment of the invention shows the variation of altitude with flight distance.
[0061] Figure 5 A graph showing the variation of flight range with flight time according to an embodiment of the present invention;
[0062] Figure 6 A graph showing the speed variation with flight time according to an embodiment of the present invention;
[0063] Figure 7 A schematic diagram of a trajectory optimization system based on an improved particle swarm optimization algorithm according to an embodiment of the invention. Detailed Implementation
[0064] The specific implementation methods of this application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0065] Example 1:
[0066] This embodiment provides a trajectory optimization method based on an improved particle swarm optimization algorithm, such as... Figure 1 As shown, it includes:
[0067] Step S100: Obtain the performance indicators of interest during the flight of the aircraft, construct a cost function based on the performance indicators, and build constraints between the command trajectory and the flight state;
[0068] In this embodiment, since the cruise segment accounts for the vast majority of the time and fuel consumption during flight, the trajectory optimization problem can be simplified to a cruise trajectory optimization problem when the maximum range is used as the optimization index. Furthermore, since the aircraft always satisfies or approximately satisfies the balance gliding constraints during cruise, the cruise trajectory optimization problem can be further simplified to a gliding state optimization problem within the longitudinal plane.
[0069] Select the maximum range of the aircraft As performance indicators, range and flight time maintain a linear correlation at a given cruise speed. When cruise thrust... Engine specific impulse and fuel quality Given time, range With flight time The index can be approximated as follows:
[0070] ;
[0071] ;
[0072] in, Total takeoff weight; Fuel consumption is required for climbing; This refers to the cruising speed.
[0073] The above analysis shows that, under optimal cruise conditions, the cruise state is... It should be the mass of the aircraft. The functional form of each instantaneous weight Each of these will correspond to an optimal cruising speed. With cruising altitude The solution process first involves selecting equidistant points for the aircraft weight. One sampling point:
[0074] ;
[0075] By performing cruise state optimization at each sampling point using the method described above, the set of sampling points for optimal cruise speed, optimal cruise altitude, angle of attack, engine thrust, engine power consumption per second, aerodynamic lift, and aerodynamic drag can be obtained. , , , , , , Let mapping , , , , , , All satisfy the piecewise spline interpolation form, with the following additional constraints added:
[0076] ;
[0077] ;
[0078] ;
[0079] ;
[0080] ;
[0081] ;
[0082] ;
[0083] ;
[0084] ;
[0085] At this point, the cruise segment command trajectory... , cruise status , , , , This can be uniquely solved. Flight time index The following constraints must be satisfied:
[0086] right The flight time can be obtained by numerical integration. Consumption curve per second With weight curve By substituting the weight curve into the command trajectory and cruise state, the flight state curve can be obtained. , , , , , .
[0087] Therefore, the range cost function can be approximated as follows:
[0088] ;
[0089] To maximize the range, the cost function is rewritten as:
[0090] ;
[0091] The above model can be optimized using the particle swarm optimization method.
[0092] Step S200: Sample the cost function, take the sampled points of the cost function as particles, and use an improved particle swarm optimization algorithm to optimize the cost function to obtain the global optimal position. Use the global optimal position as the final trajectory optimization result. The improved particle swarm optimization algorithm includes: initializing particles by specifying initial particle values, randomly assigning each particle to a team using the Monte Carlo method, updating the global optimal particle with the smallest fitness value for the first time using the gradient descent method, and updating the velocity and position of the particles for the second time based on the optimal positions of each particle in the team and the optimal position of the particle itself in the team, using the second-order consistency theory.
[0093] The improved particle swarm optimization algorithm is used to optimize the cost function and obtain the globally optimal position, such as... Figure 2 As shown, it includes:
[0094] Step S1: Initialize the particles using the method of specifying initial particle values, and initialize various parameters of the improved particle swarm algorithm;
[0095] The initialization of various parameters for the improved particle swarm optimization algorithm includes: the search center, radius, and range cost function based on the input altitude and flight speed; and setting the number of particles according to the optimization requirements. Maximum number of iterations Other non-optimization parameters, such as maximum number of particles in the team, number of steps for exchanging team members, and constraints, will use default values if no parameters are set; set the initial position and initial velocity of the particles.
[0096] The method of initializing particles using specified initial values includes:
[0097] Step S11: Determine the dimension of the set of possible optimal positions in the input parameters and the coordinate dimension of the search target. If they are equal, then use the set of possible optimal positions for the corresponding number of pairs. Initialize the particle positions and then... The initial velocity vector of each particle is set to 0. If they are not equal, proceed to step S12.
[0098] The input parameters include: search center, search radius, number of particles, maximum number of iterations, maximum value of inertia coefficient, minimum value of inertia coefficient, local optimal particle, global optimal particle, solution accuracy, set of N possible optimal points, forced rebirth ratio of particles with higher cost, explicit upper bound of cost function, whether to perform boundary sampling, maximum number of random initializations, maximum number of particle teams, minimum number of particle teams, and number of steps for exchanging members.
[0099] In this embodiment, the set of potentially optimal locations can be set based on engineering experience, guessing under what conditions the cost value might approach the optimal point. Alternatively, it can be set based on results obtained from previous optimization runs of the algorithm. The coordinate dimensions of the search target are determined according to the actual situation of the optimization object.
[0100] Step S12: Use the coordinates of the search center as the initial position of the next particle, and randomly sample within the search radius to obtain the initial velocity of the current particle;
[0101] Step S13: Determine whether the initial value setting in S11 and S12 has been completed, and whether the number of particles that have completed the initial setting is less than [a certain number]. If so, then the initial values of the current particle's position and velocity are sampled at the boundary; otherwise, proceed to step S14. The calculation formula for boundary sampling is as follows:
[0102] ;
[0103] in, For the first Initial position vector of the particle; To be Convert the vector to binary bits; The search radius vector; Search for the lower bound vector; For the first Initial velocity vector of the particle; A vector of random numbers that follows a standard normal distribution. for A dimensional column vector of all 1s;
[0104] Step S14: Remove The initial values of the remaining particles other than the first particle are initialized using a random sampling algorithm. The random sampling calculation formula is as follows:
[0105] ;
[0106] in, For interval A vector of random numbers that are uniformly distributed within the vector.
[0107] In S11 and S13, you can choose whether to use this initial value setting method based on the actual optimization needs.
[0108] Step S2: Using the Monte Carlo method, randomly assign each particle to a team, including:
[0109] Step S21: Using the Monte Carlo method, randomly assign each particle to a team, ensuring that the number of particles in each team is not greater than a set value and not less than 2.
[0110] Step S22: Under the condition that the minimum spanning tree exists in the communication topology, generate the adjacency matrix of each team's particles based on the Monte Carlo method.
[0111] In this embodiment, the adjacency matrix L of each team of particles is generated based on the Monte Carlo method, and the calculation formula is as follows:
[0112] , This represents the number of particles in the team.
[0113] Among them, the elements outside the diagonal in the adjacency matrix The value is determined to be 0 or 1 based on the Monte Carlo method, where n is the row and column symbol. for A real number matrix. If there exists a row in the adjacency matrix where all elements are 0, then the elements of that row are regenerated until there is at least one element with a value of 1 in that row.
[0114] Step S3: Update the current inertia weights using the terminal weight, initial weight, current iteration count, and maximum iteration count. Calculate the fitness value of each particle based on the cost function and the current particle position coordinates. The calculation formula is as follows:
[0115] ;
[0116] in, The inertia weight at iteration t. For terminal weight, As the initial weight, This represents the current iteration number. This represents the maximum number of iterations.
[0117] Step S4: Compare the fitness value of each particle with its own best fitness value, and record the position coordinate with the smallest fitness value as the current particle's best position; compare the best fitness value of each particle with the global best fitness value, and record the position coordinate with the smallest fitness value as the particle's global best position, and the corresponding particle is the global best particle.
[0118] In this embodiment, the fitness value of each particle is compared with its own recorded optimal fitness value. By comparison, the position coordinate with the smaller fitness value is recorded as the optimal position of the particle. Compare the optimal fitness values of each particle with the optimal fitness values recorded globally. By comparison, the position coordinate with the smaller fitness value is recorded as the optimal position for the global particle. .
[0119] Step S5: Use gradient descent to update the global optimal particle with the smallest fitness value for the first time. Based on the optimal position in the team and the optimal position of the particle itself, use second-order consistency theory to update the velocity and position of the particle for the second time, and constrain the position and velocity of all particles.
[0120] The process involves updating the particle's velocity and position a second time based on the optimal position within the team and the particle's own optimal position, using a second-order consistency theory. This includes:
[0121] If the current iteration count is a multiple of the set number of steps for exchanging team members, select the second-best fitness particle in each team, and randomly exchange the second-best fitness particle in each team based on the Monte Carlo method, while ensuring that the number of particles in each team remains unchanged.
[0122] Based on the optimal position in the team, the optimal position of the particle itself in the team, and the adjacency matrix, the velocity and position of the particle are updated a second time using the second-order consistency theory.
[0123] The particle's velocity and position are updated a second time based on the optimal position in the team, the optimal position of the particle itself, and the adjacency matrix, using second-order consistency theory. The calculation formula is as follows:
[0124] ;
[0125] in, For the team The Middle Particles The position vector at the next iteration; For the team The Middle The position vector of the particle at iteration t. For the team The Middle Particles The velocity vector at the next iteration; For the team The optimal position in; For the team Adjacency matrix in The corresponding element; For the team The Middle The optimal position of the particle itself; For the team The Middle The velocity vector of the particle at iteration t. For the team The Middle Particles The velocity vector at the next iteration As the first learning factor, As the second learning factor, Let be the inertia weight at iteration t.
[0126] The gradient descent method is used to update the global optimal particle with the smallest fitness value for the first time. The calculation formula is as follows:
[0127] ;
[0128] in, This represents the globally optimal position of the particle before the first search. This represents the globally optimal position of the particle after the first search. The search step size should be determined by minimizing the globally optimal particle fitness value. It is the negative gradient of the particle's global optimal position, i.e., the optimal search direction.
[0129] Step S6: When the current iteration number is less than the iteration number threshold, sort the current particles according to their fitness values from smallest to largest, and take the particles with smaller fitness values first. Each particle, for The velocity of each particle is subject to a perturbation term. It decreases as the number of iterations increases;
[0130] Take the one with the smaller fitness value 100 particles, of which 100 particles are present. The calculation formula is as follows:
[0131] ;
[0132] in, As the first weighting coefficient, This is the second weighting coefficient. This represents the current iteration number. The maximum number of iterations, The number of particles is set according to the optimization requirements. In this embodiment, , .
[0133] The pair The velocity of each particle is subject to a perturbation term, and the calculation formula is as follows:
[0134] ;
[0135] in, The numbering system used to sort particles according to their fitness values from smallest to largest; To apply interference to particles speed; Before applying interference, the particles speed, To determine the number of particles with a small fitness value.
[0136] Step S7: When the current iteration number is greater than or equal to the iteration number threshold, sort the particles according to their fitness values from largest to smallest, and select the particles with the largest fitness values first. Individual particles, targeting The process proceeds to step S1, where the particles are re-initialized using a method that specifies initial particle values.
[0137] Step S8: For all but For other particles of a given particle, if the current iteration count is less than the maximum iteration count, the current iteration count is incremented by 1 and the process proceeds to step S3 to recalculate the current inertia weight; if the current iteration count is equal to the maximum iteration count, the global optimal position and corresponding fitness value of the particle are output.
[0138] The specific implementation process of this embodiment is described in detail below with reference to a specific example:
[0139] 300 aircraft weight sampling points were selected at equal intervals; the search center for altitude and flight speed was set to 12000. With 250 The search radii for altitude and flight speed are set to 2000 respectively. With 100 The negative value of the flight distance is used as the cost function; the number of particles is 50, and the total number of iterations is 30; the maximum number of particles in the team is 5, and the number of steps for exchanging team members is 3. The initial position and initial velocity of the particles are set according to the rules.
[0140] Update inertia weights, setting the terminal weight in the updated particle inertia weights to... The initial weight is According to the cost function Calculate the particle fitness value based on the particle's position coordinates.
[0141] Compare the fitness value of each particle with its own recorded best fitness value. By comparison, the position coordinate with the smaller fitness value is recorded as the optimal position of the particle. Compare the optimal fitness values of each particle with the optimal fitness values recorded globally. By comparison, the position coordinate with the smaller fitness value is recorded as the optimal position for the global particle. .
[0142] The gradient descent method is used to solve for the globally optimal particle, and the particle velocity and position are updated based on the second-order consistency theory. The learning factor in updating the particle velocity and position is set as follows: , After the calculation is completed, the velocity and position of each particle are determined and constrained.
[0143] A perturbation term is applied to the velocities of particles with relatively low fitness values in sequence. The selection ratio decreases as the number of iterations increases. The weighting coefficient in the formula for selecting particles with relatively low fitness values is set to... , .
[0144] In the later stages of the iteration, a portion of the particles with higher fitness values are selected sequentially and regenerated. The selection ratio of particles with higher fitness values is set to 10%.
[0145] Determine the number of iterations Has the maximum number of iterations been reached, which is 30?
[0146] Simulation results show that the trajectory optimization method and system based on the improved particle swarm optimization algorithm provided in this invention, by constructing a cost function for the maximum range and designing constraints on the command trajectory and flight state, can obtain an optimized flight trajectory through optimization using the improved particle swarm optimization algorithm, such as... Figure 3 , Figure 4 , Figure 5 , Figure 6 As shown, the absolute value of the range index increased by 531.98 compared to the initial solution fitness value, an improvement of 3.02%, which verifies the effectiveness of the method of the present invention and clearly shows the optimization effect of the method of the present invention.
[0147] Example 2:
[0148] This embodiment also provides a trajectory optimization system based on an improved particle swarm optimization algorithm, such as... Figure 7 As shown, it includes: a function construction module and a particle optimization module, wherein the function construction module and the particle optimization module are connected;
[0149] The function construction module is used to obtain the performance indicators of interest during the flight of the aircraft, construct the cost function based on the performance indicators, and build the constraints between the command trajectory and the flight state.
[0150] The particle optimization module is used to sample the cost function, using the sampled points of the cost function as particles, and employing an improved particle swarm optimization algorithm to optimize the cost function, obtaining the global optimal position, and using the global optimal position as the final trajectory optimization result. The improved particle swarm optimization algorithm includes: initializing particles by specifying initial particle values, randomly assigning each particle to a team using the Monte Carlo method, updating the global optimal particle with the smallest fitness value for the first time using the gradient descent method, and updating the particle velocity and position a second time based on the optimal positions of each particle in the team and the optimal position of the particle itself, using second-order consistency theory.
[0151] Example 3:
[0152] This embodiment proposes an electronic device, including: one or more processors, and a memory, wherein the memory is used to store instructions, and when the instructions are executed by the one or more processors, the one or more processors execute the aforementioned trajectory optimization method based on an improved particle swarm optimization algorithm.
[0153] The electronic device may be a mobile phone, computer, or tablet computer, etc., and includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements a trajectory optimization method based on an improved particle swarm optimization algorithm as described in the embodiments. It is understood that the electronic device may also include input / output (I / O) interfaces and communication components.
[0154] The processor is used to execute all or part of the steps in the trajectory optimization method based on the improved particle swarm optimization algorithm as described in the above embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in the electronic device, as well as application-related data.
[0155] The processor can be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the trajectory optimization method based on the improved particle swarm algorithm described in the above embodiments.
[0156] Example 4:
[0157] This embodiment proposes a computer-readable storage medium that stores executable instructions. When these instructions are executed, if they are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0158] The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the trajectory optimization method based on the improved particle swarm algorithm described in the various embodiments of this application.
[0159] The aforementioned storage media include: flash memory, hard disks, multimedia cards, card-type memory (e.g., SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR) memory), random access memory (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, disks, optical discs, servers, APP (Application) application stores, and other media capable of storing program verification codes. These media store computer programs, which, when executed by a processor, can implement the various steps of the aforementioned trajectory optimization method based on an improved particle swarm optimization algorithm.
[0160] Example 5:
[0161] This embodiment proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the aforementioned trajectory optimization method based on an improved particle swarm optimization algorithm.
[0162] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a computer program product.
[0163] The various embodiments in this application are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0164] The scope of protection of this application is not limited to the embodiments described above. Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from the scope and spirit of this disclosure. If such modifications and variations fall within the scope of equivalent technology of this disclosure, then the intent of this disclosure also includes such modifications and variations.
Claims
1. A trajectory optimization method based on an improved particle swarm optimization algorithm, characterized in that, include: Obtain the performance indicators of interest during the flight of the aircraft, construct a cost function based on the performance indicators, and build constraints between the command trajectory and the flight state; The cost function is sampled, and the sampled points of the cost function are used as particles. An improved particle swarm optimization algorithm is used to optimize the cost function to obtain the global optimal position. The global optimal position is used as the final trajectory optimization result. The improved particle swarm optimization algorithm includes: initializing particles using a method that specifies initial particle values; randomly assigning each particle to a team using the Monte Carlo method; updating the global optimal particle with the smallest fitness value for the first time using the gradient descent method; and updating the particle's velocity and position a second time based on the optimal position of each particle in the team and the optimal position of the particle itself in the team, using the second-order consistency theory.
2. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 1, characterized in that, The step of optimizing the cost function using an improved particle swarm optimization algorithm to obtain the global optimal position includes: Step S1: Initialize the particles using the method of specifying initial particle values, and initialize various parameters of the improved particle swarm algorithm; Step S2: Use the Monte Carlo method to randomly assign each particle to a team; Step S3: Update the current inertia weight using the terminal weight, initial weight, current iteration number, and maximum iteration number; calculate the fitness value of each particle based on the cost function and the current particle position coordinates. Step S4: Compare the fitness value of each particle with its own best fitness value, and record the position coordinate with the smallest fitness value as the current particle's best position; compare the best fitness value of each particle with the best fitness value of all particles in the world, and record the position coordinate with the smallest fitness value in the current team as the particle's global best position, and the corresponding particle is the global best particle. Step S5: Use gradient descent to update the global optimal particle with the smallest fitness value for the first time; based on the optimal position in the team and the optimal position of the particle itself, use second-order consistency theory to update the velocity and position of the particle for the second time, and constrain the position and velocity of all particles. Step S6: When the current iteration number is less than the iteration number threshold, sort the current particles according to their fitness values from smallest to largest, and take the particles with smaller fitness values first. Each particle, for The velocity of each particle is subject to a perturbation term. It decreases as the number of iterations increases; Step S7: When the current iteration number is greater than or equal to the iteration number threshold, sort the particles according to their fitness values from largest to smallest, and select the particles with the largest fitness values first. Individual particles, targeting The process proceeds to step S1, where the particles are re-initialized using a method that specifies initial particle values. Step S8: For those other than For other particles of a given particle, if the current iteration count is less than the maximum iteration count, the current iteration count is incremented by 1 and the process proceeds to step S3 to recalculate the current inertia weight; if the current iteration count is equal to the maximum iteration count, the global optimal position and corresponding fitness value of the particle are output.
3. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 1, characterized in that, The method of initializing particles using specified initial values includes: Step S11: Determine the dimension of the set of possible optimal positions in the input parameters and the coordinate dimension of the search target. If they are equal, then use the set of possible optimal positions for the corresponding number of pairs. Initialize the particle positions and then... The initial velocity vector of each particle is set to 0. If they are not equal, proceed to step S12. Step S12: Use the coordinates of the search center as the initial position of the next particle, and randomly sample within the search radius to obtain the initial velocity of the current particle; Step S13: Determine whether the initial value setting in S11 and S12 has been completed, and whether the number of particles that have completed the initial setting is less than [a certain number]. If so, then the initial values of the current particle's position and velocity are sampled at the boundary; otherwise, proceed to step S14. The calculation formula for boundary sampling is as follows: ; in, For the first Initial position vector of the particle; To be Convert the vector to binary bits; The search radius vector; Search for the lower bound vector; For the first Initial velocity vector of the particle; A vector of random numbers that follows a standard normal distribution. for A dimensional column vector of all 1s; Step S14: Remove The initial values of the remaining particles other than the first particle are initialized using a random sampling algorithm. The random sampling calculation formula is as follows: ; in, For interval A vector of random numbers that are uniformly distributed within the vector.
4. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 1, characterized in that, The Monte Carlo method is used to randomly assign particles to teams, including: The Monte Carlo method is used to randomly assign each particle to a team, ensuring that the number of particles in each team is no more than a set value and no less than 2. Under the condition that a minimum spanning tree exists in the communication topology, the adjacency matrix of each team's particles is generated based on the Monte Carlo method.
5. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 1, characterized in that, The process involves updating the particle's velocity and position a second time based on the optimal position within the team and the particle's own optimal position, using a second-order consistency theory. This includes: If the current iteration count is a multiple of the set number of steps for exchanging team members, select the second-best fitness particle in each team, and randomly exchange the second-best fitness particle in each team based on the Monte Carlo method, while ensuring that the number of particles in each team remains unchanged. Based on the optimal position in the team, the optimal position of the particle itself in the team, and the adjacency matrix, the velocity and position of the particle are updated a second time using the second-order consistency theory.
6. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 1, characterized in that, Based on the optimal position in the team and the optimal position of the particle itself, the velocity and position of the particle are updated a second time using second-order consistency theory. The calculation formula is as follows: ; in, For the team Middle Particles The position vector at the next iteration; For the team Middle The position vector of the particle at iteration t. For the team Middle Particles The velocity vector at the next iteration; For the team The optimal position in; For the team Adjacency matrix in The corresponding element; For the team Middle The optimal position of the particle itself; For the team Middle The velocity vector of the particle at iteration t. For the team Middle Particles The velocity vector at the next iteration As the first learning factor, As the second learning factor, The inertia weight at iteration t. For interval A vector of random numbers uniformly distributed within the array. This represents the number of particles in the team.
7. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 2, characterized in that, The current inertia weight is updated using the terminal weight, the initial weight, the current iteration number, and the maximum iteration number, calculated as follows: ; in, The inertia weight at iteration t. For terminal weight, As the initial weight, This represents the current iteration number. This represents the maximum number of iterations.
8. The trajectory optimization method based on the improved particle swarm optimization algorithm according to claim 2, characterized in that, Take the one with the smaller fitness value 100 particles, of which 100 particles are present. The calculation formula is as follows: ; in, As the first weighting coefficient, This is the second weighting coefficient. This represents the current iteration number. The maximum number of iterations, Set the number of particles for this optimization requirement.
9. A trajectory optimization method based on an improved particle swarm optimization algorithm according to claim 2, characterized in that, The pair The velocity of each particle is subject to a perturbation term, and the calculation formula is as follows: ; in, The numbering system used to sort particles according to their fitness values from smallest to largest; To apply interference to particles speed; Before applying interference, the particles speed, To determine the number of particles with small fitness values, For interval A vector of random numbers that are uniformly distributed within the vector.
10. A trajectory optimization system based on an improved particle swarm optimization algorithm, characterized in that, include: The function construction module is used to obtain the performance indicators of interest during the flight of the aircraft, construct the cost function based on the performance indicators, and build the constraints between the command trajectory and the flight state. The particle optimization module is used to sample the cost function, using the sampled points of the cost function as particles, and to optimize the cost function using an improved particle swarm optimization algorithm to obtain the global optimal position. The global optimal position is then used as the final trajectory optimization result. The improved particle swarm optimization algorithm includes: initializing particles using a method that specifies initial particle values; randomly assigning each particle to a team using the Monte Carlo method; updating the global optimal particle with the smallest fitness value for the first time using the gradient descent method; and updating the particle's velocity and position a second time based on the optimal position of each particle in the team and the optimal position of the particle itself in the team, using the second-order consistency theory.
Citation Information
Cited By
NAND flash memory data migration method
CN122131985A
A method for migrating NAND flash memory data
CN122131985B