Optimization control method and system for continuous stirred reactor
Through the optimization method of the PID controller and genetic algorithm based on neural network, the problem of control of continuous stirred reactors in a variable environment is solved, and rapid and accurate reaction process adjustment is achieved, and production efficiency and product quality are improved.
Patent Information
- Application Number
- CN202411357222.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-09-27
AI Technical Summary
The existing PID control methods are difficult to adapt to the variable working environment of the continuous stirring reactor, resulting in slow or excessive response during disturbances, and the reaction process cannot be quickly or accurately adjusted back to a stable state, affecting production efficiency and product quality.
A PID controller based on neural network is adopted and optimized through genetic algorithms to adjust proportion, integral and differential gain in real time, and combine dynamic models and steady-state equation systems to achieve precise control of the continuous stirred reactor.
It improves the ability to adapt to a variable working environment, conducts timely and accurately responses during disturbances, and quickly and accurately adjusts the reaction process back to a stable state, improving production efficiency and product quality.
Smart Images

Figure CN119247741B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of control systems, and in particular to an optimization control method and system for a continuous stirring reactor. Background Art
[0002] Continuous Stirred Tank Reactor (CSTR) is a type of reactor commonly used in chemical engineering. It is mainly used in liquid phase reaction processes. It can provide uniform reaction conditions and achieve continuous chemical production.
[0003] Currently, the control of continuous stirred reactors is often carried out by PID control, which responds to changes inside the reactor by adjusting control parameters. However, in the current PID control process, the proportional gain coefficient, integral gain coefficient and differential gain coefficient are often determined by skilled technicians and are often fixed. However, the working environment of the continuous stirred reactor during the reaction process is changeable, which makes it difficult for the current PID control to adapt to the changeable working environment. When disturbances occur, the response is slow or excessive, and the process cannot be quickly or accurately adjusted back to a stable state, affecting production efficiency and product quality. Summary of the invention
[0004] In order to solve the technical problem that in the current PID control process of the prior art, the proportional gain coefficient, the integral gain coefficient and the differential gain coefficient are often determined by skilled technicians and are often fixed, while the working environment of the continuous stirred reactor during the reaction process is changeable, resulting in the current PID control being difficult to adapt to the changeable working environment, responding slowly or excessively when disturbances occur, and being unable to quickly or accurately adjust the process back to a stable state, thus affecting production efficiency and product quality, the present invention provides an optimization control method and system for a continuous stirred reactor.
[0005] The technical solution provided by the embodiment of the present invention is as follows:
[0006] A first aspect of an embodiment of the present invention provides an optimization control method for a continuous stirred tank reactor, comprising:
[0007] S1: Construct a PID controller based on a neural network;
[0008] S2: Optimize the neural network-based PID controller through genetic algorithm;
[0009] S3: Construct a dynamic model of a continuous stirred tank reactor;
[0010] S4: Based on the dynamic model of the continuous stirred tank reactor, a steady-state equation system is constructed;
[0011] S5: solving the steady-state equations to calculate the ideal jacket transfer heat in the steady state;
[0012] S6: Obtain the actual jacket transferred heat;
[0013] S7: According to the difference between the ideal jacket heat transfer and the actual jacket heat transfer, the continuous stirred reactor is controlled by an optimized neural network-based PID controller.
[0014] A second aspect of an embodiment of the present invention provides an optimization control system for a continuous stirred tank reactor, comprising:
[0015] processor;
[0016] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the optimization control method for the continuous stirred reactor as described in the first aspect is implemented.
[0017] The third aspect
[0018] A third aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the optimization control method for a continuous stirred reactor as described in the first aspect.
[0019] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0020] In the present invention, a PID controller based on a neural network is used to calculate the proportional gain coefficient, integral gain coefficient and differential gain coefficient in real time during the operation of the continuous stirred reactor. Then, based on the PID control principle, the control signal during the operation of the continuous stirred reactor is determined to improve the adaptability to the changing working environment of the continuous stirred reactor, and to respond promptly and accurately when disturbances occur, so as to quickly and accurately adjust the reaction process back to a stable state, thereby improving production efficiency and product quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 A schematic flow chart of an optimization control method for a continuous stirred reactor provided by an embodiment of the present invention;
[0023] Figure 2A schematic structural diagram of an optimization control system for a continuous stirred reactor provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0025] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0026] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0027] Reference Manual Attached Figure 1 , showing a schematic flow chart of an optimization control method for a continuous stirred reactor provided in an embodiment of the present invention.
[0028] The embodiment of the present invention provides an optimization control method for a continuous stirred reactor, which can be implemented by an optimization control device for a continuous stirred reactor, and the optimization control device for a continuous stirred reactor can be a terminal or a server. The processing flow of the optimization control method for a continuous stirred reactor can include the following steps:
[0029] S1: Construct a neural network based PID controller.
[0030] Among them, Neural Network is a computational model that simulates the biological nervous system and is widely used in pattern recognition, data classification, prediction and other fields.
[0031] Among them, the PID controller (Proportional-Integral-Derivative Controller) is a classic feedback controller used to adjust the output of the system to reach the set value.
[0032] It should be noted that the neural network-based PID controller is specifically used to: determine the real-time proportional gain coefficient, integral gain coefficient and differential gain coefficient during the operation of the continuous stirred reactor through the neural network. According to the real-time proportional gain coefficient, integral gain coefficient and differential gain coefficient, based on the PID control principle, determine the control signal during the operation of the continuous stirred reactor.
[0033] In the present invention, the neural network is able to learn and adapt to the dynamic behavior of the reactor under different operating conditions. This means that the PID controller can adjust its proportional, integral and differential gains in real time to adapt to changes in key parameters such as raw material composition, reaction rate, temperature or pressure. This adaptive ability makes the control process more stable and efficient, especially when faced with complex or variable process conditions. By precisely adjusting the PID parameters, the neural network controller can reach the set point more accurately and reduce deviations and fluctuations. This is crucial to ensure product quality and consistency, especially during chemical reactions, where small control inaccuracies may cause large fluctuations in product quality. Neural network-based control systems can quickly identify and respond to external disturbances, such as fluctuations in raw material supply, changes in ambient temperature, etc. The neural network can learn from historical data how to adjust the PID parameters under these disturbances to quickly restore system stability.
[0034] In a possible implementation, the neural network includes an input layer, a hidden layer, and an output layer.
[0035] The input layer is used to input the difference signal between the ideal jacket heat transfer and the actual jacket heat transfer.
[0036] It should be noted that in chemical and biochemical processes, continuously stirred reactors (CSTRs) are often used to achieve control and optimization of various reactions. In order to accurately control the temperature in the reactor, a jacket is usually set on the outer wall of the reactor to heat or cool the reactants by transferring heat through the jacket. Heat transfer by the jacket is one of the key ways to achieve temperature control of the reactor. The principle of heat transfer by the jacket is to achieve heating or cooling of the materials in the reactor through heat exchange between the fluid (heating or cooling medium) in the jacket and the reactor wall.
[0037] The hidden layer is used to determine the real-time proportional gain coefficient, integral gain coefficient and differential gain coefficient during the operation of the continuous stirred tank reactor.
[0038] The hidden layer includes a first neuron, a second neuron and a third neuron, which correspond to a proportional gain coefficient, an integral gain coefficient and a differential gain coefficient respectively.
[0039] The output layer is used to output control signals.
[0040] Optionally, the output of the first god general element is specifically:
[0041] a1(t)=e(t)K p (t)
[0042] Where a1(t) represents the output of the first neuron at time t, e(t) represents the difference signal between the ideal jacket heat transfer and the actual jacket heat transfer at time t, and K p(t) represents the proportional gain coefficient at time t.
[0043] Optionally, the output of the second god general element is specifically:
[0044] a2(t)=e(t)K i (t)+a2(t-1)
[0045] Among them, a2(t) represents the output of the second neuron at time t, K i (t) represents the integral gain coefficient at time t, and a2(t-1) represents the output of the second neuron at time t-1.
[0046] Optionally, the output of the second god general element is specifically:
[0047] a3(t)=e(t)K d (t)+K d (t-1)e(t-1)
[0048] Among them, a3(t) represents the output of the third neuron at time t, K d (t) represents the differential gain coefficient at time t, K d (t-1) represents the differential gain coefficient at time t-1, and e(t-1) represents the difference signal between the ideal jacket heat transfer and the actual jacket heat transfer at time t-1.
[0049] Optionally, the output of the output layer is specifically:
[0050] u(t)=w1a1(t)+w2a2(t)+w3a3(t)
[0051] Among them, u(t) represents the control signal output at time t, w1 represents the weight coefficient between the first divine general element and the output layer, w2 represents the weight coefficient between the second divine general element and the output layer, and w3 represents the weight coefficient between the third divine general element and the output layer.
[0052] It should be noted that the neural network automatically learns and adjusts the control parameters by analyzing the relationship between the input (ideal and actual heat difference signal) and the output (control signal) to adapt to the dynamic changes of the system under different operating conditions. This adaptive capability is particularly suitable for applications where parameters change frequently or process conditions are complex, such as chemical reaction processes, where raw materials or environmental conditions may continue to change.
[0053] In the present invention, by embedding the neural network into the PID control logic, the proportional (P), integral (I), and differential (D) gains can be adjusted in real time to more accurately respond to the heat transfer requirements of the process. The neural network can continuously learn and optimize the PID parameters based on real-time data, thereby achieving more precise control, reducing deviations, and optimizing the response time and stability of the system.
[0054] S2: Optimize the neural network-based PID controller through genetic algorithm.
[0055] Among them, Genetic Algorithm (GA) is an optimization algorithm based on natural selection and genetics principles, which is often used to solve complex optimization and search problems. Genetic algorithm simulates the natural evolution process, gradually improves the quality of candidate solutions through operations such as selection, crossover and mutation, and finally finds the optimal solution to the problem.
[0056] In a possible implementation, the fitness function of the genetic algorithm is specifically:
[0057]
[0058] Among them, σ() represents the fitness function, θ represents the network parameters of the PID controller based on the neural network, e(t) represents the difference signal between the ideal jacket heat transfer at time t and the actual jacket heat transfer, P(t) represents the power of the reactor at time t, dt represents the differentiation of t, and λ represents the weight coefficient of the difference signal.
[0059] Among them, those skilled in the art can set the size of the weight coefficient λ of the difference signal according to actual conditions, and the present invention does not limit this.
[0060] It should be noted that considering the difference between the ideal jacket heat transfer and the actual jacket heat transfer in the fitness function can improve the accuracy of temperature control. Considering power can optimize energy consumption, reduce operating costs, extend equipment life, and reduce environmental impact.
[0061] In the present invention, multi-objective optimization of errors and power consumption is performed, which helps to reduce energy consumption while meeting control requirements and improve the economy and sustainability of the system.
[0062] Specifically, a population Q1 is initialized, which contains multiple individuals, each of which represents a feasible network parameter.
[0063] An elite selection strategy is adopted for the initial population Q1, and individuals are arranged from large to small according to the objective function value. The 1 / 4 individuals with the worst objective function value are replaced by new individuals to form a new population Q2.
[0064] It should be noted that the elite selection strategy ensures the retention of excellent individuals, which have high fitness values and represent good solutions in the problem space. By retaining these excellent individuals, it helps the genetic algorithm converge to a better solution faster.
[0065] Perform a crossover operation on population Q2, randomly select two sets of solution vectors from population Q2 as parents, generate a random number, and compare the random number with the crossover probability p e Compare the size, if the random number is less than the crossover probability p e , then the parent is cross-operated to generate new individuals to form population Q3. The generation of new individuals y1 and y2 is as follows:
[0066] y1=rand×x1+(1-rand)×x2
[0067] y2=rand×x2+(1-rand)×x1
[0068] Among them, x1 and x2 represent the parent, and rand represents a random number between 0 and 1.
[0069] It should be noted that the crossover operation helps to explore possible solutions more extensively in the search space, thereby improving the global search capability of the algorithm and helping to find better solutions. By introducing the crossover operation, the population can be prevented from falling into the local optimal solution too early, promoting the evolution and diversity maintenance of the population, and increasing the probability of global search, which helps to find better solutions.
[0070] Among them, the crossover probability P e Specifically:
[0071]
[0072] Among them, P e represents the crossover probability, P e,max represents the maximum crossover probability, P e,min represents the minimum crossover probability, δ represents the fitness value of the current individual, δ avg represents the average fitness value of the population, δ max Represents the maximum fitness value among individuals.
[0073] It should be noted that the crossover probability is adjusted as the individual fitness value changes. When the individual fitness value is high, the crossover probability will increase, thereby increasing the gene exchange opportunities between excellent individuals; when the individual fitness value is low, the crossover probability will decrease, reducing the gene exchange opportunities between low-quality individuals. This adaptive adjustment can better balance the relationship between exploration and utilization, which is conducive to improving the search efficiency and convergence speed of the algorithm.
[0074] Perform a mutation operation on population Q3, randomly select a parent x3 from population Q3, generate a random number, and compare the random number with the mutation probability P m Compare the size. If the random number is less than the mutation probability P, m, then the parent x3 is mutated to generate a new individual y3 to replace the original individual to form a population Q4. The generation method of the new individual y3 is as follows:
[0075] y3=x max +rand(x3-x4)+(1-rand)(x5-x6)
[0076] Among them, x max represents the individual with the highest fitness value, rand represents a random number between 0 and 1, and x3, x4, x5, and x6 represent different individuals.
[0077] In the present invention, a differential vector is introduced to replace the random perturbation in the traditional genetic algorithm. The differential vector is the difference between several individuals in the current population. This mutation method is more targeted, can better retain useful information, help accelerate the convergence speed, and can more effectively guide the algorithm to search in the direction of the global optimal solution. Therefore, compared with the traditional random mutation operation, it is less likely to fall into the local optimal solution.
[0078] Among them, the mutation probability P m Specifically:
[0079]
[0080] Among them, P m represents the mutation probability, P m,max represents the maximum mutation probability, P m,min represents the minimum mutation probability, δ represents the fitness value of the current individual, δ avg represents the average fitness value of the population, δ max Represents the maximum fitness value among individuals.
[0081] It should be noted that the mutation probability is adjusted with the change of individual fitness value. When the individual fitness value is high, the mutation probability will increase, thereby increasing the gene exchange opportunities between excellent individuals; when the individual fitness value is low, the mutation probability will decrease, reducing the gene exchange opportunities between low-quality individuals. This adaptive adjustment can better balance the relationship between exploration and utilization, which is conducive to improving the search efficiency and convergence speed of the algorithm.
[0082] Determine whether the number of iterations has reached the maximum number of iterations. If so, determine the individual with the highest fitness value as the optimal network parameter. Otherwise, return to the step of selecting individuals in the population and continue iterating.
[0083] S3: Construct a dynamic model of a continuous stirred tank reactor.
[0084] In a possible implementation, the dynamic model of the continuous stirred tank reactor is specifically:
[0085]
[0086] Among them, C A represents the concentration of reactants, dC A Indicates C A Differentiate, τ represents the residence time of the reactants in the reactor, C A0 represents the initial concentration of the reactant, k A represents the forward reaction rate constant, exp() represents the exponential function with the natural constant e as the base, E A represents the activation energy of the forward reaction, R represents the gas constant, T represents the reactor temperature, k B is the reverse reaction rate constant, E B represents the activation energy of the reverse reaction, C B represents the product concentration, dC B Indicates C B Differentiation, dT represents differentiation with respect to T, ΔH represents the heat of reaction, T0 represents the initial temperature, Q represents the heat transferred by the jacket, ρ represents the density of the reaction mixture, C P represents the specific heat capacity of the mixture, and V represents the volume of the reactor.
[0087] In the present invention, the concentration of reactants (C A , C B ) and temperature (T) over time can predict the dynamic behavior of the reaction process, provide reliable prediction and guidance for the production process, and provide a basis for the design and optimization of control strategies.
[0088] S4: Based on the dynamic model of the continuous stirred tank reactor, a set of steady-state equations is constructed.
[0089] Optionally, the steady-state equation group specifically includes: a steady-state equation regarding reactant concentration and a steady-state equation regarding reactor temperature.
[0090] In a possible implementation, the steady-state equations are specifically:
[0091]
[0092] S5: Solve the steady-state equations and calculate the ideal jacket transfer heat in the steady state.
[0093] In the present invention, solving the steady-state equations can calculate the ideal jacket transfer heat required to maintain the chemical reaction, which helps to accurately control the heating or cooling system to avoid overheating or overcooling, thereby optimizing energy utilization efficiency and reducing operating costs.
[0094] S6: Obtain the actual jacket transferred heat.
[0095] S7: Based on the difference between the ideal jacket heat transfer and the actual jacket heat transfer, the continuous stirred tank reactor is controlled by an optimized neural network-based PID controller.
[0096] In the present invention, real-time monitoring and control of the heat transferred by the jacket helps maintain the stability of the chemical reaction and prevent abnormal reaction rate or side reactions caused by temperature fluctuations. A stable operating environment can reduce unexpected downtime and maintenance requirements and improve production efficiency.
[0097] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0098] In the present invention, a PID controller based on a neural network is used to calculate the proportional gain coefficient, integral gain coefficient and differential gain coefficient in real time during the operation of the continuous stirred reactor. Then, based on the PID control principle, the control signal during the operation of the continuous stirred reactor is determined to improve the adaptability to the changing working environment of the continuous stirred reactor, and to respond promptly and accurately when disturbances occur, so as to quickly and accurately adjust the reaction process back to a stable state, thereby improving production efficiency and product quality.
[0099] Reference Manual Attached Figure 2 , showing a schematic structural diagram of an optimization control system for a continuous stirred reactor provided by the present invention.
[0100] The present invention further provides an optimization control system 20 for a continuous stirred reactor, which is applied to the optimization control method for the above-mentioned continuous stirred reactor, comprising:
[0101] Processor 201.
[0102] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, the optimization control method of the continuous stirred reactor in the method embodiment is implemented.
[0103] The optimization control system 20 for a continuous stirred reactor provided by the present invention can execute the above-mentioned optimization control method for a continuous stirred reactor and achieve the same or similar technical effects. To avoid repetition, the present invention will not elaborate on them.
[0104] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0105] In the present invention, a PID controller based on a neural network is used to calculate the proportional gain coefficient, integral gain coefficient and differential gain coefficient in real time during the operation of the continuous stirred reactor. Then, based on the PID control principle, the control signal during the operation of the continuous stirred reactor is determined to improve the adaptability to the changing working environment of the continuous stirred reactor, and to respond promptly and accurately when disturbances occur, so as to quickly and accurately adjust the reaction process back to a stable state, thereby improving production efficiency and product quality.
Claims
1. A method for optimizing the control of a continuous stirred tank reactor, characterized in that: include: S1: Construct a PID controller based on a neural network; S2: Optimize the neural network-based PID controller through genetic algorithm; S3: Construct a dynamic model of a continuous stirred tank reactor; S4: Based on the dynamic model of the continuous stirred tank reactor, a steady-state equation system is constructed; S5: solving the steady-state equations to calculate the ideal jacket transfer heat in the steady state; S6: Obtain the actual jacket transferred heat; S7: According to the difference between the ideal jacket heat transfer and the actual jacket heat transfer, the continuous stirred reactor is controlled by an optimized neural network-based PID controller.
2. The optimization control method for a continuous stirred tank reactor according to claim 1, characterized in that: The neural network-based PID controller is specifically used for: The real-time proportional gain coefficient, integral gain coefficient and differential gain coefficient during the operation of the continuous stirred reactor are determined through the neural network.
3. The optimization control method of the continuous stirred tank reactor according to claim 2, characterized in that: According to the real-time proportional gain coefficient, integral gain coefficient and differential gain coefficient, based on the PID control principle, the control signal during the operation of the continuous stirred reactor is determined.
4. The optimization control method for a continuous stirred tank reactor according to claim 3, characterized in that: The neural network includes an input layer, a hidden layer and an output layer; The input layer is used to input a difference signal between an ideal jacket heat transfer and an actual jacket heat transfer.
5. The optimization control method for a continuous stirred tank reactor according to claim 4, characterized in that: The hidden layer is used to determine the real-time proportional gain coefficient, integral gain coefficient and differential gain coefficient during the operation of the continuous stirred tank reactor.
6. The optimization control method for a continuous stirred tank reactor according to claim 4, characterized in that: The hidden layer includes a first neuron, a second neuron and a third neuron, which correspond to a proportional gain coefficient, an integral gain coefficient and a differential gain coefficient respectively; The output layer is used to output a control signal.
7. An optimization control system for a continuous stirred reactor, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the optimization control method for the continuous stirred reactor according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Reaction kettle temperature control method and system thereof
CN111408326A
Full-process dynamic optimization control method and device for chemical production device, and electronic equipment
CN117270483A