Heat supply network temperature control method and system based on BFO optimization
By automatically searching for optimal PID control parameters in central heating systems using bacteria foraging optimization algorithms, the problem of poor performance of traditional PID control in complex heating systems is solved, faster response speed, smaller overshoot and shorter adjustment time are achieved, ensuring the stability and quality of the heating system.
Patent Information
- Application Number
- CN202510582277.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional PID control is not effective in complex central heating systems, especially when the system load fluctuates greatly and the external environmental conditions change frequently, the response speed is slow, the overshoot is large, and the adjustment time is long.
The PID control parameter setting method based on the bacterial foraging optimization algorithm is adopted, and the optimal PID control parameters are automatically searched through bacterial trend, clustering, replication and dispersion operations to achieve accurate control of the water supply temperature of the secondary network.
It significantly improves the system response speed, reduces the overshoot, shortens the adjustment time, and ensures the heating quality of the central heating system. Especially in the case of large load changes and environmental conditions fluctuations, it can effectively suppress temperature fluctuations and maintain the stability of the secondary network water supply temperature.
Smart Images

Figure CN120176172A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of heating system control, and particularly to a heating network temperature control method and system based on BFO optimization. Background Art
[0002] As an efficient and environmentally friendly heating method, the central heating system plays an important role in improving the living environment of residents and saving energy. In the central heating system, the heat exchange station is the key hub connecting the primary pipe network and the secondary pipe network, and the precise control of the secondary network water supply temperature has a decisive impact on the heating quality of the entire system. The traditional heating secondary network temperature control system usually adopts the PID control algorithm to control the secondary network water supply temperature by adjusting the opening of the primary network electric valve.
[0003] However, as a typical large-inertia and nonlinear control object, the temperature change process of the central heating system has obvious characteristics such as time delay, nonlinearity, and uncertainty. In such a complex control environment, it is difficult to accurately tune the parameters of the traditional PID controller, and it is often difficult to achieve the ideal control effect. Especially when the system load fluctuates greatly and the external environmental conditions change frequently, the conventional PID control method is prone to problems such as slow response speed, large overshoot, and long adjustment time, and it is difficult to meet the requirements of precise temperature control in modern central heating systems.
[0004] In recent years, with the wide application of intelligent optimization algorithms in the control field, the method of optimizing the parameters of the PID controller based on bionic intelligent algorithms has attracted extensive attention from researchers. Among them, the Bacterial Foraging Optimization (BFO) algorithm, as a random search intelligent algorithm that simulates the foraging behavior of Escherichia coli, has gradually been applied to the parameter optimization of various control systems due to its strong parallel search ability, fast convergence speed, and easy jumping out of local optimal solutions. However, the research on applying the BFO algorithm to the central heating secondary network temperature control system is still in the exploratory stage, and a systematic control method has not been formed. Summary of the Invention
[0005] In view of the problems existing in the prior art, the present invention is proposed.
[0006] Therefore, the problem to be solved by the present invention is how to solve the problem that the traditional PID control has poor control effect in a complex central heating system. Aiming at the characteristics of the secondary network water supply temperature control system, such as nonlinearity and time delay, a method for tuning PID control parameters based on the bacterial foraging optimization algorithm is proposed. Through the operations of bacterial chemotaxis, aggregation, reproduction and dispersion, the optimal PID control parameters are automatically searched to achieve precise control of the secondary network water supply temperature, thereby improving the system response speed, reducing the overshoot, shortening the adjustment time, and ensuring the heating quality of the central heating system.
[0007] To solve the above technical problems, the present invention provides the following technical solutions:
[0008] In the first aspect, an embodiment of the present invention provides a heating network temperature control method based on BFO optimization, which includes obtaining real-time temperature data and set temperature values of the central heating secondary network temperature system;
[0009] Constructing a mathematical model of the central heating secondary network temperature control system and determining the ITAE performance index as the evaluation function;
[0010] Optimizing the parameters of the PID controller using the bacterial foraging optimization algorithm to obtain the optimal PID control parameters;
[0011] Applying the optimized PID control parameters to the heating secondary network temperature control system, and realizing precise control of the secondary network water supply temperature by adjusting the opening of the electric valve of the primary network.
[0012] As a preferred solution of the heating network temperature control method based on BFO optimization according to the present invention, wherein: the chemotaxis operation includes:
[0013] Performing the flipping and swimming operations of bacteria; in each iteration, comparing the fitness values of the current position and the previous position; if the fitness value of the current position is better than that of the previous position, continue to swim in the current direction; if the fitness value of the current position is worse than that of the previous position, change the movement direction.
[0014] As a preferred solution of the heating network temperature control method based on BFO optimization according to the present invention, wherein: the aggregation operation includes:
[0015] Considering the interaction forces between bacteria, including gravitational force and repulsive force; the gravitational force ensures that the bacterial population moves towards the direction with rich food; the repulsive force ensures that the bacteria maintain an appropriate distance from each other; recalculating the fitness value of each bacteria according to the interaction between bacteria.
[0016] As a preferred solution of the heating network temperature control method based on BFO optimization according to the present invention, wherein: the reproduction operation includes:
[0017] Calculate the health value of each bacterium; sort all bacteria according to their health value; eliminate half of the bacteria with poor health values; replicate the bacteria with good health values to keep the total number of bacteria unchanged.
[0018] As a preferred solution of the heating network temperature control method based on BFO optimization of the present invention, the dissipation operation includes:
[0019] According to the preset dispersal probability, some bacteria are randomly selected; the selected bacteria are eliminated from the current position;
[0020] New bacteria are randomly generated in the search space to replace the eliminated bacteria; the dispersal operation is used to prevent the algorithm from falling into the local optimal solution.
[0021] As a preferred solution of the heating network temperature control method based on BFO optimization described in the present invention, the ITAE performance index is expressed as:
[0022] The product of the integral time and the absolute error is used to evaluate the dynamic performance of the control system;
[0023] By minimizing the ITAE index value, the response speed of the control system can be improved, the overshoot can be reduced, and the adjustment time can be shortened.
[0024] As a preferred solution of the heating network temperature control method based on BFO optimization described in the present invention, the mathematical model of the temperature control system of the central heating secondary network is obtained by the following steps:
[0025] Record the dynamic data of the secondary network water supply temperature; use the two-point method to determine the relevant parameters of the system model;
[0026] A transfer function model of the system is established for simulation optimization of the bacterial foraging optimization algorithm.
[0027] In a second aspect, an embodiment of the present invention provides a heating network temperature control system based on BFO optimization, which includes a data acquisition module for acquiring real-time temperature data and set temperature values of a temperature system of a central heating secondary network;
[0028] Model building module, used to establish the mathematical model of the temperature control system of the district heating secondary network and determine the ITAE performance index as the evaluation function;
[0029] Parameter optimization module, used to optimize the PID controller parameters using bacterial foraging optimization algorithm to obtain the optimal PID control parameters;
[0030] The control execution module is used to apply the optimized PID control parameters to the temperature control system of the heating secondary network, and to achieve precise control of the water supply temperature of the secondary network by adjusting the opening of the electric valve of the primary network.
[0031] As a preferred solution of the heating network temperature control system optimized based on BFO according to the present invention, wherein: a temperature monitoring unit is used to monitor the deviation between the secondary network supply water temperature and the set temperature in real time;
[0032] A BFO algorithm processing unit is used to perform the chemotaxis, swarming, reproduction and elimination operations of the bacterial foraging algorithm to optimize the parameters of the PID controller;
[0033] A parameter adjustment unit is used to adjust the kp, ki, and kd parameters of the PID controller according to the optimization result;
[0034] A valve control unit is used to adjust the opening degree of the primary network electric valve according to the output signal of the optimized PID controller to maintain the constancy of the secondary network supply water temperature.
[0035] The beneficial effects of the present invention are as follows: The heating network temperature control method and system optimized based on BFO proposed by the present invention have significant advantages in solving the problem of secondary network temperature control in centralized heating. By applying the bacterial foraging optimization algorithm to automatically search for the optimal parameter combination of the PID controller, it effectively overcomes the deficiencies of traditional PID control in the face of nonlinear and time-delay heating systems. Simulation tests show that compared with the conventional PID control method, the present invention not only significantly reduces the system overshoot from about 20% to about 5%, reduces the temperature fluctuation amplitude, but also shortens the system stabilization time from more than 300 seconds to about 150 seconds, improving the system response speed. This optimization effect is particularly reflected in the case of large system load changes and frequent fluctuations in external environmental conditions, and can effectively suppress temperature fluctuations and maintain the stability of the secondary network supply water temperature.
[0036] The BFO algorithm of the present invention has powerful global search ability and the ability to jump out of local optimal solutions through four bio-inspired operations of chemotaxis, swarming, reproduction and elimination, can find the best solution in a complex parameter space, and avoids the defects of traditional parameter tuning methods relying on experience and subjective judgment. In addition, this method is simple to implement, does not require structural transformation of the control system, and is easy to popularize and apply in existing heating systems. By improving the temperature control accuracy, the present invention helps to improve user comfort, and at the same time realizes the goals of energy conservation and emission reduction by reducing energy waste, and has significant economic and social benefits. Description of the Drawings
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0038] Figure 1Flow chart of the heating network temperature control method optimized based on BFO;
[0039] Figure 2 Computer equipment diagram of the heating network temperature control method optimized based on BFO;
[0040] Figure 3 Schematic diagram of the heat exchange station structure of the heating network temperature control method optimized based on BFO;
[0041] Figure 4 Schematic diagram of the principle of the controlled parameters after tuning of the heating network temperature control method optimized based on BFO;
[0042] Figure 5 Effect diagram of the comparison control of the conventional PID control of the heating network temperature control method optimized based on BFO. Specific implementation manners
[0043] To make the above objects, features and advantages of the present invention more obvious and understandable, the following detailed description of the specific implementation manners of the present invention will be given in conjunction with the drawings in the specification.
[0044] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0045] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure or characteristic that can be included in at least one implementation manner of the present invention. The "in one embodiment" that appears in different places in this specification does not all refer to the same embodiment, nor is it an embodiment that is separately or selectively mutually exclusive with other embodiments.
[0046] Embodiment 1
[0047] Refer to Figures 1 to 2 , the first embodiment of the present invention, this embodiment provides a heating network temperature control method optimized based on BFO, including,
[0048] S100: Obtain the real-time temperature data and the set temperature value of the secondary network temperature system of the central heating;
[0049] S200: Construct a mathematical model of the secondary network temperature control system of the central heating and determine the ITAE performance index as the evaluation function;
[0050] S300: Optimize the parameters of the PID controller by using the bacterial foraging optimization algorithm to obtain the optimal PID control parameters;
[0051] S400: Apply the optimized PID control parameters to the temperature control system of the secondary heating network. By adjusting the opening degree of the electric valve of the primary network, precise control of the secondary network water supply temperature is achieved.
[0052] As an important part of urban infrastructure, the centralized heating system plays a crucial role in the lives of residents in cold regions. However, the temperature control of the secondary network in traditional centralized heating systems faces multiple challenges: Firstly, the heating system itself has significant nonlinear characteristics and time delays, making it difficult for traditional PID controllers to balance response speed and system stability during parameter tuning; Secondly, with the changes in the external environmental temperature and the fluctuations in users' heating demands, the system load changes frequently, and conventional PID control often has problems such as large overshoot and long stabilization time; Finally, the dynamic characteristics of the thermal system change with time and operating conditions, and a PID controller with fixed parameters is difficult to adapt to this change. This technical solution solves the above problems through four key steps: Firstly, obtain real-time temperature data to ensure that control decisions are based on accurate information; Then establish an accurate system mathematical model and use the ITAE index as the evaluation criterion, which can better reflect the dynamic performance of the system; Next, use the BFO algorithm with global search ability to automatically optimize the PID parameters, effectively avoiding falling into local optimal solutions; Finally, apply the optimized parameters to the actual control system to achieve precise control of the secondary network temperature. This method makes full use of the parallel search ability and the characteristic of jumping out of local optima of the BFO algorithm, and provides an adaptive control strategy for the nonlinear and time-delay characteristics of the heating system.
[0053] The method described in claim 1 of the present invention constitutes a complete technical solution and can independently solve the key problems in the temperature control system of the centralized heating secondary network. This method first establishes an accurate data basis by obtaining real-time temperature data, and then constructs a system mathematical model and selects a suitable performance evaluation index to lay the foundation for subsequent optimization. The selection of the ITAE index is particularly crucial. It evaluates the system performance through the product of the integral time and the absolute error, and can effectively balance the requirements of system response speed and stability. The core of the method lies in using the bacterial foraging optimization algorithm to automatically search for the optimal PID control parameters. This bio-inspired optimization algorithm has strong global search ability and can find the best solution in the complex and changing parameter space, avoiding the human factors and limitations in traditional parameter tuning methods. Finally, apply the optimized parameters to the actual control system to achieve temperature control by precisely adjusting the valve opening. This complete closed-loop includes the whole process from data acquisition, model construction, parameter optimization to control execution, and solves the problem that traditional PID control has poor effects when facing nonlinear and time-delay control objects, significantly improving the system response speed, reducing the overshoot, shortening the adjustment time, and ensuring the heating quality of the centralized heating system.
[0054] Explanation of English characters or abbreviations mentioned in the document:
[0055] BFO (Bacterial Foraging Optimization): Bacterial Foraging Optimization algorithm, a bio-inspired optimization algorithm that simulates the foraging behavior of Escherichia coli, with characteristics such as parallel search, fast convergence speed, and easy to jump out of local optima.
[0056] PID (Proportional-Integral-Derivative): Proportional-Integral-Derivative controller, the most commonly used type of feedback controller in industrial control, consisting of a proportional term, an integral term, and a derivative term, where kp, ki, and kd represent the control parameters of these three terms respectively.
[0057] ITAE (Integral of Time multiplied by Absolute Error): Integral of Time multiplied by Absolute Error, one of the indicators for evaluating the performance of a control system, which takes into account the weighting of errors by time factors and is more inclined to eliminate steady-state errors compared to other indicators.
[0058] MATLAB (Matrix Laboratory): A high-level technical computing language and interactive environment for numerical computing, widely used in the design and simulation of control systems.
[0059] Example 2
[0060] Refer to Figures 1 - 5 , which is the second embodiment of the present invention.
[0061] The heat exchange station is a key link in the central heating system, used to connect the primary pipe network and the secondary pipe network. A schematic diagram of the typical heat exchange station structure is as Figure 3 shown, and the heat energy provided by the heat source passes through the primary pipe network - heat exchange station - secondary network - heat user.
[0062] To ensure the heating quality, the supply water temperature of the secondary heat network should be kept constant. During the control process, the supply water temperature of the secondary network is usually set. If a deviation is detected between the actual temperature and the set temperature, the controller will adjust the opening degree of the electric valve of the primary network, correspondingly increasing or decreasing the flow rate of the heat medium, and finally stabilizing the supply water temperature of the secondary network at the set value.
[0063] In the implementation manner of this application, obtaining the real-time temperature data and set temperature value of the central heating secondary network temperature system in step S100 includes the following steps A1 - A2:
[0064] A1: Obtain the real-time temperature data of the central heating secondary network, including the supply water temperature, return water temperature, and relevant reference point temperatures.
[0065] In the embodiments of the present application, the real-time temperature data of the secondary network of central heating is obtained through temperature sensors distributed at key nodes of heat exchange stations and pipe networks. Usually, PT100 platinum resistance temperature sensors are installed at the outlet of the heat exchange station to measure the supply water temperature of the secondary network; the same type of sensors are installed at the inlet of the return water pipeline of the secondary network to measure the return water temperature. These sensors transmit the data to the central control system in real time through fieldbus or wireless transmission methods.
[0066] In a preferred embodiment, the acquisition frequency of the temperature data is once every 10 seconds to ensure that the control system can respond to temperature changes in a timely manner. At the same time, the system is also equipped with a data filtering algorithm, which uses the moving average method to process the original temperature data, eliminates the influence of random noise and instantaneous fluctuations, and improves the reliability and stability of the data.
[0067] In another alternative embodiment, in addition to the supply and return water temperatures, auxiliary data such as the external environmental temperature and the user-end temperature can also be obtained to more comprehensively evaluate the system operation status and user needs. These data can be obtained through additionally installed temperature sensors or by docking with weather stations or smart home systems.
[0068] It should be noted that the accuracy and real-time nature of the temperature data have a decisive impact on the system control effect. Therefore, all temperature sensors should be calibrated regularly to ensure that the measurement error is within ±0.5°C. At the same time, the data transmission system should have sufficient redundancy and reliability to avoid data loss or delay. In practical applications, data anomaly detection algorithms can also be used to automatically identify and process abnormal data to ensure the quality of the input data of the control system.
[0069] A2: Obtain the set temperature value of the secondary network of central heating, which is determined according to the heating standard and user needs.
[0070] In the embodiments of the present application, the set value of the supply water temperature of the secondary network is usually determined comprehensively according to local heating standards, building characteristics, and external environmental temperature. In northern cities, during the winter heating period, the supply water temperature of the secondary network is generally set between 60°C and 80°C, and the specific value can be dynamically adjusted according to the outdoor temperature. The set temperature value can be manually set by professional personnel of the heating company according to experience, or can be automatically calculated through a temperature compensation curve.
[0071] In a preferred embodiment, the system automatically adjusts the set temperature using a temperature compensation curve. This curve describes the relationship between the outdoor temperature and the set value of the supply water temperature of the secondary network, and is usually represented by a piecewise linear or quadratic curve. When the outdoor temperature decreases, the set value of the supply water temperature is correspondingly increased; when the outdoor temperature increases, the set value of the supply water temperature is appropriately decreased to meet the building's heat preservation requirements while avoiding energy waste.
[0072] In another alternative embodiment, the set temperature can also consider the time factor to achieve segmented control. For example, the set temperature can be appropriately reduced at night and increased during the peak heating periods in the morning and evening to balance energy consumption and user comfort.
[0073] It should be noted that regardless of the method used to determine the set temperature, the safety and economy of the heating system should be fully considered. An excessively high set temperature will increase energy consumption and the burden on equipment; an excessively low set temperature may not meet the heating needs of users. Therefore, in practical applications, the set temperature strategy should be continuously optimized by combining historical operation data and user feedback to achieve the best balance between heating effect and energy efficiency.
[0074] In the embodiment of the present application, in step S200, a mathematical model of the temperature control system for the secondary network of central heating is constructed, and the ITAE performance index is determined as the evaluation function, including the following steps B1 - B2:
[0075] B1: The ITAE performance index is expressed as:
[0076] The product of the integral time and the absolute error, which is used to evaluate the dynamic performance of the control system;
[0077] By minimizing the ITAE index value, the response speed of the control system is improved, the overshoot is reduced, and the adjustment time is shortened.
[0078] It should be noted that although the ITAE index can effectively evaluate the system performance, in practical applications, the robustness of the system and the constraints of the control input should also be considered. Therefore, in the optimization process, in addition to minimizing the ITAE index, appropriate constraint conditions should also be set, such as the change rate limit of the control signal, the maximum overshoot limit, etc., to ensure the practicality and reliability of the optimization results.
[0079] In the embodiment of the present application, in step S300, the bacterial foraging optimization algorithm is used to optimize the parameters of the PID controller to obtain the optimal PID control parameters, including the following steps C1 - C2:
[0080] C1: The bacterial foraging optimization algorithm includes:
[0081] Initializing parameters such as the number of bacteria, the number of chemotactic steps, the number of reproduction steps, the number of elimination - dispersal steps, and the elimination - dispersal probability;
[0082] Defining the bacterial position vector as the three parameters kp, ki, and kd of the PID controller;
[0083] Performing the chemotactic, swarm - ing, reproduction, and elimination - dispersal operations of the bacterial foraging optimization algorithm, and continuously iterating to optimize the PID control parameters;
[0084] Output the optimal PID control parameters with the minimum ITAE index.
[0085] In an embodiment of the present application, the BFO algorithm is a bio-inspired optimization algorithm that simulates the foraging behavior of Escherichia coli. When applied to the optimization of PID controller parameters, algorithm parameter initialization is required first. Generally, the number of bacteria S = 30, the number of chemotaxis operations Nc = 40, the number of reproduction operations Nre = 4, the number of elimination-dispersal operations Ned = 2, and the elimination-dispersal probability Ped = 0.25 are set.
[0086] In the algorithm implementation, each bacterium represents a set of parameter combinations [kp, ki, kd] of the PID controller, that is, the position vector of the bacterium is defined as a point in three-dimensional space. The initial bacterium positions can be randomly generated in the search space or initialized according to empirical values. For example, the parameters obtained based on classical PID tuning formulas (such as the Ziegler-Nichols method) can be used as the starting point to accelerate the convergence process.
[0087] In a preferred embodiment, to improve the convergence speed and stability of the algorithm, the parameter search space can be constrained. For example, the range of kp is set to [0, 100], the range of ki is set to [0, 50], and the range of kd is set to [0, 10]. These ranges can be adjusted according to system characteristics and control requirements. At the same time, to avoid invalid searches, constraint relationships between parameters can also be set, such as requiring kp > ki > kd to meet the actual requirements of most control systems.
[0088] In another alternative embodiment, the initial bacterium population can adopt a non-uniform distribution, with more bacterium individuals distributed in the area that may contain the optimal solution to improve the search efficiency. For example, based on the prior knowledge of the system or historical operation data, the approximate range of the optimal parameters can be estimated, and then more dense bacterium individuals are distributed within this range.
[0089] It should be noted that as a heuristic algorithm, the effect of the BFO algorithm depends to a large extent on parameter settings. Different parameter settings may lead to different optimization results and convergence performances. Therefore, in practical applications, the algorithm parameters should be adjusted through experiments or experience according to the specific problem characteristics and computing resource limitations to obtain the best optimization effect. In addition, although the BFO algorithm has good global search ability, in practical problems, it may still fall into local optimal solutions. To improve the robustness of the algorithm, the algorithm can be run multiple times or combined with other optimization algorithms, such as combining BFO with the particle swarm algorithm or genetic algorithm to form a hybrid optimization strategy.
[0090] C2: The chemotaxis operation includes:
[0091] Perform the flipping and swimming operations of the bacterium;
[0092] In each iteration, compare the fitness values of the current position and the previous position;
[0093] If the fitness value of the current position is better than that of the previous position, continue to swim in the current direction;
[0094] If the fitness value of the current position is worse than that of the previous position, change the direction of movement.
[0095] E. coli mainly performs four operations, namely chemotaxis, aggregation, replication, and dispersion, during the process of searching for food.
[0096] (1) Chemotaxis; Chemotaxis includes two ways: tumbling and swimming. During foraging, E. coli compares and evaluates the current environment with the previous environment. If the latter is better, it indicates that it is closer to the food, and it continues to swim in this direction. Otherwise, it changes the movement trajectory by tumbling. E. coli evaluates each change of state and provides decision-making information for the next movement. The specific description in the algorithm uses the following formula:
[0097] θ i (j + 1, k, l) = θ i (j, k, l) + C(i)φ(i)
[0098]
[0099] θ i (i, k, l) represents the position information, C(i) is the step size, Δ(i) is a random vector, and φ(i) represents the forward direction. j, k, and l respectively represent the number of cycles of chemotaxis, reproduction, and dispersion.
[0100] In the embodiment of the present application, the chemotaxis operation is the most basic search mechanism in the BFO algorithm, which is used to simulate the behavior of bacteria searching for food in the environment. For each bacterial individual, first generate a random direction through the tumbling operation, and then perform multiple swims in this direction. During the swimming process, the bacteria continuously evaluate the fitness value (i.e., the ITAE index) of the current position. If the fitness value of the new position is better than that of the previous position, continue to swim in this direction; otherwise, perform a new tumbling operation to change the search direction.
[0101] In a preferred embodiment, the tumbling operation can adopt the random unit vector generation method, that is, randomly select a unit vector in three-dimensional space as the movement direction of the bacteria. The swimming step size C(i) can be set to a fixed value, such as C(i) = 0.1×(parameter upper limit - parameter lower limit), or it can be set to a dynamic value that decreases with the number of iterations to achieve large-scale exploration in the initial stage and fine search in the later stage.
[0102] In another alternative embodiment, the chemotaxis operation can also introduce an adaptive mechanism to dynamically adjust the swimming step size and direction according to the historical search effect of the bacteria. For example, when the bacteria continuously obtain improvements in a certain direction for multiple times, the swimming step size in this direction can be increased to accelerate the approximation to the optimal solution; when the bacteria still do not obtain improvements after multiple flips, the swimming step size can be decreased to increase the fineness of the search.
[0103] It should be noted that the effect of the chemotaxis operation depends to a large extent on the settings of the swimming step size and the number of swimming times. An overly large step size may cause the algorithm to miss the optimal solution; an overly small step size may result in an overly slow convergence speed. Too many swimming times will increase the computational burden; too few swimming times may reduce the search efficiency of the algorithm. Therefore, in practical applications, these parameters should be reasonably set according to the problem characteristics and computational resources to achieve a balance between search efficiency and optimization quality. In addition, to avoid the parameters exceeding the reasonable range during the search process, it should be checked whether the parameter values are within the set constraint range after each position update. If they exceed the range, they should be adjusted to the range boundary.
[0104] C3: The aggregation operation includes:
[0105] Consider the interaction forces between bacteria, including gravitational force and repulsive force;
[0106] The gravitational force ensures that the bacterial population moves towards the direction where food is abundant;
[0107] The repulsive force ensures that there is an appropriate distance between individual bacteria;
[0108] Recalculate the fitness value of each bacterium according to the interaction between bacteria.
[0109] (2) Aggregation; Similar to intelligent swarm algorithms such as particle swarm, ant colony, and fish school algorithms, the BFO algorithm also has a swarm effect. These interactions can be attributed to gravitational force and repulsive force. The gravitational force ensures that all individual bacteria as a whole move towards the direction where food is abundant, and the repulsive force can ensure that there is a certain distance between individual bacteria. The force on a bacterium can be expressed by the following mathematical expression:
[0110]
[0111] d attrac tan t is the gravitational depth, w attrac tan t is the gravitational width, h repellant is the repulsive height, w repellant is the repulsive width. Considering the interaction between bacteria, the formula for calculating the fitness value of bacterium i is as follows:
[0112] J(i, j + 1, k, l) = J(i, j, k, l) + J cc (θ i (j + 1, k, l), P(j + 1, k, l))
[0113] It should be noted that the aggregation operation is an optional component in the BFO algorithm and may not always be beneficial in some problems. Especially in high-dimensional search spaces or multi-modal function optimization, strong aggregation effects may cause the algorithm to converge prematurely to local optimal solutions. Therefore, in practical applications, the aggregation parameters should be carefully set according to the problem characteristics and optimization requirements. If necessary, the aggregation operation can even be considered disabled, and only rely on chemotaxis, reproduction, and elimination operations to achieve optimization. In addition, the computational complexity of the aggregation operation grows with the square of the number of bacteria. When dealing with large-scale optimization problems, the computational efficiency should be considered, and approximate calculation methods or parallel computing technologies may be needed to improve the efficiency.
[0114] C4: The reproduction operation includes:
[0115] Calculate the health value of each bacterium; sort all bacteria according to the health value; eliminate half of the bacteria with poor health values; reproduce the bacteria with good health values to keep the total number of bacteria unchanged.
[0116] (3) Reproduction; To ensure the continuation of the bacterial population, J i health : Conduct reproduction. The process by which the algorithm simulates reproduction is called replication. Define the health value of an individual bacterium
[0117]
[0118] Sort the bacterial health values. According to the results, eliminate half of the bacteria with poor health values and keep the bacteria with good health values for reproduction. The daughter bacteria will inherit the information of the mother body.
[0119] In another alternative embodiment, the replication strategy can be improved and it is not necessary to strictly eliminate half of the bacteria. For example, a ranking-based probability replication strategy can be adopted, that is, after sorting the bacteria according to the health value, determine the replication probability of each bacterium according to the ranking. The higher the ranking, the greater the replication probability of the bacterium. This strategy can retain some bacteria with average performance, increase the diversity of the population, and help the algorithm jump out of local optimal solutions.
[0120] It should be noted that the effect of the replication operation depends to a large extent on the sufficiency of the chemotaxis operation. Only after the performance of each bacterium is fully evaluated in the chemotaxis step can the replication operation effectively screen out truly excellent bacteria. Therefore, the number of chemotaxis cycles Nc should be set large enough to ensure that the health value can accurately reflect the quality of the bacteria. At the same time, the number of replication operations Nre should also be reasonably set. Too few operations may lead to insufficient optimization, while too many operations may lead to premature convergence to a local optimal solution. In practical applications, Nre is usually set to 3 - 5 times to achieve a balance between rapid convergence and avoidance of premature convergence.
[0121] C5: The elimination operation includes:
[0122] Randomly select a part of the bacteria according to the preset elimination probability; eliminate the selected bacteria from the current position;
[0123] Randomly generate new bacteria in the search space to replace the eliminated bacteria; the elimination operation can prevent the algorithm from falling into a local optimal solution.
[0124] In the embodiment of the present application, the elimination operation is an important mechanism in the BFO algorithm to prevent premature convergence, simulating the phenomenon of bacteria migrating due to environmental changes in the natural environment. By randomly eliminating a part of the bacteria and regenerating new bacteria in the search space, the elimination operation can effectively increase the diversity of the population, help the algorithm jump out of the local optimal solution, and explore a wider search space.
[0125] Specifically, the elimination operation judges each bacterium according to the preset elimination probability Ped (usually set to 0.25). For each bacterium, a random number in the range of [0, 1] is generated. If the random number is less than Ped, the bacterium is eliminated; otherwise, the bacterium remains unchanged. The eliminated bacteria will be replaced by newly generated bacteria, and the positions of the new bacteria are randomly generated in the search space, completely independent of the position information of the original bacteria.
[0126] In a preferred embodiment, in order to balance the global search and local search capabilities, the elimination probability can be decreased as the number of iterations increases. For example, the initial elimination probability can be set to 0.25, and then the probability is reduced by 10% after each elimination operation until the minimum value of 0.05 is reached. In this way, in the early stage of optimization, a higher elimination probability can promote global search; while in the later stage of optimization, a lower elimination probability helps the algorithm to perform fine search in the potential optimal region.
[0127] In another alternative embodiment, the dispersion operation can also be combined with an elitist retention strategy, that is, several of the best-performing bacteria in the population (such as the top 5%) are exempted from the dispersion operation to ensure that the optimal solution is not lost during the dispersion process. At the same time, to enhance the robustness of the algorithm, local search can also be performed after the dispersion operation, that is, a certain number of chemotactic operations are performed on the newly generated bacteria to help them quickly adapt to the new environment.
[0128] It should be noted that the dispersion operation is the key to balancing the global search and local search capabilities of the BFO algorithm. The setting of the dispersion probability needs to be adjusted according to the specific problem characteristics and optimization requirements. Too high a probability may cause the algorithm to be difficult to converge; too low a probability may cause the algorithm to easily fall into a local optimum. In practical applications, the number of dispersion operations Ned is usually set to 2 - 3 times, and the dispersion probability Ped is set between 0.1 - 0.3 to achieve a better balance. In addition, to improve the calculation efficiency, the dispersion operation is usually arranged to be executed after multiple replication operations, which can reduce the frequency of the dispersion operation and lower the calculation cost.
[0129] (4) Dispersion; bacteria are given a certain probability Ped, and the bacteria that meet the conditions will disappear. At the same time, a new individual appears in the search space, with different position information and search capabilities. Through this operation, the algorithm is prevented from falling into a local optimum, ensuring the global search ability of the BFO algorithm.
[0130] (1) Parameter initialization, calculation of fitness value, and finding the optimal bacterial individual.
[0131] (2) Chemotaxis: Perform swimming and tumbling, continuously compare the fitness values, and update the global optimal value until the set number of chemotactic operations is reached.
[0132] (3) Replication operation: Calculate and sort the health values Jihealth, eliminate half of the bacteria, and replicate the remaining bacteria. If the number of replication operations is not reached, return to the chemotaxis operation.
[0133] (4) Dispersion: Redistribute the bacteria in the optimization space with probability Ped. If the number of dispersion times is not reached, perform the next cycle.
[0134] (5) Output the optimization result.
[0135] In the embodiment of the present application, in step S400, the optimized PID control parameters are applied to the heating secondary network temperature control system, and the accurate control of the secondary network supply water temperature is achieved by adjusting the opening of the electric valve of the primary network, including the following steps D1 - D2:
[0136] Apply the BFO algorithm to the secondary network temperature control. Define the position vectors of bacteria in the BFO algorithm as \(k_p\), \(k_i\), and \(k_d\). Select the ITAE index as the evaluation of the fitness value, where:
[0137]
[0138] Use the BFO algorithm to obtain the optimal PID control parameters and apply the tuned parameters to the control link. The control principle is as Figure 4 shown.
[0139] D1: The mathematical model of the secondary network temperature control system for central heating is obtained through the following steps:
[0140] Record the dynamic data of the secondary network supply water temperature;
[0141] Use the two-point method to determine the relevant parameters of the system model;
[0142] Establish the transfer function model of the system for the simulation optimization of the bacterial foraging optimization algorithm.
[0143] The research object of this invention is the secondary network supply water temperature system in the central heating system. To achieve this control process, it is necessary to establish a corresponding mathematical model. By recording the dynamic data of the secondary network supply water temperature and using the two-point method to obtain the relevant parameters, the following transfer function is finally obtained:
[0144]
[0145] The number of bacteria \(S = 30\), \(N_c = 40\), \(N_{re} = 4\), \(N_{ed} = 2\), \(P_{ed} = 0.25\) in the BFO algorithm. After the parameters are set, MATLAB simulation is carried out under the input of a unit step signal and compared with the conventional PID control. The control effect is as Figure 5 shown.
[0146] Compared with the conventional PID control, the PID controller optimized by the BFO algorithm improves the control effect to a certain extent, increases the response speed of the system, significantly reduces the system overshoot, and shortens the adjustment time.
[0147] It should be noted that the accuracy of the mathematical model directly affects the optimization effect of the BFO algorithm and the final control effect. Therefore, during the model identification process, the system should be ensured to be in a normal operating state to avoid the influence of external interference and abnormal data. At the same time, the time scale of model identification should match the time scale of actual control, otherwise it may lead to inaccurate or inapplicable models. In addition, due to the nonlinear characteristics of the heating system, during the actual operation process, it may be necessary to regularly re-identify the system model or adopt an adaptive control strategy to adjust the control parameters in real time to adapt to the changes in system characteristics.
[0148] Compared with the conventional PID control, the PID controller optimized by the BFO algorithm has improved the control effect to a certain extent, increased the response speed of the system, significantly reduced the overshoot of the system, and shortened the adjustment time.
[0149] From Figure 5 the simulation results, it can be seen that compared with the PID controller using the traditional Ziegler-Nichols tuning method, the PID controller optimized by the BFO algorithm shows obvious advantages. Specifically, in terms of the response speed, the rising time of the PID controller optimized by BFO is shorter, and it can reach near the set temperature faster; secondly, in terms of the overshoot, the overshoot of the traditional PID controller is about 20%, while the overshoot of the PID controller optimized by BFO is reduced to about 5%, significantly reducing the temperature fluctuation; finally, in terms of the settling time, the PID controller optimized by BFO takes about 150 seconds to reach the stable state, while the traditional PID controller requires more than 300 seconds, and the adjustment time is shortened by more than 50%.
[0150] These improvements are of great significance to the central heating system. A smaller overshoot means smaller temperature fluctuations, avoiding energy waste and user discomfort; a shorter adjustment time means that the system can respond to load changes faster, improving user comfort. Especially in the case of drastic changes in the external environmental temperature or sudden changes in the heat demand of users, the PID controller optimized by BFO can maintain better control effects, maintain the stability of the secondary network supply water temperature, and improve the operation quality and energy utilization efficiency of the entire heating system.
[0151] In summary, the PID control method optimized based on the BFO algorithm proposed by the present invention shows obvious advantages in the temperature control of the secondary network of central heating, solves the problem of poor control effect of traditional PID control in complex heating systems, and has significant practical application value and promotion significance.
[0152] Embodiment 3
[0153] The above is a schematic solution of a heating network temperature control method optimized based on BFO. It should be noted that the technical solution of the heating network temperature control system optimized based on BFO belongs to the same concept as the technical solution of the above-mentioned heating network temperature control method optimized based on BFO. For the details not described in detail in the technical solution of the heating network temperature control system optimized based on BFO in this embodiment, reference can be made to the description of the technical solution of the heating network temperature control method optimized based on BFO above.
[0154] This embodiment also provides a heating network temperature control system optimized based on BFO, including:
[0155] A data acquisition module for obtaining real-time temperature data and set temperature values of the secondary network temperature system for district heating;
[0156] A model construction module for establishing a mathematical model of the secondary network temperature control system for district heating and determining the ITAE performance index as the evaluation function;
[0157] A parameter optimization module for optimizing the PID controller parameters using the bacterial foraging optimization algorithm to obtain the optimal PID control parameters;
[0158] A control execution module for applying the optimized PID control parameters to the secondary network temperature control system for heating, and achieving precise control of the secondary network supply water temperature by adjusting the opening of the electric valve of the primary network.
[0159] A temperature monitoring unit for real-time monitoring of the deviation between the secondary network supply water temperature and the set temperature;
[0160] A BFO algorithm processing unit for performing the chemotaxis, swarming, reproduction, and elimination operations of the bacterial foraging algorithm to optimize the PID controller parameters;
[0161] A parameter adjustment unit for adjusting the kp, ki, and kd parameters of the PID controller according to the optimization results;
[0162] A valve control unit for adjusting the opening of the primary network electric valve according to the output signal of the optimized PID controller to maintain a constant secondary network supply water temperature.
[0163] This embodiment also provides an electronic device applicable to the situation of heating network temperature control based on BFO optimization, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method for realizing heating network temperature control based on BFO optimization as proposed in the above embodiment.
[0164] This embodiment also provides a storage medium on which a computer program is stored, and when the program is executed by a processor, it implements the method for realizing heating network temperature control based on BFO optimization as proposed in the above embodiment.
[0165] The storage medium proposed in this embodiment and the method for realizing heating network temperature control based on BFO optimization proposed in the above embodiment belong to the same inventive concept. The technical details not described in detail in this embodiment can be referred to in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0166] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software and the necessary general-purpose hardware, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disc of a computer, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0167] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A heating network temperature control method based on BFO optimization, characterized in that: Including obtaining real-time temperature data and set temperature values of the central heating secondary network temperature system; Construct a mathematical model of the temperature control system of the district heating secondary network and determine the ITAE performance index as the evaluation function; The bacterial foraging optimization algorithm is used to optimize the PID controller parameters and obtain the optimal PID control parameters; The optimized PID control parameters are applied to the temperature control system of the heating secondary network. The precise control of the water supply temperature of the secondary network is achieved by adjusting the opening of the electric valve of the primary network.
2. The heating network temperature control method based on BFO optimization according to claim 1, characterized in that: The bacterial foraging optimization algorithm includes: Initialize parameters such as bacterial number, tropism times, replication times, dispersal times and dispersal probability; The bacterial position vector is defined as the three parameters kp, ki, and kd of the PID controller; Execute the bacterial foraging optimization algorithm's tendency, clustering, replication and dispersal operations, and continuously iterate and optimize PID control parameters; Output the optimal PID control parameters with the minimum ITAE index.
3. The heating network temperature control method based on BFO optimization according to claim 2, characterized in that: The trending operation includes: Perform bacterial flipping and swimming operations; in each iteration, compare the fitness values of the current position and the previous position; if the fitness value of the current position is better than the previous position, continue to swim in the current direction; if the fitness value of the current position is worse than the previous position, change the direction of movement.
4. The heating network temperature control method based on BFO optimization according to claim 3, characterized in that: The clustering operation includes: The interaction forces between bacteria are considered, including gravity and repulsion; gravity ensures that the bacterial population moves towards the direction of abundant food; repulsion ensures that individual bacteria maintain an appropriate distance between each other; the fitness value of each bacterium is recalculated based on the interactions between bacteria.
5. The method for controlling the temperature of a heating network based on BFO optimization according to claim 4, characterized in that: The copy operation includes: Calculate the health value of each bacterium; sort all bacteria according to their health value; eliminate half of the bacteria with poor health values; replicate the bacteria with good health values to keep the total number of bacteria unchanged.
6. The heating network temperature control method based on BFO optimization according to claim 5, characterized in that: The dispersal operation includes: According to the preset dispersal probability, some bacteria are randomly selected; the selected bacteria are eliminated from the current position; New bacteria are randomly generated in the search space to replace the eliminated bacteria; the dispersal operation is used to prevent the algorithm from falling into the local optimal solution.
7. The heating network temperature control method based on BFO optimization according to claim 6, characterized in that: The ITAE performance index is expressed as the product of the integral time and the absolute error, and is used to evaluate the dynamic performance of the control system. By minimizing the ITAE index value, the response speed of the control system is improved, the overshoot is reduced, and the adjustment time is shortened.
8. The heating network temperature control method based on BFO optimization according to claim 7, characterized in that: The mathematical model of the temperature control system of the central heating secondary network is obtained by the following steps: Record the dynamic data of the secondary network water supply temperature; use the two-point method to determine the relevant parameters of the system model; A transfer function model of the system is established for simulation optimization of the bacterial foraging optimization algorithm.
9. A heating network temperature control system based on BFO optimization, based on the heating network temperature control method based on BFO optimization according to any one of claims 1 to 8, characterized in that: Data acquisition module, used to obtain real-time temperature data and set temperature values of the central heating secondary network temperature system; Model building module, used to establish the mathematical model of the temperature control system of the district heating secondary network and determine the ITAE performance index as the evaluation function; Parameter optimization module, used to optimize the PID controller parameters using bacterial foraging optimization algorithm to obtain the optimal PID control parameters; The control execution module is used to apply the optimized PID control parameters to the temperature control system of the heating secondary network, and to achieve precise control of the water supply temperature of the secondary network by adjusting the opening of the electric valve of the primary network.
10. A heating network temperature control system based on BFO optimization, based on the heating network temperature control method based on BFO optimization according to any one of claims 1 to 8, characterized in that: Temperature monitoring unit, used to monitor the deviation between the secondary network water supply temperature and the set temperature in real time; BFO algorithm processing unit, used to perform the bacterial foraging algorithm's tendency, clustering, replication and dispersal operations, and optimize PID controller parameters; A parameter adjustment unit, used to adjust the kp, ki, and kd parameters of the PID controller according to the optimization results; The valve control unit is used to adjust the opening of the primary network electric valve according to the optimized PID controller output signal to maintain a constant water supply temperature in the secondary network.