A fishery pond water temperature control optimization method based on swarm intelligence algorithm
By optimizing the parameters of the PID control system for fishpond water temperature using the improved narwhal optimization algorithm, the problems of control accuracy and stability under complex disturbances in traditional methods are solved, achieving efficient and stable temperature regulation and improving the performance of fishpond water temperature control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FRESHWATER FISHERIES RES INST OF SHANDONG PROVINCE
- Filing Date
- 2025-11-17
- Publication Date
- 2026-05-08
AI Technical Summary
Existing fishpond water temperature control systems struggle to achieve stable temperature regulation under complex external disturbances and high precision requirements. Traditional PID controllers and early intelligent optimization algorithms are prone to getting trapped in local optima and have slow convergence speeds, resulting in insufficient control accuracy and stability.
An improved narwhal optimization algorithm is introduced, which optimizes the parameters of the PID control system for fishery pond water temperature by employing mirrored habitat initialization, group cooperative hunting, reverse breakout under ice, and chaotic tusk stabbing strategies. This enhances the global search capability and convergence accuracy, achieving high-performance temperature control.
It significantly improves the accuracy and stability of water temperature control in fishponds, reduces temperature overshoot, shortens adjustment time, and ensures efficient, stable and safe operation of aquaculture.
Smart Images

Figure CN121115957B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of control optimization, and particularly relates to an optimization method for water temperature control in fishery ponds based on swarm intelligence algorithms. Background Technology
[0002] The water temperature control system in aquaculture ponds plays a central role in the aquaculture system. Its primary responsibility is to maintain the water temperature within a suitable range to meet the physiological needs of fish at different growth stages. Water temperature not only affects fish's feeding, digestion, and immune functions but also directly determines their metabolic intensity and growth rate. Therefore, the stability and accuracy of temperature control have become fundamental conditions for ensuring aquaculture efficiency, reducing risks, and improving survival rates. In actual operation, pond water temperature is constantly disturbed by various factors, including diurnal temperature differences, seasonal variations, wind speed changes, fluctuations in radiation intensity, changes in pond insulation conditions, and the heat generation effect from fish activities, leading to frequent changes in the water's thermal balance. The system needs to rely on natural heat dissipation, heating devices, cooling equipment, or circulating water systems to adjust for these disturbances in real time. These adjustments place higher demands on response speed, control precision, and dynamic adaptability. Currently, most farmers use manual adjustment or simple thermostats to trigger heating or cooling units by setting upper and lower thresholds. However, this coarse-grained control strategy is clearly insufficient in scenarios with frequent disturbances, rapid changes, and limited equipment performance. For example, the accumulation of sensor measurement deviations leads to increased control errors, the lag characteristics of heating devices or cooling modules cause temperature overshoot, and inconsistent linkage responses between different devices cause unstable regulation. These problems make it difficult for the system to maintain dynamic water temperature balance in complex environments, which can easily increase energy consumption costs and management burden. To overcome the limitations of traditional methods, the most advanced approach is to use PID controllers and their optimization strategies to improve system stability. PID controllers can adjust the output in real time according to the changing trend of the error, thereby improving overshoot, lag, and steady-state error problems in the temperature regulation process. To further improve the PID control effect, an even more advanced approach is to introduce intelligent optimization methods such as genetic algorithms and particle swarm optimization algorithms to tune the control parameters, thereby enhancing the system's sensitivity and adaptability to external disturbances. However, although these conventional intelligent optimization methods have improved tuning efficiency and control performance to some extent, they still generally suffer from defects such as being prone to getting trapped in local optima, slow convergence speed, and insufficient algorithm stability, making it difficult to maintain high-quality parameter optimization capabilities in high-dimensional complex search spaces.
[0003] Given the increasing randomness of aquatic environmental disturbances, the growing complexity of system dynamics, and the ever-increasing demands for control precision, relying solely on traditional PID tuning methods or early intelligent optimization algorithms is no longer sufficient to meet the higher requirements of stability, robustness, and adaptability in modern aquaculture systems. Therefore, introducing more advanced swarm intelligence optimization algorithms, leveraging their advantages in global search capabilities, escape mechanisms from local optima, faster convergence speeds, and structural scalability, to deeply optimize the PID parameters of pond water temperature control systems has become an inevitable requirement for the development of digital fisheries. These swarm intelligence optimization algorithms can achieve higher quality and more adaptable parameter optimization in complex environments with multiple constraints, multiple disturbances, and significant nonlinear characteristics. Summary of the Invention
[0004] To overcome the technical problems described in the background section, this invention provides an optimization method for fishery pond water temperature control based on a swarm intelligence algorithm. It introduces a swarm intelligence optimization algorithm, namely an improved narwhal optimization algorithm, which achieves high-performance control of pond water temperature and provides reliable control technology support for ensuring efficient, stable and safe operation of aquaculture.
[0005] The technical solution of this invention is: a method for optimizing the control of water temperature in fishponds based on swarm intelligence algorithms, comprising the following steps:
[0006] S1. Construct a PID control system for fishery pond water temperature, including a pond water temperature error calculation module, a pond water temperature PID controller module, an improved narwhal optimization algorithm module, a pond water temperature regulation module, and a pond water temperature monitoring module.
[0007] S2. Introduce an improved narwhal optimization algorithm. Specific improvement strategies include:
[0008] S21. Introduce a mirrored habitat initialization strategy, which generates a random population and a corresponding reverse population, and selects the best one from them to improve the quality of the initial population.
[0009] S22. Introduce a group cooperative hunting strategy, when the strategy selects a random number. Less than the exploration rate At that time, a group cooperative hunting strategy is implemented to enhance global search capabilities. When the strategy selects a random number... Not less than the exploration rate At that time, it employs a strategy of stunning and preying on prey with its long tusks;
[0010] S23. Introduce a reverse breakout strategy under the ice layer, when the optimal prey position is... continuous Before the upgrade, a reverse breakout strategy under the ice layer is triggered, generating... Inverse solution And perform a selective replacement to escape local optima, where The stagnation threshold;
[0011] S24. Introduce a chaotic long-toothed spiking strategy, when the number of iterations... Greater than the initial iteration number of the later stage At that time, using the Tent chaotic mapping pair Perturb and generate And perform selective replacements to improve the convergence accuracy in the later stages;
[0012] S3. The improved narwhal optimization algorithm is used to tune the PID control parameters of the pond water temperature in the PID control system of the fishery pond water temperature, and the optimal control parameters are obtained through optimization.
[0013] S4. The optimal control parameters obtained by using the improved narwhal optimization algorithm are set as the parameters of the PID controller for pond water temperature in the fishery pond water temperature PID control system to optimize the pond water temperature regulation and control effect.
[0014] Furthermore, in the fishery pond water temperature PID control system constructed in step S1, the actual pond water temperature is collected by the pond water temperature monitoring module and transmitted to the pond water temperature error calculation module. The pond water temperature error calculation module receives the set target pond water temperature, calculates the error between the target temperature and the actual temperature, and outputs the real-time error to the pond water temperature PID controller module. The improved narwhal optimization algorithm module then optimizes the internal parameters of the PID controller module. Through continuous optimization, the optimized PID controller calculates the control quantity based on the error and outputs it to the pool water temperature regulation module to regulate the pool water temperature.
[0015] Furthermore, the mirror habitat initialization strategy in step S21 includes the following steps:
[0016] S211, in the search space and Internal random generation The initial narwhal ;
[0017] S212, Through calculate A reverse solution and to Boundary repair is performed, among which The solution is the reverse. As the lower bound of the search space, The upper bound of the search space, The initial narwhal;
[0018] S213, Merging and Formation includes A population of candidate solutions;
[0019] S214, Assessment The fitness of each candidate solution is evaluated, and the solution with the best fitness is selected. One solution is used as the initial narwhal population. .
[0020] Furthermore, the group cooperative hunting strategy in step S22 includes the following steps:
[0021] S221. Randomly select two indices different from the current index. index and ;
[0022] S222, Calculate the DE mutation vector ,
[0023] ,
[0024] in For DE mutation vectors, For the current individual position, Scaling factor For the best prey position, and The location of the individual is randomly selected;
[0025] S223, Generate DE test vectors ,right Each dimension ,when or Equal to random dimension index hour, ,otherwise ,in A random number between 0 and 1 The crossover probability;
[0026] S224, New location Set as .
[0027] Furthermore, the tusk stun and predation strategy in step S22 includes the following steps:
[0028] S225, Based on the policy selection random number used for policy selection And generate random numbers using coefficients. ;
[0029] S226. Calculate the utilization coefficient ,
[0030] ,
[0031] in To explore the decay factor, Select random numbers for the strategy to be used in strategy selection;
[0032] S227. Calculate the utilization coefficient ,
[0033] ,
[0034] in The random number generated in step S225;
[0035] S228, Calculate suction strength ,
[0036] ,
[0037] in The suction strength, For use in dynamically updating the exploration rate The prey's energy For the current individual Best prey location The Euclidean distance between them, where the following relationship is satisfied;
[0038] ,
[0039] and Let t be the energy decay rate, and t be the number of iterations.
[0040] S229, Calculate suction force ,
[0041] ,
[0042] in For suction, The suction strength, For use in dynamically updating the exploration rate The prey's energy;
[0043] S2210, Update Individual Location ,
[0044] ,
[0045] in The updated position For the current individual, For the best prey position, For individuals The sound wave intensity, where D is the dimension of the solution vector. It is a dimension-independent random noise vector.
[0046] Furthermore, the sub-ice escape strategy in step S23 includes the following steps:
[0047] S231, Through calculate Inverse solution And perform boundary repair, among which The solution is the reverse. As the lower bound of the search space, The upper bound of the search space, The best position for prey;
[0048] S232, Assessment Obtain fitness ;
[0049] S233, when the fitness of the reverse solution Less than optimal fitness Update and and reset the stall counter. It is 0.
[0050] Furthermore, the chaotic tooth-piercing strategy in step S24 includes the following steps:
[0051] S241. Update chaotic variables via Tent chaotic mapping ;
[0052] S242, Calculate the step size of the chaotic perturbation. ,
[0053] ,
[0054] in Let the step size be the chaotic perturbation step size. This represents the current iteration number. This is the starting iteration number for the later stage. This represents the maximum number of iterations.
[0055] S243, Generating chaotic perturbation solutions And perform boundary repair.
[0056] ,
[0057] in This is a solution for chaotic perturbations. For the best prey position, Let the step size be the chaotic perturbation step size. The upper bound of the search space, As the lower bound of the search space, For Tent, a chaotic variable;
[0058] S244, Assessment Obtain fitness ;
[0059] S245, When the fitness of the reverse solution Less than optimal fitness Update and and reset the stall counter. It is 0.
[0060] Furthermore, the specific steps of step S3 include:
[0061] S31. Start a process from the current iteration number. up to the maximum number of iterations Iterative optimization loop;
[0062] S32. In the iterative loop, calculate all individuals. sound wave intensity Used for stun and predation strategies with long tusks;
[0063] S33, Traverse every individual in the population. According to the exploration rate And strategy to select random numbers Selectively execute group cooperative hunting strategies or tusk stun and predation strategies to generate new locations. ;
[0064] S34, For all new locations Perform boundary repair and calculate its fitness;
[0065] S35, Update Population for ;
[0066] S36. Update the global best prey location based on the updated population. and stall counter ;
[0067] S37, Determine if the stall counter is stopped Is it greater than the stagnation threshold? ,if Greater than If so, execute the reverse breakout strategy under the ice layer. Not greater than If so, skip the reverse breakout strategy under the ice layer and proceed to step S38;
[0068] S38. Determine the current iteration number. Is it greater than the initial iteration number of the later stage? ,if Greater than Then execute the Chaotic Tooth Spike strategy, if Not greater than If so, skip the Chaos Fang Strike strategy and continue the loop;
[0069] S39, when achieve When the time comes, end the iterative optimization loop and output. .
[0070] Furthermore, step S3, during the execution of the iterative optimization loop, also includes updating the hunting state:
[0071] S3001, Update the exploration attenuation factor ,
[0072] ,
[0073] in To explore the decay factor, This represents the current iteration number. This represents the maximum number of iterations.
[0074] S3002, Update Prey Energy ,
[0075] ,
[0076] in For the prey's energy, Energy decay rate, This represents the current iteration number;
[0077] S3003, Dynamically Updated Exploration Rate ,
[0078] Calculate fitness improvement value ,
[0079] in For fitness improvement value, For optimal adaptation to the previous generation, This represents the current optimal fitness level.
[0080] when Less than the preset improvement threshold At that time, set First exploration rate ,
[0081] when Not less than and Less than the preset energy threshold At that time, set For the second exploration rate ,
[0082] when Not less than and Not less than At that time, set First exploration rate .
[0083] Furthermore, the improved narwhal optimization algorithm in step S3 is used to evaluate the fitness function of the PID control parameters. for:
[0084] ,
[0085] in For the settling time, its threshold is a preset value. Weighting for overshoot penalty This represents the percentage of overshoot in the step response.
[0086] The beneficial effects of the above technical solution are as follows: This invention introduces a swarm intelligence optimization algorithm, namely the improved narwhal optimization algorithm, which achieves high-performance control of pool water temperature. Compared with the limitations of the narwhal optimization algorithm in terms of insufficient exploration ability and limited convergence accuracy when dealing with complex control problems, this improved algorithm achieves a significant improvement in comprehensive performance through multi-strategy fusion. First, the mirror habitat initialization strategy ensures that the initial population has better quality and wider coverage in the PID parameter search space by generating and screening reverse solutions, laying a solid foundation for global optimization. Second, the introduced swarm cooperative hunting mechanism draws on the mutation idea of differential evolution, greatly enhancing the algorithm's global exploration ability, enabling it to effectively explore a wider parameter region to achieve its goals. The algorithm finds a potential better solution; the ice-covered reverse breakout strategy designed to address algorithm stagnation gives the algorithm the ability to actively escape when trapped in local optima. The chaotic tusk-like precision strategy in the later stages of iteration utilizes the ergodicity of chaotic mapping to perform a fine search of the neighborhood of the optimal solution, significantly improving the final accuracy of parameter optimization. By applying the improved narwhal optimization algorithm to the parameter tuning of the PID controller for water temperature in fishery ponds, an optimal parameter combination that balances dynamic response and steady-state accuracy can be found. When the temperature setpoint changes abruptly, the system overshoot is effectively suppressed, and the settling time is also greatly shortened. In the steady-state operation phase, the control accuracy is higher, and the water temperature can be stabilized within a very small error range. This provides reliable control technology support for ensuring the efficient, stable, and safe operation of aquaculture. Attached Figure Description
[0087] Figure 1This is a schematic diagram of the process for optimizing pool water temperature control according to the present invention.
[0088] Figure 2 This is a schematic block diagram illustrating the four improvement strategies of the improved narwhal optimization algorithm in this invention.
[0089] Figure 3 This is a comparison chart of the fitness curves of the narwhal optimization algorithm and the improved narwhal optimization algorithm in this invention.
[0090] Figure 4 This is a comparison chart of the adaptive step response curves of the narwhal optimization algorithm and the improved narwhal optimization algorithm in this invention.
[0091] Figure 5 This is a comparison graph of the Kp optimization curves of the narwhal optimization algorithm and the improved narwhal optimization algorithm in this invention.
[0092] Figure 6 This is a graph showing the Ki optimization curves of the narwhal optimization algorithm and the improved narwhal optimization algorithm in this invention.
[0093] Figure 7 This is a comparison graph of the Kd optimization curves of the narwhal optimization algorithm and the improved narwhal optimization algorithm in this invention. Detailed Implementation
[0094] Example 1: As Figures 1-7 As shown, this invention provides an optimization method for fishpond water temperature control based on swarm intelligence algorithms, comprising the following steps:
[0095] S1. Construct a PID control system for fishery pond water temperature, including a pond water temperature error calculation module, a pond water temperature PID controller module, an improved narwhal optimization algorithm module, a pond water temperature regulation module, and a pond water temperature monitoring module.
[0096] S2. Introduce an improved narwhal optimization algorithm. Specific improvement strategies include:
[0097] S21. Introduce a mirrored habitat initialization strategy, which generates a random population and a corresponding reverse population, and selects the best one from them to improve the quality of the initial population.
[0098] S22. Introduce a group cooperative hunting strategy, when random numbers... Less than At that time, a group cooperative hunting strategy is implemented to enhance global search capabilities, when random numbers... Not less than At that time, they employ a strategy of stunning their prey with their long tusks;
[0099] S23. Introduce a reverse breakout strategy under the ice layer, when the optimal prey position is... continuous Before the upgrade, a reverse breakout strategy under the ice layer is triggered, generating... Inverse solution And perform selective replacement to escape local optima;
[0100] S24. Introduce a chaotic long-toothed spiking strategy, when the number of iterations... Greater than the initial iteration number of the later stage At that time, using the Tent chaotic mapping pair Perturb and generate And perform selective replacements to improve the convergence accuracy in the later stages;
[0101] S3. The improved narwhal optimization algorithm is used to tune the PID control parameters of the pond water temperature in the PID control system of the fishery pond water temperature, and the optimal control parameters are obtained through optimization.
[0102] S4. The optimal control parameters obtained by using the improved narwhal optimization algorithm are set as the parameters of the PID controller for pond water temperature in the fishery pond water temperature PID control system to optimize the pond water temperature regulation and control effect.
[0103] The mirror habitat initialization strategy in step S21 includes the following steps:
[0104] S211, in the search space and Internal random generation The initial narwhal ;
[0105] S212, Through calculate A reverse solution and to Boundary repair is performed, among which The solution is the reverse. As the lower bound of the search space, The upper bound of the search space, The initial narwhal;
[0106] S213, Merging and Formation includes A population of candidate solutions;
[0107] S214, Assessment The fitness of each candidate solution is evaluated, and the solution with the best fitness is selected. One solution is used as the initial narwhal population. .
[0108] The group cooperative hunting strategy in step S22 includes the following steps:
[0109] S221. Randomly select two indices different from the current index. index and ;
[0110] S222, Calculate the DE mutation vector ,
[0111] ,
[0112] in For DE mutation vectors, For the current individual position, Scaling factor For the best prey position, and The location of the individual is randomly selected;
[0113] S223, Generate DE test vectors ,right Each dimension ,when or Equal to random dimension index hour, ,otherwise ,in A random number between 0 and 1 The crossover probability;
[0114] S224, New location Set as .
[0115] The tusk stun and predation strategy in step S22 includes the following steps:
[0116] S225, Based on the policy selection random number used for policy selection And generate random numbers using coefficients. ;
[0117] S226. Calculate the utilization coefficient ,
[0118] ,
[0119] in To explore the decay factor, Choose random numbers for the strategy;
[0120] S227. Calculate the utilization coefficient ,
[0121] ,
[0122] in The random number generated in step S225;
[0123] S228, Calculate suction strength ,
[0124] ,
[0125] in The suction strength, For the prey's energy, For the current individual Best prey location Euclidean distance between them;
[0126] S229, Calculate suction force ,
[0127] ,
[0128] in For suction, The suction strength, Energy for the prey;
[0129] S2210, Update Individual Location ,
[0130] ,
[0131] in The updated position For the current individual, For the best prey position, For individuals The sound wave intensity, where D is the dimension of the solution vector. It is a dimension-independent random noise vector.
[0132] The sub-ice escape strategy in step S23 includes the following steps:
[0133] S231, Through calculate Inverse solution And perform boundary repair, among which The solution is the reverse. As the lower bound of the search space, The upper bound of the search space, The best position for prey;
[0134] S232, Assessment Obtain fitness ;
[0135] S233, when Less than Update and and reset It is 0.
[0136] The chaotic tooth-piercing strategy in step S24 includes the following steps:
[0137] S241. Update chaotic variables via Tent mapping ;
[0138] S242, Calculate the step size of the chaotic perturbation. ,
[0139] ,
[0140] in Let the step size be the chaotic perturbation step size. This represents the current iteration number. This is the starting iteration number for the later stage. This represents the maximum number of iterations.
[0141] S243, Generating chaotic perturbation solutions And perform boundary repair.
[0142] ,
[0143] in This is a solution for chaotic perturbations. For the best prey position, Let the step size be the chaotic perturbation step size. The upper bound of the search space, As the lower bound of the search space, For Tent, a chaotic variable;
[0144] S244, Assessment Obtain fitness ;
[0145] S245, when Less than Update and and reset It is 0.
[0146] In the fishpond water temperature PID control system constructed in step S1, the actual pond water temperature is collected by the pond water temperature monitoring module and transmitted to the pond water temperature error calculation module. The pond water temperature error calculation module receives the set target pond water temperature, calculates the error between the target temperature and the actual temperature, and outputs the real-time error to the pond water temperature PID controller module. The improved narwhal optimization algorithm module optimizes the internal parameters of the PID controller module. Continuous optimization is performed. The optimized PID controller calculates the control quantity based on the error and outputs it to the pool water temperature regulation module to regulate the pool water temperature. The pool water temperature setpoint is stepped up from 22°C to 25°C, and this step adjustment process is used as a typical operating condition for optimizing the PID control parameters and evaluating the control performance. Based on the temperature response data collected under this condition, and considering the characteristics of the aquaculture pool water—large heat capacity, significant thermal inertia, and limited transmission delay introduced by the temperature sensor response and circulating water flow—the aquaculture pool temperature control object is modeled and equivalent to a first-order linear system with pure time delay. Its transfer function... The formula is:
[0147] ,
[0148] in As a complex variable, after system identification, the system gain is... The value is 0.2, the time constant. The value is 120, and the input delay is... A value of 5 is used to characterize the slow response of the water body to changes in heating / cooling power and the time lag caused by the measurement and mixing process. Based on the above object model, with the initial pool water temperature of 22°C, the target temperature of 25°C, and the simulation duration of 250 seconds as boundary conditions, and after normalizing the initial pool water temperature of 22°C and the target temperature of 25°C, an optimization problem for the parameters of the PID controller for the pool water temperature is constructed. Defined as a three-dimensional decision variable, and the control law of the pool water temperature PID controller. To use with filter coefficients The structure,
[0149] ,
[0150] in For proportional gain, For integral gain, For differential gain, These are filter coefficients with a value of 0.01;
[0151] During the process of adjusting the pool water temperature from 22°C to 25°C, the step response overshoot The fitness function for evaluating the performance of each set of PID parameters is constructed by limiting the target settling time to no more than 120 seconds and setting the stability threshold to 0.02, with the target settling time not exceeding 2%. The formula is:
[0152] ,
[0153] in To determine the settling time, the threshold value is set to 0.02. The overshoot penalty weight is set to 100. This represents the percentage of overshoot in the step response.
[0154] The specific steps for tuning the PID control parameters of the pond water temperature in the fishery pond water temperature PID control system using the improved narwhal optimization algorithm are as follows:
[0155] Step 1: Initialize the control parameters of the improved narwhal optimization algorithm;
[0156] Step 1.1: Set the scaling factor for differential evolution. The value is 0.5, and the crossover probability is... A value of 0.9 represents the stagnation threshold for a reverse breakout. The value is 15, which represents the amplitude of the sound wave. Values , wave number Values angular frequency Values Sound wave attenuation Values Energy decay Values Population size The value is 30, representing the maximum number of iterations. The value is 500, and the solution vector dimension is... Values ,correspond , , Three parameters, lower bound of the search space Values Upper bound of search space Values The number of initial iterations in the later stage Through formula Obtain, among which, This represents the maximum number of iterations.
[0157] Step 1.2: Execute the mirror habitat initialization strategy;
[0158] Step 1.2.1, in the search space and Internal random generation An initial narwhal solution ;
[0159] Step 1.2.2: Calculate the inverse solution ,
[0160] ,
[0161] in for One corresponding inverse solution;
[0162] Steps 1, 2, and 3: [Regarding...] Chinese Super League or Boundary repair is performed in the dimension of [the boundary].
[0163] Step 1.2.4, Merge and Form a containing A temporary population of candidate solutions;
[0164] Step 1.2.5, Evaluation Fitness of candidate solutions ;
[0165] Step 1.2.6, from Choose the best fitness solution from the candidate solutions. One solution, as the initial narwhal population , The value range is 1 to ;
[0166] Step 1.3: Determine the initial optimal prey location and initialize the internal state;
[0167] Step 1.3.1, in Individual narwhal In the process, determine fitness. The optimal individual's location is recorded as the best prey location. Its fitness is denoted as ;
[0168] Step 1.3.2: Initialize prey energy The value is 1;
[0169] Step 1.3.3: Initialize the stall counter The value is 0;
[0170] Step 1.3.4: Initialize chaotic variables It is a random number between 0 and 1;
[0171] Step 1.3.5: Record the best fit of the previous generation. Its value is set to ;
[0172] Step 2: Execute the iterative optimization loop;
[0173] Step 2.1: Start the loop, from... Beginning, until Reaching the maximum number of iterations ;
[0174] Step 2.2: Update the state variables that the iteration depends on;
[0175] Step 2.2.1: Update the exploration decay factor The formula is ,in To explore the decay factor, This represents the current iteration number;
[0176] Step 2.2.2: Update prey energy and ensure Not less than 0
[0177] ,
[0178] in Energy decay rate;
[0179] Step 2.2.3: Dynamically update the exploration rate. , The value is used to control the choice between group cooperative hunting strategies and tusk stun and predation strategies. First, the fitness improvement value is calculated. ,
[0180] when When less than 0.01, set The value is 0.7;
[0181] when Not less than 0.01 and When less than 0.3, set The value is 0.3;
[0182] when Not less than 0.01 and When the value is not less than 0.3, set The value is 0.7;
[0183] Step 2.2.4, Record ;
[0184] Step 2.3: Calculate sonar and suction parameters, which are used for tusk stun and predation strategies;
[0185] Step 2.3.1: Traverse all individual narwhals. ,calculate and cosine distance ;
[0186] Step 2.3.2: Traverse all individual narwhals. Calculate sound wave intensity In the calculation This represents the current iteration number;
[0187] Step 2.4: Traverse the narwhal population Zhong Cong arrive All individuals execute the individual update strategy.
[0188] Step 2.4.1: Generate random numbers for strategy selection. ;
[0189] Step 2.4.2, when Less than At that time, a group cooperative hunting strategy is implemented, which includes the following steps:
[0190] Step 2.4.2.1: Randomly select two indices different from the current index. index and ;
[0191] Step 2.4.2.2: Calculate the DE mutation vector. ,
[0192] ,
[0193] in Scaling factor For the best prey position, For the current individual position, and The location of the individual is randomly selected;
[0194] Step 2.4.2.3: Generate DE test vectors ,right Each dimension When a random number between 0 and 1 Less than the crossover probability or Equal to random dimension index hour, ,otherwise ;
[0195] Step 2.4.2.4: Move to the new position Set as ;
[0196] Step 2.4.3, when Not less than At that time, the tusk stun and predation strategy is executed, which includes the following steps:
[0197] Step 2.4.3.1: Generate random numbers using coefficients. ;
[0198] Step 2.4.3.2: Calculate the utilization factor A.
[0199] ,
[0200] in To utilize coefficient A, Select random numbers for the strategy generated in step 2.4.1;
[0201] Step 2.4.3.3: Calculate the utilization factor C.
[0202] ,
[0203] in The utilization factor is C;
[0204] Step 2.4.3.4: Calculate the suction strength. ,
[0205] ,
[0206] in for and Euclidean distance between them;
[0207] Step 2.4.3.5: Calculate suction force ,
[0208] ;
[0209] Step 2.4.3.6: Update the new location ,
[0210] ,
[0211] in For individuals The intensity of the sound waves, It is a dimension-independent random noise vector;
[0212] Step 2.5: Perform boundary processing and evaluation;
[0213] Step 2.5.1, for arrive All new locations Perform boundary checks to ensure exist and Within the range;
[0214] Step 2.5.2: Evaluate all new locations. fitness ;
[0215] Step 2.6: Perform population selection;
[0216] Step 2.6.1: After completing the individual traversal, update the population by adopting a strategy of always accepting new positions. Updated to , Updated to ;
[0217] Step 2.7: Perform global optimal update and stall detection;
[0218] Step 2.7.1, in the current population Find the current best fitness and its current best position ;
[0219] Step 2.7.2, when Less than Update and and reset The value is 0;
[0220] Step 2.7.3, when Not less than hour, ;
[0221] Step 2.8: Implement the strategy of breaking through the ice layer from below;
[0222] Step 2.8.1, when Greater than At that time, the reverse breakout strategy under the ice layer is triggered;
[0223] Step 2.8.2: Calculate the inverse solution The formula is ;
[0224] Step 2.8.3, regarding Perform boundary repair;
[0225] Step 2.8.4, Assessment Obtain the fitness of the reverse solution ;
[0226] Step 2.8.5, when Less than Update and and reset The value is 0;
[0227] Step 2.9: Execute the Chaotic Tooth-Growing Strike Strategy;
[0228] Step 2.9.1, when Greater than At that time, the Chaos Fang Spike strategy is triggered;
[0229] Step 2.9.2: Update chaotic variables via Tent mapping :when hour, ;
[0230] when hour, ;
[0231] Step 2.9.3: Calculate the chaotic perturbation step size. ,
[0232] ;
[0233] Step 2.9.4: Generate chaotic perturbation solutions ,
[0234] ;
[0235] Step 2.9.5, regarding Perform boundary repair;
[0236] Step 2.9.6, Assessment Obtain the fitness of the chaotic solution ;
[0237] Step 2.9.7, when Less than Update and and reset The value is 0;
[0238] Step 3, when achieve Afterwards, the loop ends, and the final optimal prey location is output. , This refers to the PID control parameters for the pond water temperature of the fishery pond water temperature PID control system obtained through tuning. , and .
[0239] This paper presents code for implementing the narwhal optimization algorithm in Matlab to integrate and improve the PID control parameters of the fishpond water temperature PID control system. Comparative results were obtained, as follows: Figures 3-7 As shown.
[0240] Among them, such as Figure 3 As shown, the improved Narwhale optimization algorithm converges to a final fitness value of approximately 86.95 after about 30 iterations. The improved Narwhale optimization algorithm converges to a final fitness value of approximately 121.18 after about 8 iterations. The improved Narwhale optimization algorithm achieves a greater decrease in fitness value in the early stages of iteration (within about 10 iterations), indicating that the improved Narwhale optimization algorithm exhibits stronger global search capabilities, enabling it to converge to a better solution space; among which... Figure 4 As shown, the improved narwhal optimization algorithm results in a system response with a smaller overshoot that does not exceed the required 2%, while the improved narwhal optimization algorithm results in a system response with a larger overshoot that exceeds the required 2%; and as... Figure 5 As shown, after 33 iterations, the narwhal optimization algorithm and the improved narwhal optimization algorithm found... , and All parameters converged to stable values without subsequent fluctuations. Therefore, the improved Narwhale optimization algorithm is superior to the original Narwhale optimization algorithm, and the optimized PID control parameter combination... =[8.7156, 0.1412, 14.7048] enables more stable pool water temperature control.
Claims
1. A method for optimizing water temperature control in fishponds based on swarm intelligence algorithms, characterized in that, Includes the following steps: S1. Construct a PID control system for fishery pond water temperature, including a pond water temperature error calculation module, a pond water temperature PID controller module, an improved narwhal optimization algorithm module, a pond water temperature regulation module, and a pond water temperature monitoring module. S2. Introduce an improved narwhal optimization algorithm. Specific improvement strategies include: S21. Introduce a mirrored habitat initialization strategy, which generates a random population and a corresponding reverse population, and selects the best one from them to improve the quality of the initial population. S22. Introduce a group cooperative hunting strategy, when the strategy selects a random number. Less than the exploration rate At that time, a group cooperative hunting strategy is implemented to enhance global search capabilities. When the strategy selects a random number... Not less than the exploration rate At that time, they employ a strategy of stunning their prey with their long tusks; S23. Introduce a reverse breakout strategy under the ice layer, when the optimal prey position is... continuous Before the upgrade, a reverse breakout strategy under the ice layer is triggered, generating... Inverse solution And perform a selective replacement to escape local optima, where The stagnation threshold; S24. Introduce a chaotic long-toothed spiking strategy, when the number of iterations... Greater than the initial iteration number of the later stage At that time, using the Tent chaotic mapping pair Perturb and generate And perform selective replacements to improve the convergence accuracy in the later stages; S3. The improved narwhal optimization algorithm is used to tune the PID control parameters of the pond water temperature in the PID control system of the fishery pond water temperature, and the optimal control parameters are obtained through optimization. S4. The optimal control parameters obtained by using the improved narwhal optimization algorithm are set as the parameters of the PID controller for pond water temperature in the fishery pond water temperature PID control system to optimize the pond water temperature regulation and control effect.
2. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, In the fishery pond water temperature PID control system constructed in step S1, the actual pond water temperature is collected by the pond water temperature monitoring module and transmitted to the pond water temperature error calculation module. The pond water temperature error calculation module receives the set target pond water temperature, calculates the error between the target temperature and the actual temperature, and outputs the real-time error to the pond water temperature PID controller module. The improved narwhal optimization algorithm module optimizes the internal parameters of the PID controller module. Through continuous optimization, the optimized PID controller calculates the control quantity based on the error and outputs it to the pool water temperature regulation module to regulate the pool water temperature.
3. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, The mirror habitat initialization strategy in step S21 includes the following steps: S211, in the search space and Internal random generation The initial narwhal ; S212, Through calculate A reverse solution and to Boundary repair is performed, among which The solution is the reverse. As the lower bound of the search space, The upper bound of the search space, The initial narwhal; S213, Merging and Formation includes A population of candidate solutions; S214, Assessment The fitness of each candidate solution is evaluated, and the solution with the best fitness is selected. One solution is used as the initial narwhal population. .
4. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, The group cooperative hunting strategy in step S22 includes the following steps: S221. Randomly select two indices different from the current index. index and ; S222, Calculate the DE mutation vector , , in For DE mutation vectors, For the current individual position, Scaling factor For the best prey position, and The location of the individual is randomly selected; S223, Generate DE test vectors ,right Each dimension ,when or Equal to random dimension index hour, ,otherwise ,in A random number between 0 and 1 The crossover probability; S224, New location Set as .
5. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, The tusk stun and predation strategy in step S22 includes the following steps: S225, Based on the policy selection random number used for policy selection And generate random numbers using coefficients. ; S226. Calculate the utilization coefficient , , in To explore the decay factor, Select random numbers for the strategy to be used in strategy selection; S227. Calculate the utilization coefficient , , in The random number generated in step S225; S228, Calculate suction strength , , in The suction strength, For use in dynamically updating the exploration rate The prey's energy For the current individual Best prey location The Euclidean distance between them, where the following relationship is satisfied; , and is the energy attenuation rate, and t is the number of iterations; S229, Calculate suction force , , in For suction, The suction strength, For use in dynamically updating the exploration rate The prey's energy; S2210, Update Individual Location , , in The updated position For the current individual, For the best prey position, For individuals The sound wave intensity, where D is the dimension of the solution vector. It is a dimension-independent random noise vector.
6. The method for optimizing water temperature control in fishponds based on swarm intelligence algorithms according to claim 1, characterized in that, The sub-ice escape strategy in step S23 includes the following steps: S231, Through calculate Inverse solution And perform boundary repair, among which The solution is the reverse. As the lower bound of the search space, The upper bound of the search space, The best position for prey; S232, Assessment Obtain fitness ; S233, when the fitness of the reverse solution Less than optimal fitness Update and and reset the stall counter. It is 0.
7. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, The chaotic long-toothed piercing strategy in step S24 includes the following steps: S241. Update chaotic variables via Tent chaotic mapping ; S242, Calculate the step size of the chaotic perturbation. , , in Let the step size be the chaotic perturbation step size. This represents the current iteration number. This is the starting iteration number for the later stage. This represents the maximum number of iterations. S243, Generating chaotic perturbation solutions And perform boundary repair. , in This is a solution for chaotic perturbations. For the best prey position, Let the step size be the chaotic perturbation step size. The upper bound of the search space, As the lower bound of the search space, For Tent, a chaotic variable; S244, Assessment Obtain fitness ; S245, When the fitness of the reverse solution Less than optimal fitness Update and and reset the stall counter. It is 0.
8. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, The specific steps of step S3 include: S31. Start a process from the current iteration number. up to the maximum number of iterations Iterative optimization loop; S32. In the iterative loop, calculate all individuals. sound wave intensity Used for stun and predation strategies with long tusks; S33, Traverse every individual in the population. According to the exploration rate And strategy to select random numbers Selectively execute group cooperative hunting strategies or tusk stun and predation strategies to generate new locations. ; S34, For all new locations Perform boundary repair and calculate its fitness; S35, Update Population for ; S36. Update the global best prey location based on the updated population. and stall counter ; S37, Determine if the stall counter is stopped Is it greater than the stagnation threshold? ,if Greater than If so, execute the reverse breakout strategy under the ice layer. Not greater than If so, skip the reverse breakout strategy under the ice layer and proceed to step S38; S38. Determine the current iteration number. Is it greater than the initial iteration number of the later stage? ,if Greater than Then execute the Chaotic Fang Strike strategy, if Not greater than If so, skip the Chaos Fang Strike strategy and continue the loop; S39, when achieve When the time comes, end the iterative optimization loop and output. .
9. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 8, characterized in that, Step S3, during the execution of the iterative optimization loop, also includes updating the hunting state: S3001, Update the exploration attenuation factor , , in To explore the decay factor, This represents the current iteration number. This represents the maximum number of iterations. S3002, Update Prey Energy , , in For the prey's energy, Energy decay rate, This represents the current iteration number; S3003, Dynamically Updated Exploration Rate , Calculate fitness improvement value , in For fitness improvement value, For optimal adaptation to the previous generation, This represents the current optimal fitness level. when Less than the preset improvement threshold At that time, set First exploration rate , when Not less than and Less than the preset energy threshold At that time, set For the second exploration rate , when Not less than and Not less than At that time, set First exploration rate .
10. The method for optimizing fishpond water temperature control based on swarm intelligence algorithm according to claim 1, characterized in that, The improved narwhal optimization algorithm in step S3 is used to evaluate the fitness function of the PID control parameters. for: , in To establish a stable time, the threshold value is a preset value. Weighting for overshoot penalty This represents the percentage of overshoot in the step response.
Citation Information
Patent Citations
Improved resistance heating furnace temperature control method based on whale optimization algorithm
CN118192268A
Insulin refrigeration temperature optimization control method
CN118502510A