Parameter optimization method of continuous stirring reaction kettle state estimator
Technical Field
The invention relates to the field of industrial process control, in particular to a parameter optimization method of a continuous stirring reaction kettle state estimator.
Background
In most engineering practices, such as control systems in the fields of radar ranging, missile tracking, chemical production and the like, the system needs to be optimized through state feedback to meet the expected performance index requirements. The method has important value for the research on the detection of the physical quantity and the estimation of the state parameters in the process of the continuous stirring reaction kettle in the field of chemical production. However, not all the actual values of the state variables can be measured directly, and some state variables cannot even be detected. State estimation has been widely used in large-scale chemical production systems as a scientific method for estimating the internal state of a dynamic system from available metrology data. In practical systems, constraints are present in large quantities, such as the concentration of the substances in the continuous stirred tank reactor and the reaction temperature of the vessel always being greater than zero. Aiming at the problem, the proposed rolling time domain State Estimator (MHSE) can convert the State estimation problem into the optimization problem of fixed time domain length by utilizing the known information about system interference and State in a constraint form, and the rationality and accuracy of physical parameter estimation in the continuous stirring reaction kettle are fully improved. The estimation effect of the estimator applied to the reaction kettle is directly influenced by the size of the fixed time domain length, and therefore, parameter optimization in the estimator becomes an important aspect which must be considered when the estimator is designed.
The time domain length is an important parameter of MHSE. If the parameter value is too large, the solution efficiency of the estimator will decrease, but the estimation effect will increase as the parameter value increases. Therefore, when selecting the time domain length, it is necessary to emphasize the speed and the effect. At present, in MHSE application, the time domain length is usually selected as a positive integer value twice of the system order, and in the chemical production process of an actual continuous stirred tank reactor, engineering personnel can comprehensively consider production benefits, energy consumption and other factors to adjust according to engineering experience. The method has the disadvantages of long time consumption, serious resource consumption rate and incapability of objectively meeting the production requirement.
Disclosure of Invention
In view of the above situation, the technical problem to be solved by the present invention is to overcome the deficiencies of the prior art, and provide a parameter optimization method for a continuous stirred tank reactor state estimator with better estimation effect, wherein a genetic algorithm based on a simulated annealing mechanism is used to search the optimal parameters of the state estimator, and the parameter optimization method is further applied to the detailed description of the continuous stirred tank reactor system.
The parameter optimization method of the continuous stirring reaction kettle state estimator takes each group of feasible fixed time domain length values as an individual, and searches out the optimal state estimator parameter by utilizing a genetic group optimization algorithm based on a simulated annealing mechanism. The parameter optimization method of the continuous stirring reaction kettle state estimator specifically comprises the following steps:
step 1, establishing an ideal dynamic characteristic equation of the continuous stirring reaction kettle, wherein the equation is in the form as follows:
in the formula, cAAnd cBRespectively representing the concentration of the components A (cyclopentadiene) and B (cyclopentene) in mol/L; theta and thetaKRespectively representing the reaction temperature and the cooling temperature, and the unit is; andrespectively represent cA、cBTheta and thetaKA derivative of (a); v represents the feed volume in m3;Represents the derivative of V; vRDenotes the reaction volume in m3;Represents the heat dissipation in the cooling jacket in KJ · h-1;cA0Represents the feed concentration in mol/L; theta0Represents the feed temperature in units of; rho represents the density of the reaction solution, and the unit is kg/L; cρThe heat capacity of the reaction solution is expressed in kJ/(kg. K); k is a radical ofwThe heat transfer coefficient of the cooling jacket is expressed in kJ/(h.m)2·K);ARDenotes the heat transfer area of the cooling jacket in m2;mKDenotes the mass of the cooling liquid in kg; cPKThe heat capacity of the cooling liquid is expressed in kJ/(kg. K); respectively represent reaction rates k1、k2、k3Enthalpy, in kJ/mol; reaction velocity ki(i ═ 1,2,3) depends on the reaction temperature and has the following form:
wherein k isi0Is corresponding to the reaction velocity kiIn units of h-1,EiIs corresponding to the reaction velocity kiThe unit of activation energy of (a) is K, i is 1,2,3.
And 2, carrying out variable scaling and discretization treatment, wherein the variable dimensionless scaling of the continuous stirred tank reactor system is as follows:
wherein, cA|SAs steady-state value of component A concentration, cB|SIs a steady-state value of the concentration of component B, [ theta ]SFor steady state values of reaction temperature, θK|SFor a steady-state value of the cooling temperature,is a steady state value of the material feed rate,is a steady-state value of the heat dissipation in the cooling jacket, cA0|SIs a steady state value of feed concentration, θ0|SIs the steady state value of the feed temperature.
After a continuous stirring reaction kettle system expressed by a nonlinear differential equation is linearized at a stable working point and sampled and dispersed, a discrete model in the following form is obtained:
wherein x isk∈RnIs a system state quantity, uk∈RgFor control input, yk∈RpMeasurement output, wk∈RmFor external interference, vk∈RpTo measure noise; w is akAnd vkAll conform to the white Gaussian noise characteristic, namely E (w)k)=0,E(vk)=0,Delta is a sign function; u. ofmaxAnd uminUpper and lower bound, w, respectively, of the control inputmaxAnd wminUpper and lower bound, T, respectively, of external interferencetotalFor the number of sample points, α and β are constant coefficient matrices.
And 3, obtaining a fitness function meeting the comprehensive performance index. Designing a rolling time domain estimator based on the discrete model in the step 2, wherein the form is as follows:
wherein T is the current time, T belongs to [ N +1, T ∈ [ ]total]N is a fixed time domain length, N is an element (0, T)total) And is an integer value, and T-N > 0,is a priori estimated value, ΠT-NIs a covariance matrix in the arrival cost;
solving the optimization problem described by the above equation can be obtainedAndthus represented by the formula:
obtaining x (T-N +1) and an estimated value x (T) at the current moment, and taking x (T-N +1) as a priori estimated value of rolling calculation at the next moment. Finally, a sequence formed by the state estimation values at all the moments in sequence is obtained
Mean square error value defining the effect of a measure of estimationWherein tau isj(j ═ 1,2,3,4) is a weight for each state component; t istotalCounting the number of sampling points; Δ xj,k(j=1,2,3,4;k=1,...,Ttotal) The absolute value of the deviation between the real value and the estimated value of the jth component of the system state at the moment k;
in view of weighing both the speed and the effect, the index values of the two different dimensions are normalized:
wherein, tactual,tmin,tmaxThe actual running time length, the shortest running time and the longest running time of the estimator are respectively expressed in seconds,respectively obtaining a minimum mean square error value and a maximum mean square error value of the estimator;
defining a fitness function of the form f (·) ═ Γ1tv+Γ2Δ χ, where f (·) is a fitness function with respect to a fixed time-domain length, Γ1,Γ2Is a set weight value. The parameter optimization problem with the continuous stirred tank state estimator can be transformed into the following form of problem:
0<N<Ttotal
N∈Z+
wherein Z is+Is a positive integer set.
Step 4, determining population size NP and optimizing algebra NtotalSetting the number of sampling points TtotalSetting d to 1, adopting dynamic binary coding for the individual, and setting the value of d to be (0, T)total) Initializing a group of parameters N in the range to serve as an initial population;
step 5, calculating the fitness function value f (p) of each individual pj (j is 1,2 … NP) in the populationj) Record the best individual p in the current generationbestAnd its fitness function value f (p)best) Selecting new good individuals according to the roulette rule;
6, crossing the selected paired individuals with a probability PcExchange the coded information between them and generate the mutation probability PmActing on individuals in the population to produce a new progeny p'j(j-1, 2 … NP), wherein Pc∈(0.8,1,)Pm∈(0,0.2);
Step 7, p 'of each individual in the new filial generation'j(j ═ 1,2 … NP) as the initial solution state X0And adopting a simulated annealing mechanism to update in sequence according to the following substeps:
substep 1, setting an initial temperature T0Threshold temperatureTfThe iteration number L of each temperature value is let kk be 1, and the current temperature Tem be T0;
Substep 2, at (0, T)total) Randomly generating a new solution X 'in an interval, and calculating an increment value delta f ═ f (X) -f (X');
substep 3, judging whether the new solution X 'is accepted according to a Metropolis sampling criterion, if so, changing X into X', otherwise, keeping X unchanged;
substep 4, if kk is less than L, kk ═ kk +1, go to substep 2; otherwise, go to substep 5;
substep 5, if the temperature value in the simulated annealing mechanism is less than the preset threshold value TfOr the end condition that the solution state does not change is output, the current solution is a new individual pnew(ii) a If not, the temperature reduction function Tem is equal to KtX Tem generates the next time temperature value, where 0 < KtIf the temperature coefficient is less than 1, the process goes to substep 2;
step 8, if d is equal to NtotalGo to step 9; if d is less than NtotalD +1 and go to step 5;
and 9, outputting the optimal individual and the optimal value so as to obtain the optimal time domain length parameter and the optimal fitness function value.
The step 4 of adopting dynamic binary coding for the individuals comprises the following steps:
the length m of the binary code is represented by inequality 2m-1<Ttotal<2m-1 a calculated integer value, where TtotalThe number of sampling points.
The roulette rule for selecting the good individual in step 5 includes:
if a certain individual pjHas a fitness function value of f (p)j) The probability that the population is chosen is expressed as NPThe larger the individual fitness function value is, the larger the chance of selecting the individual fitness function value is; and vice versa.
The Metropolis sampling criterion in step 7 includes:
metropolis is an effective method for sampling the heavy points, and the algorithm is as follows: when the system changes from one energy state to another, the corresponding energy changes from e1Change to e2If e is2<e1The system accepts this status; otherwise, the state is accepted or discarded with a random probability. The probability that the new state is accepted is
In the formula, e2Representing the energy value resulting from the new state, i.e. f (X'), e1Representing the energy value that the old state produced, i.e., f (x), η represents the probability of accepting the new solution.
The invention has the following beneficial effects: 1. the method directly utilizes the simulated annealing mechanism to enhance the local search capability of the algorithm, and compared with a single optimization algorithm, the performance is improved without adding new algorithm parameters. 2. Aiming at measuring indexes with different properties, the fitness function is designed by adopting a normalization idea to bring the indexes into the same dimension, the idea is simple and convenient and easy to realize, the scientificity and the real-time property of calculation are considered, and optimized parameters are obtained in the process of estimating the state of the continuous stirred tank reactor system. 3. The algorithm utilizes GA (genetic Algorithm) and SAA (simulated annealing Algorithm) to combine to automatically optimize parameters, and has the remarkable advantages of high convergence speed, high calculation efficiency, good optimization performance and the like.
Drawings
FIG. 1 is a schematic view of a calculation flow of a parameter optimization method of the present invention;
FIG. 2 is a parameter-optimized fitness function convergence curve of the present invention;
fig. 3a, fig. 3B, fig. 3c, and fig. 3d are respectively the results of the simulation of the concentration of the substance a, the concentration of the substance B, the temperature in the cooling jacket, and the temperature in the reactor in the continuous stirred tank reactor system under parameter optimization.
Detailed Description
The technical scheme of the invention is explained in detail in the following with the accompanying drawings:
the parameter optimization method of the continuous stirring reaction kettle state estimator comprises the following steps:
step 1, establishing an ideal dynamic characteristic equation of the continuous stirring reaction kettle, wherein the equation is in the form as follows:
in the formula, cAAnd cBRespectively representing the concentration of the components A (cyclopentadiene) and B (cyclopentene) in mol/L; theta and thetaKRespectively representing the reaction temperature and the cooling temperature, and the unit is; andrespectively represent cA、cBTheta and thetaKA derivative of (a); v represents the feed volume in m3;Represents the derivative of V; vRDenotes the reaction volume in m3;Represents the heat dissipation in the cooling jacket in KJ · h-1;cA0Represents the feed concentration in mol/L; theta0Represents the feed temperature in units of; rho represents the density of the reaction solution, and the unit is kg/L; cρThe heat capacity of the reaction solution is expressed in kJ/(kg. K); k is a radical ofwThe heat transfer coefficient of the cooling jacket is expressed in kJ/(h.m)2·K);ARDenotes the heat transfer area of the cooling jacket in m2;mKDenotes the mass of the cooling liquid in kg; cPKThe heat capacity of the cooling liquid is expressed in kJ/(kg. K); respectively represent reaction rates k1、k2、k3Enthalpy, in kJ/mol; reaction velocity ki(i ═ 1,2,3) depends on the reaction temperature and has the following form:
wherein k isi0Is corresponding to the reaction velocity kiIn units of h-1,EiIs corresponding to the reaction velocity kiThe activation energy of (a) is in units of K, i ═ 1,2,3。
and 2, carrying out variable scaling and discretization treatment, wherein the variable dimensionless scaling of the continuous stirred tank reactor system is as follows:
wherein, cA|SAs steady-state value of component A concentration, cB|SIs a steady-state value of the concentration of component B, [ theta ]SFor steady state values of reaction temperature, θK|SFor a steady-state value of the cooling temperature,is a steady state value of the material feed rate,is a steady-state value of the heat dissipation in the cooling jacket, cA0|SIs a steady state value of feed concentration, θ0|SIs the steady state value of the feed temperature.
Temperature theta0And concentration cA0The fluctuation range of (a) is as follows:
4.6mol/L≤cA0≤6mol/L,
100℃≤θ0≤115℃.
the steady state values for the various variables are as follows:
cA|S=2.14mol/L,cA0|S=5.10mol/L,
cB|S=1.09mol/L,θ0|S=104.9℃,
θ|S=114.2℃,
θK|S=112.9℃
after a continuous stirring reaction kettle system represented by a nonlinear differential equation is linearized at a stable working point and is dispersed for 50s of sampling time, a discrete model in the following form is obtained:
wherein x isk∈RnIs a system state quantity, uk∈RgFor control input, yk∈RpMeasurement output, wk∈RmFor external interference, vk∈RpTo measure noise; w is akAnd vkAll conform to the white Gaussian noise characteristic, namely E (w)k)=0,E(vk)=0,Delta is a sign function; u. ofmaxAnd uminUpper and lower bound, w, respectively, of the control inputmaxAnd wminUpper and lower bound, T, respectively, of external interferencetotalThe number of sampling points.
The known parameters are as follows:
umin=[-0.7886 -1]T,umax=[1.4665 7.0826]T,
wmin=[-0.0980 -0.0130]T,wmax=[0.1765 0.0267]T.
and 3, obtaining a fitness function meeting the comprehensive performance index. Designing a rolling time domain estimator based on the discrete model in the step 2, wherein the form is as follows:
wherein T is the current time, T belongs to [ N +1, T ∈ [ ]total]N is a fixed time domain length, N is an element (0, T)total) And is an integer value, and T-N > 0,is a priori estimated value, ΠT-NIs a covariance matrix in the arrival cost;
wherein,
solving the optimization problem described by the above equation can be obtainedAndthereby having the formula
Obtaining x (T-N +1) and current time estimated value x (T), and rolling and calculating x (T-N +1) as the next timeA priori estimate. Finally, a sequence formed by the state estimation values at all the moments in sequence is obtained
Mean square error value defining the effect of a measure of estimationWherein tau isj(j ═ 1,2,3,4) is a weight for each state component; t istotalCounting the number of sampling points; Δ xj,k(j=1,2,3,4;k=1,...,Ttotal) The absolute value of the deviation between the real value and the estimated value of the jth component of the system state at the moment k;
in view of weighing both the speed and the effect, the index values of the two different dimensions are normalized:
wherein, tactual,tmin,tmaxThe actual running time length, the shortest running time and the longest running time of the estimator are respectively expressed in seconds,respectively obtaining a minimum mean square error value and a maximum mean square error value of the estimator;
defining a fitness function of the form f (·) ═ Γ1tv+Γ2Δ χ, where f (·) is a fitness function with respect to a fixed time-domain length, Γ1,Γ2For the set weight values, 0.5 is taken. The parameter optimization problem with the continuous stirred tank state estimator can be transformed into the following form of problem:
0<N<Ttotal
N∈Z+
wherein Z is+Is a positive integer set.
Step 4, determining the population size NP to be 10 and optimizing the algebra NtotalSet the number of sampling points T as 100total350, setting d to 1, dynamic binary coding is adopted for the individuals, and the coding is performed at (0, T)total) Initializing a group of parameters N in the range to serve as an initial population;
step 5, calculating each individual p in the populationjFitness function value f (p) of (j ═ 1,2 … NP)j) Record the best individual p in the current generationbestAnd its fitness function value f (p)best) Selecting new good individuals according to the roulette rule;
6, crossing the selected paired individuals with a probability PcExchanging the coded information between them at 0.95, and changing the probability Pm0.1 on individuals in the population, yielding new progeny p'j(j-1, 2 … NP), wherein Pc∈(0.8,1),Pm∈(0,0.2);
Step 7, p 'of each individual in the new filial generation'j(j ═ 1,2.. NP) as the initial solution state X0And adopting a simulated annealing mechanism to update in sequence according to the following substeps:
substep 1, setting an initial temperature T0100 ℃, threshold temperature TfAt 25 deg.c, the number of iterations L of each temperature value is 20, k is 1, and the current temperature Tem is T0;
Substep 2, at (0, T)total) Randomly generating a new solution X 'in an interval, and calculating an increment value delta f ═ f (X) -f (X');
substep 3, judging whether the new solution X 'is accepted according to a Metropolis sampling criterion, if so, changing X into X', otherwise, keeping X unchanged;
substep 4, if kk is less than L, kk ═ kk +1, go to substep 2; otherwise, go to substep 5;
substep 5, if the temperature value in the simulated annealing mechanism is less than the preset threshold value TfOr the end condition that the solution state does not change is output, the current solution is a new individual pnew(ii) a If not, the temperature reduction function Tem is equal to KtX Tem generates the next time temperature value, wherein let Kt0.75, and go to substep 2;
step 8, if d is equal to NtotalGo to step 9; if d is less than NtotalD +1 and go to step 5;
and 9, outputting the optimal individual and the optimal value so as to obtain the optimal time domain length parameter and the optimal fitness function value.
The step 4 of adopting dynamic binary coding for the individuals comprises the following steps:
the length m of the binary code is represented by inequality 2m-1<Ttotal<2m-1 a calculated integer value, where TtotalFor the number of sampling points, the number of coding bits of the fixed time domain length is m ═ 9.
The roulette rule for selecting the good individual in step 5 includes:
if a certain individual pjHas a fitness function value of f (p)j) The probability that the population is chosen is expressed as NPThe larger the individual fitness value, the greater the chance that it will be selected; and vice versa.
The Metropolis sampling criterion in step 7 includes:
metropolis is an effective method for sampling the heavy points, and the algorithm is as follows: when the system changes from one energy state to another, the corresponding energy changes from e1Change to e2If e is2<e1The system accepts thisA state; otherwise, the state is accepted or discarded with a random probability. The probability that the new state is accepted is
In the formula, e2Representing the energy value resulting from the new state, i.e. f (X'), e1Representing the energy value that the old state produced, i.e., f (x), η represents the probability of accepting the new solution.
In order to verify the parameter optimization method of the continuous stirred tank reactor state estimator, the program provided by the invention runs in a Matlab2014a environment, and an Intel Core i5 processor, a 2.5GHz CPU and a 4GB internal memory computer are adopted. The fitness function convergence curve of the parameter optimization method is shown in FIG. 2, and when T is reachedtotalFig. 3a to 3d show simulation results of the respective state quantities in the continuous stirred tank reactor system under the optimum combination parameter of N-21, and fig. 3a, 3B, 3c, and 3d show simulation results of curves of the concentration of the substance a, the concentration of the substance B, the temperature in the cooling jacket, and the temperature in the reactor in the continuous stirred tank reactor system, respectively.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and is not intended to limit the practice of the invention to these embodiments. For those skilled in the art to which the invention pertains, several simple deductions or substitutions may be made without departing from the inventive concept, which should be construed as falling within the scope of the present invention.