Optimization method and device for petrochemical process dynamic simulation
By training, prediction and optimization of the distributed agent model of dynamic simulation of petrochemical process, the poor convergence efficiency and search accuracy of classic Bayesian optimization algorithms in high-dimensional decision space are solved, and a more efficient chemical system is realized optimization.
Patent Information
- Application Number
- CN202411575495.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-21
AI Technical Summary
In the petrochemical process simulation of high-dimensional decision space, the convergence efficiency and search accuracy of the classic Bayesian optimization algorithm are poor, making it difficult to effectively optimize the chemical system.
By acquiring training data, training and prediction of the distributed proxy model, computing the target acquisition function and response regret data, using optimization methods to determine the key values to determine the recommended sampling location, and updating the model through multiple sampling and training.
The convergence efficiency and convergence accuracy of the model are improved, the accuracy of sampling positions is enhanced, and more efficient dynamic simulation optimization of petrochemical processes is achieved.
Smart Images

Figure CN119494274A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of chemical process analysis, and in particular to an optimization method and device for dynamic simulation of a petrochemical process. Background Art
[0002] Driven by the "dual carbon" strategy and the coupling of intelligent manufacturing, the digitalization and intelligent transformation of the chemical process industry has received continuous attention from the industry and academia. Among them, the whole process optimization problem is one of the important research directions. However, since the chemical system involves complex physical and chemical changes, its mathematical model expression is also extremely complex. Therefore, optimization based on strict mathematical models is extremely difficult. In this context, simulation-based chemical system optimization (black box optimization) has become a method widely adopted by academia and industry.
[0003] In the existing technology, for black box optimization problems, heuristic optimization algorithms represented by genetic algorithms consume too many sampling resources and cannot guarantee convergence to the global optimal solution; Bayesian optimization can efficiently find the global optimal solution with limited sampling resources, and has more application prospects in simulation-based chemical system optimization. However, in the global synchronous tuning problem of process simulation with high-dimensional decision space, the classical Bayesian optimization algorithm performs poorly and needs to be further improved to improve its convergence efficiency and search accuracy. Summary of the invention
[0004] The present invention provides an optimization method and device for dynamic simulation of a petrochemical process, so as to achieve the technical effect of improving the model convergence efficiency and convergence precision, as well as the search accuracy.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides an optimization method for dynamic simulation of a petrochemical process, comprising the following steps:
[0006] Acquire training data, and perform training prediction on the distributed agent model using the training data to obtain prediction data;
[0007] Obtain the target acquisition function and response regret data of the distributed agent model by calculation according to the predicted data and the target expected data of each module of the distributed agent model;
[0008] Calculating the target acquisition function and the key values of the response regret data by a preset optimization method, and determining a first recommended sampling position according to the calculated key values;
[0009] The target simulation model is sampled according to the first recommended sampling position, and the sampling result data is added to the training set until the sampling is completed and the optimized model is output.
[0010] The petrochemical process dynamic simulation optimization method provided by the present invention first trains and predicts the distributed agent model through the acquired training data to obtain corresponding prediction data. The distributed agent model extracts the modular characteristics of the chemical system, and performs distributed control of the extracted modules by the agent model. The distributed agent model simplifies the simulation process of the whole process of the complex chemical system, thereby improving the training efficiency of the model and reducing the amount of training calculation. The distributed agent model is trained with training data to obtain prediction data, thereby improving the sensitivity of the model to the petrochemical process simulation data.
[0011] After obtaining the predicted data, the system can calculate the target acquisition function and response regret data of the model based on the predicted data of each module of the distributed agent model and the target expected data of each module. The target acquisition function of the next sampling can be determined by the gap between the predicted data and the target expected data of each module and the response regret data.
[0012] In order to further accurately sample the data range, the system will also optimize the target acquisition function and response regret data through optimization methods to obtain the corresponding key values, and then determine the first recommended sampling position based on the refined key values, that is, the recommended sampling position for the next cycle sampling, thereby improving the convergence efficiency and convergence accuracy of the model, as well as the sampling position accuracy of the model.
[0013] After obtaining a more accurate sampling location, re-sampling can be performed and the sampling results can be added to the training set, waiting for the system to retrieve the training data for model training of the distributed agent model until the sampling is completed and the optimization plan for the chemical process is output.
[0014] As a preferred example, the training and prediction of the distributed agent model using the training data to obtain the prediction data specifically includes:
[0015] Acquire the training data from the training set, parse the training data, and obtain input variable data, response variable data, and objective function data;
[0016] Performing module data division on the input variable data, the response variable data and the objective function data according to a preset module type to obtain module training data corresponding to each module;
[0017] The module training data and the module are associated and identified according to the module type, and the module training data is input into the distributed agent model of the corresponding module for training according to the identified association relationship to obtain the predicted data output by each module.
[0018] In order to accurately improve the prediction data accuracy of the distributed proxy model, the optimization method provided by the present invention will simultaneously parse the training data when acquiring the training data, obtain the corresponding input variable data, response variable data and objective function data, and divide the above-mentioned types of data into modules according to the module type, and obtain the module training data corresponding to each module, including the input variable data, response variable data and objective function data corresponding to each module. By dividing the training data according to different module types to obtain the module training data corresponding to each module, it is convenient for the system to perform more accurate training on the distributed proxy model according to the different module types in the future, and improve the prediction accuracy of each module in the distributed proxy model on average.
[0019] After determining the module training data corresponding to each module, different module training data can be input into different modules according to different module types, so as to achieve optimized training of different modules and obtain the prediction data of each module as the data basis for subsequent optimization algorithms, thereby improving the accuracy of the recommended sampling positions.
[0020] As a preferred example, the step of calculating the target acquisition function and response regret data of the distributed agent model according to the prediction data and the target expected data of each module of the distributed agent model includes:
[0021] Calculate and determine the response regret data according to the predicted data and the target expected data corresponding to the module, and then calculate and determine the target acquisition function according to the response regret data and the predicted data;
[0022] The target parameters of module 0 of the distributed agent model are adjusted according to the determined target acquisition function.
[0023] After obtaining the prediction data of each module, the response regret data of each module can be calculated based on the target expected data of each module and its output prediction data, that is, the gap between the output data and the expected data. In this way, the gap between the output value and the expected value of each module is determined, which serves as reference data for measuring the prediction accuracy of the module. It can also provide data reference for the subsequent determination of the recommended sampling position.
[0024] After determining the response regret data of each module, the system can also determine the target acquisition function based on the determined response regret data, that is, the target acquisition function of the last module in the distributed agent model, that is, module zero, so as to further accurately recommend the sampling position and further improve the accuracy of the recommended sampling position.
[0025] As a preferred example, the key values of the target acquisition function and the response regret data are calculated by a preset optimization method, and the first recommended sampling position is determined according to the calculated key values, specifically:
[0026] Determining the optimization search range of the target acquisition function and the response regret data through a preset input variable decision space and a response variable search space;
[0027] The target acquisition function and the response regret data are searched and optimized according to the determined optimization search range through a white box model optimization method to obtain the corresponding key value, and then the first recommended sampling position is determined according to the key value calculation.
[0028] The optimized search range of the target acquisition function and the response regret data is determined by the preset input variable decision space and the response variable search space, which narrows the search range and improves the search accuracy. The further determined search range and optimization range also improve the search efficiency. The target acquisition function and the response regret data are searched and optimized by the white box optimization method through the determined optimization search range, and the corresponding key values are obtained, so that the recommended sampling position for the next sampling can be determined, which improves the accuracy of the sampling position.
[0029] As a preferred example, sampling the target simulation model according to the first recommended sampling position, and adding the sampling result data to the training set until the sampling is completed and the optimized model is output, specifically:
[0030] Sampling the target simulation model based on the petrochemical process according to the first recommended sampling position to obtain sampling data, and inputting the sampling data as input variable data into the distributed agent model to simulate the petrochemical process to obtain corresponding response variable data and objective function data;
[0031] The response variable data and the objective function data are added to the training set as the sampling result data, so that the training data in the training set is updated, and the distributed agent model is trained and optimized through the updated training data to obtain a second recommended sampling position until the sampling of the target simulation model is completed and the optimized model is output.
[0032] After the first recommended sampling position is determined, the target simulation model can be sampled according to the determined sampling position, that is, the target simulation model built based on the petrochemical process simulation is sampled, and the sampling data obtained by sampling is input as input variable data into the distributed agent model for petrochemical process simulation, thereby obtaining the corresponding response variable data and objective function data of each module.
[0033] After obtaining the above two types of data, the system inputs them into the training set as sampling result data, updates the training data in the training set to improve the timeliness and accuracy of the training data in the training set, and trains and optimizes the distributed agent model again according to the updated training data, and obtains the corresponding second recommended sampling position until the sampling of the target simulation model is completed. The chemical process simulation model optimized by the above optimization method can be output by module No. 0 of the distributed agent model.
[0034] Accordingly, an embodiment of the present invention further provides an optimization device for dynamic simulation of a petrochemical process, the optimization device comprising a data prediction module, a function calculation module, a position determination module and a sampling cycle module; wherein:
[0035] The data prediction module is used to obtain training data, and perform training prediction on the distributed agent model through the training data to obtain prediction data;
[0036] The function calculation module is used to calculate the target acquisition function and response regret data of the distributed agent model according to the predicted data and the target expected data;
[0037] The position determination module is used to calculate the key values of the target acquisition function and the response regret data through a preset optimization method, and determine the first recommended sampling position according to the calculated key values;
[0038] The sampling cycle module is used to sample the target simulation model according to the recommended sampling position, and add the sampling result data to the training set until the sampling is completed.
[0039] As a preferred example, the data prediction module performs training prediction on the distributed agent model through the training data to obtain prediction data, specifically including:
[0040] Acquire the training data from the training set, parse the training data, and obtain input variable data, response variable data, and objective function data;
[0041] Performing module data division on the input variable data, the response variable data and the objective function data according to a preset module type to obtain module training data corresponding to each module;
[0042] The module training data and the module are associated and identified according to the module type, and the module training data is input into the distributed agent model of the corresponding module for training according to the identified association relationship to obtain the predicted data output by each module.
[0043] As a preferred example, the function calculation module calculates the target acquisition function and response regret data of the distributed agent model according to the prediction data and the target expectation data, including:
[0044] Calculate and determine the response regret data according to the predicted data and the target expected data corresponding to the module, and then calculate and determine the target acquisition function according to the response regret data and the predicted data;
[0045] The target parameters of module 0 of the distributed agent model are adjusted according to the determined target acquisition function.
[0046] As a preferred example, the position determination module calculates the key values of the target acquisition function and the response regret data through a preset optimization method, and determines the first recommended sampling position according to the calculated key values, specifically:
[0047] Determining the optimization search range of the target acquisition function and the response regret data through a preset input variable decision space and a response variable search space;
[0048] The target acquisition function and the response regret data are searched and optimized according to the determined optimization search range through a white box model optimization method to obtain the corresponding key value, and then the first recommended sampling position is determined according to the key value calculation.
[0049] As a preferred example, the sampling cycle module samples the target simulation model according to the first recommended sampling position, and adds the sampling result data to the training set until the sampling is completed, specifically:
[0050] Sampling the target simulation model based on the petrochemical process according to the first recommended sampling position to obtain sampling data, and inputting the sampling data as input variable data into the distributed agent model to simulate the petrochemical process to obtain corresponding response variable data and objective function data;
[0051] The response variable data and the objective function data are added to the training set as the sampling result data, so that the training data in the training set is updated, and the distributed agent model is trained and optimized through the updated training data to obtain a second recommended sampling position until the sampling of the target simulation model is completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 : A flow chart of an embodiment of the optimization method for petrochemical process dynamic simulation provided by the present invention;
[0053] Figure 2: A structural diagram of an embodiment of the optimization device for petrochemical process dynamic simulation provided by the present invention;
[0054] Figure 3 : A schematic diagram of a module system model of a distributed Bayesian optimization algorithm provided by the present invention;
[0055] Figure 4 : A structural diagram of an embodiment of a distributed proxy model provided by the present invention;
[0056] Figure 5 :A flow chart of an embodiment of the two-step process for synthesizing dimethyl ether provided by the present invention;
[0057] Figure 6 : A line chart showing the optimization effects of the classic Bayesian optimization and distributed Bayesian optimization algorithms provided by the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] Embodiment 1
[0060] Please refer to Figure 1 , which is a flow chart of an embodiment of the optimization method for petrochemical process dynamic simulation provided by the present invention, including steps 101 to 104, each step is specifically as follows:
[0061] Step 101: Acquire training data, and perform training prediction on the distributed agent model using the training data to obtain prediction data.
[0062] The petrochemical process dynamic simulation optimization method provided by the embodiment of the present invention first trains and predicts the distributed agent model through the acquired training data to obtain corresponding prediction data. The distributed agent model extracts the modular characteristics of the chemical system, and performs distributed control of the extracted modules on the agent model. The distributed agent model simplifies the simulation process of the whole process of the complex chemical system, thereby improving the training efficiency of the model and reducing the amount of training calculation. The distributed agent model is trained with training data to obtain prediction data, thereby improving the sensitivity of the model to the petrochemical process simulation data.
[0063] In this embodiment, the system utilizes the modular characteristics of chemical process simulation to improve the Bayesian optimization algorithm, establishes a distributed agent model for a sequential modular system, namely, a petrochemical process simulation system, and constructs a collection strategy by minimizing response regret, namely, generating recommended sampling locations.
[0064] The system first establishes a conceptual model for the modular structure in chemical system process simulation. Figure 3 As shown, Figure 3 The schematic diagram of the module system model of the distributed Bayesian optimization algorithm provided by the present invention is that the input variables, response variables and objective functions in each sequential module system are clarified through the established module system model of the distributed Bayesian optimization algorithm. And for each component of the response variable of each module in the above-established model, a proxy model about the input variable of the module and the response variable of the previous module is established, and the proxy models of all the established module components are integrated to obtain the distributed proxy model described in this embodiment.
[0065] like Figure 3 The modular system model of the distributed Bayesian optimization algorithm shown in the figure is composed of multiple modules arranged in sequence. Each module contains two types of input data, one of which is the output data y of the previous module. n ,y n-1 ...y0, which is the response variable data in this embodiment, and the second is the external input decision variable data x n ,x n-1 ...x0, namely the input variable data in this embodiment. Among them, Figure 3 The input data of the initial module, ie the first-ranked module, of the illustrated model only includes the input variable data of the external input, but does not include the response variable data.
[0066] Specifically, the present embodiment performs training prediction on the distributed agent model through the training data to obtain prediction data, specifically including:
[0067] Acquire the training data from the training set, parse the training data, and obtain input variable data, response variable data, and objective function data;
[0068] Performing module data division on the input variable data, the response variable data and the objective function data according to a preset module type to obtain module training data corresponding to each module;
[0069] The module training data and the module are associated and identified according to the module type, and the module training data is input into the distributed agent model of the corresponding module for training according to the identified association relationship to obtain the predicted data output by each module.
[0070] In order to accurately improve the prediction data accuracy of the distributed proxy model, the optimization method provided by the present invention will simultaneously parse the training data when acquiring the training data, obtain the corresponding input variable data, response variable data and objective function data, and divide the above-mentioned types of data into modules according to the module type, and obtain the module training data corresponding to each module, including the input variable data, response variable data and objective function data corresponding to each module. By dividing the training data according to different module types to obtain the module training data corresponding to each module, it is convenient for the system to perform more accurate training on the distributed proxy model according to the different module types in the future, and improve the prediction accuracy of each module in the distributed proxy model on average.
[0071] After determining the module training data corresponding to each module, different module training data can be input into different modules according to different module types, so as to achieve optimized training of different modules and obtain the prediction data of each module as the data basis for subsequent optimization algorithms, thereby improving the accuracy of the recommended sampling positions.
[0072] In this embodiment, the training data includes: input variable data, response variable data and objective function data. When the distributed agent model is trained, the input variable data, response variable data and objective function data included are the input variable data, response variable data and objective function data of all modules in the distributed agent model. Therefore, when training, the modules are matched according to the module type, and different modules are trained according to different module training data, so that the training data of each module are the module training data corresponding to the module, that is, the input variable data, response variable data and objective function data corresponding to the module.
[0073] The distributed proxy model described in this embodiment is as follows: Figure 3 The module system model shown is constructed by integrating all the response variable data components of each module and all the proxy models about the input variable data of each module and the response variable data of the corresponding previous module. For details, see Figure 4 , Figure 4 A schematic diagram of the structure of an embodiment of the distributed proxy model provided by the present invention. Figure 4 As shown, Figure 4 Shown 11 ,y 12 ...y0 is the various components of the response variable data in this embodiment, so the distributed agent model in this embodiment is Figure 3 The proxy model is formed by integrating the components of all response variable data of all modules of the model.
[0074] At the same time, the distributed proxy model provided in this embodiment also models and estimates the black box model through sampling information, and provides information such as the predicted value of the response output of each module for making sampling decisions, that is, determining the recommended sampling location described in this embodiment.
[0075] Step 102: Calculate the target acquisition function and response regret data of the distributed agent model according to the predicted data and the target expected data of each module of the distributed agent model.
[0076] After obtaining the predicted data, the system can calculate the target acquisition function and response regret data of the model based on the predicted data of each module of the distributed agent model and the target expected data of each module. The target acquisition function of the next sampling can be determined by the gap between the predicted data and the target expected data of each module and the response regret data.
[0077] Specifically, the method of calculating the target acquisition function and response regret data of the distributed agent model according to the prediction data and the target expected data of each module of the distributed agent model in this embodiment includes:
[0078] Calculate and determine the response regret data according to the predicted data and the target expected data corresponding to the module, and then calculate and determine the target acquisition function according to the response regret data and the predicted data;
[0079] The target parameters of module 0 of the distributed agent model are adjusted according to the determined target acquisition function.
[0080] After obtaining the prediction data of each module, the response regret data of each module can be calculated based on the target expected data of each module and its output prediction data, that is, the gap between the output data and the expected data. In this way, the gap between the output value and the expected value of each module is determined, which serves as reference data for measuring the prediction accuracy of the module. It can also provide data reference for the subsequent determination of the recommended sampling position.
[0081] After determining the response regret data of each module, the system can also determine the target acquisition function based on the determined response regret data, that is, the target acquisition function of the last module in the distributed agent model, that is, module zero, so as to further accurately recommend the sampling position and further improve the accuracy of the recommended sampling position.
[0082] In this embodiment, the response regret data is reference data used to characterize the gap between the response variable data output of each module and the expected output value, that is, the target expected data described in this embodiment, and the target acquisition function is used to calculate the sampling suggestions based on the predicted values given by the agent model, that is, to provide reference data for the subsequent system to determine the recommended sampling positions.
[0083] Step 103: Calculate the key values of the target acquisition function and the response regret data using a preset optimization method, and determine a first recommended sampling position according to the calculated key values.
[0084] In order to further accurately sample the data range, the system will also optimize the target acquisition function and response regret data through optimization methods to obtain the corresponding key values, and then determine the first recommended sampling position based on the refined key values, that is, the recommended sampling position for the next cycle sampling, thereby improving the convergence efficiency and convergence accuracy of the model, as well as the sampling position accuracy of the model.
[0085] In this embodiment, the determined key value is the maximum value of the target acquisition function and the maximum value of the response regret data in this embodiment. The maximum value of the response regret data determined in this embodiment is the minimum value of the response regret data.
[0086] Specifically, in this embodiment, the key values of the target acquisition function and the response regret data are calculated by a preset optimization method, and the first recommended sampling position is determined according to the calculated key values, specifically:
[0087] Determining the optimization search range of the target acquisition function and the response regret data through a preset input variable decision space and a response variable search space;
[0088] The target acquisition function and the response regret data are searched and optimized according to the determined optimization search range through a white box model optimization method to obtain the corresponding key value, and then the first recommended sampling position is determined according to the key value calculation.
[0089] The optimized search range of the target acquisition function and the response regret data is determined by the preset input variable decision space and the response variable search space, which narrows the search range and improves the search accuracy. The further determined search range and optimization range also improve the search efficiency. The target acquisition function and the response regret data are searched and optimized by the white box optimization method through the determined optimization search range, and the corresponding key values are obtained, so that the recommended sampling position for the next sampling can be determined, which improves the accuracy of the sampling position.
[0090] In this embodiment, the input variable decision space and the response variable search space are used to specify the search range of the white box optimization problem when the acquisition strategy is running, that is, to determine the optimization search range of the target acquisition function and the response regret data in this embodiment, further improving the accuracy of the determined sampling position. The input variable decision space and the response variable search space in this embodiment are determined based on the actual situation of the target petrochemical process.
[0091] Step 104: Sampling the target simulation model according to the first recommended sampling position, and adding the sampling result data to the training set until the sampling is completed and the optimized model is output.
[0092] After obtaining a more accurate sampling location, re-sampling can be performed and the sampling results can be added to the training set, waiting for the system to retrieve the training data for model training of the distributed agent model until the sampling is completed and the optimization plan for the chemical process is output.
[0093] In this embodiment, the output sampling result data refers to the response variable data and the value of the objective function of each module output by the model after all input variables are given and the petrochemical process is simulated by the distributed agent model, that is, the objective function data described in this embodiment. After the sampling result data is determined, the system adds it as training data to the data set, that is, the training set described in this embodiment, for training the agent model of each module separately, that is, training and optimizing each module in the distributed agent model described in this embodiment.
[0094] Specifically, in this embodiment, sampling the target simulation model according to the first recommended sampling position, and adding the sampling result data to the training set until the sampling is completed and the optimized model is output, specifically:
[0095] Sampling the target simulation model based on the petrochemical process according to the first recommended sampling position to obtain sampling data, and inputting the sampling data as input variable data into the distributed agent model to simulate the petrochemical process to obtain corresponding response variable data and objective function data;
[0096] The response variable data and the objective function data are added to the training set as the sampling result data, so that the training data in the training set is updated, and the distributed agent model is trained and optimized through the updated training data to obtain a second recommended sampling position until the sampling of the target simulation model is completed and the optimized model is output.
[0097] After the first recommended sampling position is determined, the target simulation model can be sampled according to the determined sampling position, that is, the target simulation model built based on the petrochemical process simulation is sampled, and the sampling data obtained by sampling is input as input variable data into the distributed agent model for petrochemical process simulation, thereby obtaining the corresponding response variable data and objective function data of each module.
[0098] After obtaining the above two types of data, the system inputs them into the training set as sampling result data, updates the training data in the training set to improve the timeliness and accuracy of the training data in the training set, and trains and optimizes the distributed agent model again according to the updated training data, and obtains the corresponding second recommended sampling position until the sampling of the target simulation model is completed. The chemical process simulation model optimized by the above optimization method can be output by module No. 0 of the distributed agent model.
[0099] In this embodiment, the distributed Bayesian algorithm corresponding to the distributed agent model has significant advantages over the classical Bayesian algorithm for optimization problems with high-dimensional decision spaces, including faster convergence rate and higher convergence accuracy. Therefore, the optimization method provided in this embodiment improves the convergence rate and convergence accuracy of the distributed agent model, while also improving the search accuracy.
[0100] In order to further illustrate the effect of the distributed Bayesian optimization method provided in this embodiment, this embodiment also provides a specific example, which is a two-step dimethyl ether synthesis process based on the distributed Bayesian optimization method. The specific flow chart is as follows: Figure 5 As shown, Figure 5 The present invention provides a two-step process for synthesizing dimethyl ether according to an embodiment of the present invention.
[0101] See also Figure 5 First, according to the modeling method and acquisition strategy of the distributed Bayesian optimization algorithm provided in this embodiment, an agent model is established through Gaussian process regression, that is, the distributed agent model provided in this embodiment. Figure 1 and Figure 2 The model structure diagram provided is considered to be The following relationship exists:
[0102]
[0103] Where m represents the module number, represents a set of N+1 module numbers; i represents the index of each component of the response variable data, which can be called the sequence number of the response variable data, or sequence for short. It is module M m The I of the response variable data m The index set of components; y mi Represents the i-th component of the module response variable data; μ mi and k mi are the prior expectation and kernel function of this component respectively. Here x and x′ are m Input variable data and module M m+1The random field index of the response variable data (if any) is composed of the random field index. In particular, y0 can also be considered to obey the Gaussian process, but the index set of its variable components is an empty set, that is:
[0104]
[0105] As for the acquisition strategy, module 0 uses the UCB acquisition function, and its expression is as follows:
[0106] α UCB (x) = μ(x) + β·σ(x) # (3)
[0107] Here, β is a manually specified hyperparameter set to 2.576.
[0108] For modules other than module 0, this embodiment adopts a collection strategy that minimizes response regret, which can be expressed mathematically as follows:
[0109]
[0110] in, Represents the module number except module zero and the last module; x m ,y m+1 Respectively represent in module M m Decision space and module M for input variable data m+1 variables in the search space of the response variable data; It is module M m The corresponding sampling suggestions for input variable data, It is module M m+1 The corresponding response variable data value recommendation. regret m That is, the response regret data is a scalar function used to characterize the deviation between the predicted value of the module response, that is, the predicted data described in this embodiment, and the expected value, that is, the target expected data described in this embodiment.
[0111] As for the last module, that is, module No. 0 in this embodiment, it will inherit a similar collection strategy, as shown below:
[0112]
[0113] Among them, x N and The meaning of is similar to that in formula (4).
[0114] The specific form of the response regret data adopts the weighted balanced square error, which is defined as follows:
[0115]
[0116] in, Yes mi The corresponding proxy model gives the input variable data as x m And module M m+1 The response variable data is y m+1 The predicted value output by the model at this time, that is, the predicted data described in this embodiment, is the posterior expectation μ mi ; It is module M m-1 The value suggestions given are: ε is a small quantity close to machine precision, its role is to avoid zero as the denominator.
[0117] After determining the above formula contents, the system can implement the corresponding algorithm. The algorithm used in this example is written in Python language, and the integrated development framework PyCharm is used in the writing process. The code is interpreted in Windows 10 environment and runs in the PVM virtual machine. The main software packages that the code depends on are shown in the following table:
[0118]
[0119] Specifically, this example implements the core content of the distributed Bayesian optimization algorithm in the Python module distributed_bayesian_optimization. Among them, some numerical calculation methods call functions in the numpy software package, and the optimize module in the scipy software package is directly called for the optimization of the target acquisition function and the response regret data. Each module of the distributed agent model provided in this embodiment defines four classes: Kernel, GaussianProcessRegression, Module, and DistributedBayesianOptimization, which are described below.
[0120] First, the Gaussian RBF kernel function with parameters is defined in the Kernel class.
[0121] Secondly, in the GaussianProcessRegression class, its construction method realizes the establishment of a single proxy model based on Gaussian process regression through existing sampled data; its main methods include retrain and predict, which respectively realize the update of the model and the prediction based on the observed data, including the posterior expectation and standard deviation.
[0122] Third, the Module class establishes a proxy model for the module, and its construction method realizes the establishment of a proxy model for all response variables in a module according to the sampled data; the retrain method realizes the update of the proxy model of the module; the minimize (maximize) method realizes the optimization solution of the target acquisition function of the zero module; the solve method realizes the optimization solution of the response regret data (i.e., the square error of the weight balance described in this embodiment).
[0123] Fourth, the DistributedBayesianOptimization class implements the complete algorithm flow, and its construction method sets the parameters of the kernel function and the acquisition function; the start method is used to create module zero, specify the dimension of the input variable data, and train the module proxy model according to the passed data; the add_module method adds a module at the end of the system, and also specifies the dimension of the input variable data and trains the module proxy model according to the passed data; the suggest method gives a sampling suggestion through the acquisition strategy, that is, the suggested sampling position described in this embodiment, and returns the value suggestion of the response variable data and the maximum value of the target acquisition function and the response regret data; the manipulate method is used to run the algorithm and interact with the console, and realizes three operation modes including: passing in a single model function for optimization, passing in a model function sequence for optimization, and manually passing in the sampling results for optimization, and it specifies the sampling number by interacting with the console; the auto_manipulate method realizes fully automatic optimization and sampling, specifies the sampling number by passing in parameters, and establishes an interface for subsequent communication with the process simulation software.
[0124] In addition to the distributed_bayesian_optimization module, the system also defines some tool methods in the utils module. Among them, the latin_hypercube_sampling method wraps the lhs method in the pyDOE module, and implements the Latin hypercube sampling to give a specified number of decision points in the incoming decision space (represented by a column of tuples). Among them, the Latin hypercube sampling can give any number of decision points uniformly and randomly in a given space, which not only retains the randomness of sampling, but also avoids the situation where the sampling points may be too clustered when the number of samples is small in completely random sampling. It is a commonly used strategy for generating initialization data points.
[0125] For details, see Figure 5 , Figure 5 The following is a flow chart of an embodiment of the two-step process for synthesizing dimethyl ether provided by the present invention. Figure 5As shown in the figure, the system constructs a two-step dimethyl ether synthesis process in Aspen Plus, which includes six modules, namely REACTOR, SEP, FLASH, DIST, HEATER and REACTOR2 (two units merged into one module), FLASH2, and each module is regarded as Figure 3 A module in the system module model shown is subjected to distributed Bayesian optimization, that is, its corresponding proxy model is constructed.
[0126] Among them, the intermediate streams of the process include the following five: CRUDE, MID, IN, METH, and CRUDE2. Among them, the molar flow rate and molar fraction of methanol are selected as the response variable data for the four streams CRUDE, MID, IN, and METH, while the molar flow rate and molar fraction of dimethyl ether are selected as the response variable data for the stream CRUDE2.
[0127] The composition of the synthesis gas feed (FEED) is shown in the following table, and the feed pressure is 120 bar.
[0128]
[0129] In the two-step dimethyl ether synthesis process constructed in this example, the methanol synthesis reactor (REACTOR) adopts a fixed bed multi-tubular reactor. In order to simplify the process, this example adopts constant temperature hot fluid heat exchange, and the heat transfer parameter U = 244kcal·h -1 ·m -2 K. Tube length 12.2m, diameter 37.5mm, number of tubes 8000, filled with catalyst, particle density 2000kg / m 3 , bed void ratio 0.5, pressure drop 2.5bar. Subsequently, simple flash evaporation (FLASH) is used to separate redundant gases, and the pressure is set to 50bar. Then it enters distillation (DIST) to separate water and methanol. A plate tower is used with 20 plates, the feed position is above the 9th plate, the condenser pressure is 1bar, the temperature is 10℃, and a kettle reboiler is used. The gas separation tank (SEP) pressure is 106.5bar, and the methanol flash tank (FLASH) pressure is 2bar. The methanol distillation tower (DIST) has 40 plates, the feed position is above the 27th plate, the condenser pressure is 1bar, the temperature is 10℃, and a kettle reboiler is used.
[0130] The obtained methanol product enters the dimethyl ether synthesis reactor (REACTOR) after passing through the heat exchanger (HEATER). The reactor adopts a multi-tubular packed bed reactor with a pressure drop of 0.2 bar, a tube length of 5m, a tube diameter of 40mm, a tube number of 5000, and a filling catalyst particle density of 2000kg / m 3 , bed void ratio 0.5, constant temperature hot fluid heat exchange, heat transfer parameter U = 244kcal·h -1·m -2 · K. Finally, a dimethyl ether flash tank (FLASH2) is used for separation at a pressure of 1 bar.
[0131] In the above processes, the parameters to be optimized include: feed (FEED) temperature, hot fluid temperature outside the methanol synthesis reactor (REACTOR), gas separation tank (SEP) temperature, methanol flash tank (FLASH) temperature, methanol distillation tower (DIST) reflux ratio and reboiler heat load, heat exchanger (HEATER) material outlet temperature, hot fluid temperature outside the dimethyl ether synthesis reactor (REACTOR), dimethyl ether flash tank (FLASH2) temperature, a total of nine decision variables.
[0132] Among them, the hydrogenation of carbon dioxide to methanol in REACTOR involves the following two key reactions:
[0133]
[0134] The reaction of methanol dehydration to dimethyl ether in REACTOR2 is as follows:
[0135]
[0136] In summary, the kinetic equations for the above three reactions are as follows:
[0137]
[0138] The kinetic equation provided in this example is input in Aspen Plus using the LHHW type equation, where the input values of the constants of the equation corresponding to reaction (i) are shown in the following table:
[0139]
[0140]
[0141]
[0142] The input values of the constants for the equation corresponding to reaction (ii) are shown in the following table:
[0143]
[0144] The input values of the constants for the equation corresponding to reaction (iii) are shown in the following table:
[0145]
[0146]
[0147] After determining the above kinetic parameters, the system sets the optimization target to the sum of the molar flow rate of dimethyl ether in the DME stream (in kmol / h) and the molar fraction of dimethyl ether multiplied by one hundred. The initial number of sampling points is taken as 20. The optimization decision space is set as follows: FEED temperature 220~260℃; REACTOR hot fluid temperature 220~260℃; SEQ temperature 15~30℃; FLASH temperature 33~41℃; DIST reboiler heat load 50~70MW; DIST reflux ratio 0.2~0.5; HEATER outlet temperature 510~550℃; REACTOR2 hot fluid temperature 300~320℃; FLASH2 temperature 30~35℃.
[0148] The response variable search space is set as follows: methanol molar flow rate in CRUDE is 4355-4356 kmol / h, and the molar fraction is 0.1-0.2; methanol molar flow rate in MID is 4304-4305 kmol / h, and the molar fraction is 0.73-0.78; methanol molar flow rate in IN is 4250-4251 kmol / h, and the molar fraction is 0.8-0.85; methanol molar flow rate in METH is 4250-4251 kmol / h, and the molar fraction is 0.95-1; dimethyl ether molar flow rate in CRUDE2 is 1792-1793 kmol / h, and the molar fraction is 0.37-0.42.
[0149] The optimization effect obtained through the above settings is shown in the figure Figure 6 As shown, Figure 6 This is a line chart showing the optimization effects of the classic Bayesian optimization and distributed Bayesian optimization algorithms provided by the present invention. Figure 6 It can be seen that when the sampling times of the classic Bayesian and the distributed Bayesian are both 20, the sampling value of the classic Bayesian is only about 1670, while the sampling value corresponding to the distributed Bayesian optimization method provided in this embodiment is nearly 1740. Figure 6 The solid line in the middle is the average of 10 optimization results, and the shaded part represents the 95% confidence interval.
[0150] It can be seen that the distributed Bayesian optimization algorithm provided in this embodiment can achieve excellent optimization effects in both the given decision space and the response variable search space.
[0151] In order to better illustrate the working principle and step flow of the optimization method and device for dynamic simulation of petrochemical process of the present invention, it is possible but not limited to refer to the relevant records above.
[0152] Accordingly, see Figure 2 , Figure 2 This is a structural diagram of an embodiment of the optimization device for petrochemical process dynamic simulation provided by the present invention. Figure 2As shown, the optimization device includes a data prediction module 201, a function calculation module 202, a position determination module 203 and a sampling cycle module 204; wherein:
[0153] The data prediction module 201 is used to obtain training data, and perform training prediction on the distributed agent model through the training data to obtain prediction data.
[0154] Furthermore, the data prediction module 201 performs training prediction on the distributed agent model through the training data to obtain prediction data, which specifically includes:
[0155] Acquire the training data from the training set, parse the training data, and obtain input variable data, response variable data, and objective function data;
[0156] Performing module data division on the input variable data, the response variable data and the objective function data according to a preset module type to obtain module training data corresponding to each module;
[0157] The module training data and the module are associated and identified according to the module type, and the module training data is input into the distributed agent model of the corresponding module for training according to the identified association relationship to obtain the predicted data output by each module.
[0158] The function calculation module 202 is used to calculate the target acquisition function and response regret data of the distributed agent model according to the predicted data and the target expected data.
[0159] Furthermore, the function calculation module 202 calculates the target acquisition function and response regret data of the distributed agent model according to the predicted data and the target expected data, including:
[0160] Calculate and determine the response regret data according to the predicted data and the target expected data corresponding to the module, and then calculate and determine the target acquisition function according to the response regret data and the predicted data;
[0161] The target parameters of module 0 of the distributed agent model are adjusted according to the determined target acquisition function.
[0162] The position determination module 203 is used to calculate the key values of the target acquisition function and the response regret data through a preset optimization method, and determine the first recommended sampling position according to the calculated key values.
[0163] Furthermore, the position determination module 203 calculates the key values of the target acquisition function and the response regret data through a preset optimization method, and determines the first recommended sampling position according to the calculated key values, specifically:
[0164] Determining the optimization search range of the target acquisition function and the response regret data through a preset input variable decision space and a response variable search space;
[0165] The target acquisition function and the response regret data are searched and optimized according to the determined optimization search range through a white box model optimization method to obtain the corresponding key value, and then the first recommended sampling position is determined according to the key value calculation.
[0166] The sampling cycle module 204 is used to sample the target simulation model according to the recommended sampling positions, and add the sampling result data to the training set until the sampling is completed.
[0167] Furthermore, the sampling cycle module 204 samples the target simulation model according to the first recommended sampling position, and adds the sampling result data to the training set until the sampling is completed, specifically:
[0168] Sampling the target simulation model based on the petrochemical process according to the first recommended sampling position to obtain sampling data, and inputting the sampling data as input variable data into the distributed agent model to simulate the petrochemical process to obtain corresponding response variable data and objective function data;
[0169] The response variable data and the objective function data are added to the training set as the sampling result data, so that the training data in the training set is updated, and the distributed agent model is trained and optimized through the updated training data to obtain a second recommended sampling position until the sampling of the target simulation model is completed.
[0170] In summary, the embodiment of the present invention provides an optimization method and device for dynamic simulation of petrochemical processes, which trains and predicts a distributed proxy model through acquired training data, obtains and calculates a target acquisition function and response regret data based on the predicted data and the target expected data of each module of the distributed proxy model, calculates the key values of the target acquisition function and the response regret data through an optimization method, and determines the first recommended sampling position based on the key values, samples the target simulation model based on the determined first recommended sampling position, and adds the sampling results to the training set until the sampling is completed and the optimized model is output. The present invention simulates the modular characteristics of the chemical system through a distributed proxy model, improves the training efficiency of the model, and also reduces the computational amount of model training; determines the recommended sampling position based on the predicted value output by the model, improves the convergence efficiency and convergence accuracy of the model, and the sampling position accuracy of the model.
[0171] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A petrochemical process dynamic simulation optimization method, characterized in that: The following steps are involved: Acquire training data, and perform training prediction on the distributed agent model using the training data to obtain prediction data; Obtain the target acquisition function and response regret data of the distributed agent model by calculation according to the predicted data and the target expected data of each module of the distributed agent model; Calculating the target acquisition function and the key values of the response regret data by a preset optimization method, and determining a first recommended sampling position according to the calculated key values; The target simulation model is sampled according to the first recommended sampling position, and the sampling result data is added to the training set until the sampling is completed and the optimized model is output.
2. The optimization method for dynamic simulation of a petrochemical process according to claim 1, characterized in that: The training and prediction of the distributed agent model by using the training data to obtain the prediction data specifically includes: Acquire the training data from the training set, parse the training data, and obtain input variable data, response variable data, and objective function data; Performing module data division on the input variable data, the response variable data and the objective function data according to a preset module type to obtain module training data corresponding to each module; The module training data and the module are associated and identified according to the module type, and the module training data is input into the distributed agent model of the corresponding module for training according to the identified association relationship to obtain the predicted data output by each module.
3. The optimization method for dynamic simulation of a petrochemical process according to claim 1, characterized in that: The step of calculating the target acquisition function and response regret data of the distributed agent model according to the prediction data and the target expected data of each module of the distributed agent model comprises: Calculate and determine the response regret data according to the predicted data and the target expected data corresponding to the module, and then calculate and determine the target acquisition function according to the response regret data and the predicted data; The target parameters of module 0 of the distributed agent model are adjusted according to the determined target acquisition function.
4. The optimization method for dynamic simulation of a petrochemical process according to claim 1, characterized in that: The key values of the target acquisition function and the response regret data are calculated by a preset optimization method, and the first recommended sampling position is determined according to the calculated key values, specifically: Determining the optimization search range of the target acquisition function and the response regret data through a preset input variable decision space and a response variable search space; The target acquisition function and the response regret data are searched and optimized according to the determined optimization search range through a white box model optimization method to obtain the corresponding key value, and then the first recommended sampling position is determined according to the key value calculation.
5. The optimization method for dynamic simulation of a petrochemical process according to claim 1, characterized in that: The target simulation model is sampled according to the first recommended sampling position, and the sampling result data is added to the training set until the sampling is completed and the optimization scheme is output, specifically: Sampling the target simulation model based on the petrochemical process according to the first recommended sampling position to obtain sampling data, and inputting the sampling data as input variable data into the distributed agent model to simulate the petrochemical process to obtain corresponding response variable data and objective function data; The response variable data and the objective function data are added to the training set as the sampling result data, so that the training data in the training set is updated, and the distributed agent model is trained and optimized through the updated training data to obtain a second recommended sampling position until the sampling of the target simulation model is completed and the optimized model is output.
6. An optimization device for dynamic simulation of petrochemical processes, characterized in that: The optimization device includes a data prediction module, a function calculation module, a position determination module and a sampling cycle module; wherein: The data prediction module is used to obtain training data, and perform training prediction on the distributed agent model through the training data to obtain prediction data; The function calculation module is used to calculate the target acquisition function and response regret data of the distributed agent model according to the predicted data and the target expected data; The position determination module is used to calculate the key values of the target acquisition function and the response regret data through a preset optimization method, and determine the first recommended sampling position according to the calculated key values; The sampling cycle module is used to sample the target simulation model according to the recommended sampling position, and add the sampling result data to the training set until the sampling is completed.
7. The optimization device for dynamic simulation of petrochemical process according to claim 6, characterized in that: The data prediction module performs training prediction on the distributed agent model through the training data to obtain prediction data, specifically including: Acquire the training data from the training set, parse the training data, and obtain input variable data, response variable data, and objective function data; Performing module data division on the input variable data, the response variable data and the objective function data according to a preset module type to obtain module training data corresponding to each module; The module training data and the module are associated and identified according to the module type, and the module training data is input into the distributed agent model of the corresponding module for training according to the identified association relationship to obtain the predicted data output by each module.
8. The optimization device for dynamic simulation of petrochemical process according to claim 6, characterized in that: The function calculation module calculates the target acquisition function and response regret data of the distributed agent model according to the predicted data and the target expected data, including: Calculate and determine the response regret data according to the predicted data and the target expected data corresponding to the module, and then calculate and determine the target acquisition function according to the response regret data and the predicted data; The target parameters of module 0 of the distributed agent model are adjusted according to the determined target acquisition function.
9. The optimization device for dynamic simulation of petrochemical process according to claim 8, characterized in that: The position determination module calculates the key values of the target acquisition function and the response regret data through a preset optimization method, and determines the first recommended sampling position according to the calculated key values, specifically: Determining the optimization search range of the target acquisition function and the response regret data through a preset input variable decision space and a response variable search space; The target acquisition function and the response regret data are searched and optimized according to the determined optimization search range through a white box model optimization method to obtain the corresponding key value, and then the first recommended sampling position is determined according to the key value calculation.
10. The optimization device for dynamic simulation of petrochemical process according to claim 6, characterized in that: The sampling cycle module samples the target simulation model according to the first recommended sampling position, and adds the sampling result data to the training set until the sampling is completed, specifically: Sampling the target simulation model based on the petrochemical process according to the first recommended sampling position to obtain sampling data, and inputting the sampling data as input variable data into the distributed agent model to simulate the petrochemical process to obtain corresponding response variable data and objective function data; The response variable data and the objective function data are added to the training set as the sampling result data, so that the training data in the training set is updated, and the distributed agent model is trained and optimized through the updated training data to obtain a second recommended sampling position until the sampling of the target simulation model is completed.