CN117892635A - Modelica-based system simulation and neural network integration method - Google Patents
Modelica-based system simulation and neural network integration method Download PDFInfo
- Publication number
- CN117892635A CN117892635A CN202410285076.7A CN202410285076A CN117892635A CN 117892635 A CN117892635 A CN 117892635A CN 202410285076 A CN202410285076 A CN 202410285076A CN 117892635 A CN117892635 A CN 117892635A
- Authority
- CN
- China
- Prior art keywords
- data
- model
- steam
- neural network
- modelica
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004088 simulation Methods 0.000 title claims abstract description 47
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 34
- 230000010354 integration Effects 0.000 title claims abstract description 17
- 238000004364 calculation method Methods 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 claims abstract description 6
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 claims description 27
- 238000012549 training Methods 0.000 claims description 21
- 239000003795 chemical substances by application Substances 0.000 claims description 8
- 238000010606 normalization Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 6
- 238000003062 neural network model Methods 0.000 claims description 4
- 238000012795 verification Methods 0.000 claims description 4
- 238000013507 mapping Methods 0.000 claims description 2
- 238000005457 optimization Methods 0.000 abstract description 7
- 238000013461 design Methods 0.000 abstract description 4
- 238000004458 analytical method Methods 0.000 abstract 1
- 238000011156 evaluation Methods 0.000 abstract 1
- 230000008569 process Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 5
- 230000006872 improvement Effects 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000010248 power generation Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000002068 genetic effect Effects 0.000 description 1
- 238000010438 heat treatment Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Computer Hardware Design (AREA)
- Geometry (AREA)
- Feedback Control In General (AREA)
Abstract
The invention discloses a Modelica-based system simulation and neural network integration method, which is characterized in that an accurate system simulation model is built by using Modelica language, key operation data are acquired, the key operation data are trained by implementing a neural network by means of Python, a concise and efficient agent model capable of accurately reflecting the actual system operation state is formed, the function that the agent model can be directly used for rapidly evaluating a system is realized, the direct dependence on a complex Modelica model is reduced, the calculation efficiency is improved, and particularly in a scene requiring frequent operation or rapid evaluation, an accurate and efficient system simulation and analysis method is provided, so that the method has important practical application value in the aspects of engineering design, system optimization, decision support and the like.
Description
Technical Field
The invention relates to the field of neural network proxy model integration, in particular to a Modelica-based system simulation and neural network proxy model integration method.
Background
Modelica is a modeling and simulation language that is widely used to describe and analyze the physical behavior of dynamic systems. However, as the complexity of system models increases, some models may contain thousands of variables and equations. In this case, conventional simulation methods may face computational resource and time challenges, especially in scenarios where extensive parameter optimization is required or where real-time decisions are required. These challenges can lead to inefficiency in the simulation process, limiting the possibilities for deep understanding and optimization of system behavior.
The neural network agent model is used as a machine learning technology, has the capability of learning models in large-scale data, and can be used for accelerating the simulation process of a complex system. Therefore, the Modelica simulation model is combined with the neural network proxy model, so that the simulation efficiency can be improved while the accuracy is maintained, and particularly in a scene in which model prediction and optimization are required to be frequently performed. By combining the physical modeling capability of Modelica and the data learning capability of the neural network, the method can better cope with the challenges of modeling and optimizing a complex system and improve the efficiency of engineering design and decision making.
Disclosure of Invention
The invention provides a Modelica-based system simulation and neural network proxy model integration method. According to the method, the neural network proxy model is built by means of the operation result data of the Modelica system simulation, so that simulation efficiency is improved, a powerful tool is provided for model simplification and optimization, and new possibilities are brought for deep understanding and efficient design of a complex system.
A Modelica-based system simulation and neural network proxy model integration method comprises the following steps:
step S1, a Modelica simulation model of a steam circulation system is established based on a ThermoPower library, wherein the model comprises a condensing pump, a steam-water separator, a boiler, a steam pump, a superheater, a steam valve, a steam turbine, a condenser and a generator. Firstly, boiler water is heated and pumped into a steam-water separator through a steam pump, and steam in the steam-water separator is further heated through a heater, then flows through a steam valve for throttling and controlling pressure, and then enters a steam turbine to expand and do work to generate electricity for a generator. Finally, the steam enters a condenser to be condensed into water, and then is conveyed to a steam-water separator by a condensing pump to complete the circulation.
S2, performing system simulation calculation to obtain characteristic data as a data set 1, wherein the boiler heat supply quantity, the superheater heat quantity and the water supply quantity of a condensing pump in the simulation result are used as input data of the data set 1, and the generating capacity of a generator, the heat exchange quantity of a condenser and the shaft power of a steam turbine are used as observation data of the data set 1.
Step S3, carrying out normalization processing on the data set 1, and then setting parameters required by the neural network, wherein the parameters comprise the number of samples, the input dimension, the output dimension, the learning rate and the node number;
and S4, training a neural network model, and obtaining a prediction proxy model when the error between the model output result and the observed data of the data set 1 is smaller than an error set value.
And S5, obtaining steam circulation system data under another working condition by using the Modelica system model in the step S1 as a data set 2, checking, inputting input data of the data set 2 into the prediction proxy model, and comparing output data of the prediction proxy model with observation data of the data set 2. If the error is less than 3%, the proxy model is successfully built, otherwise, the step S4 is returned to for retraining.
In summary, the invention firstly builds a physical system model by using Modelica language according to the technological process and thermodynamic principles. Taking a steam circulation system as an example, constructing a basic thermodynamic circulation system comprising components such as a boiler, a superheater, a steam turbine, a generator, a condenser, a pump and the like, and carrying out simulation solution to obtain detailed operation result data. On this basis, by selecting the feature data in the system model as the input data, which becomes the input layer of the neural network, and the observation data, which is the comparison value of the output result of the neural network. Training the model until the error reaches a preset requirement. And then, checking is carried out under another working condition of the selected system simulation, and finally, the generation of a simplified and efficient neural network proxy model is realized. Specifically, the invention generates a refined agent model by selecting system simulation result data to train the neural network. During the training of the model, the system is continually optimized, reducing the error value to achieve the required level of accuracy. Through a continuous iterative optimization process, the invention realizes the efficient and simplified processing of the complex system simulation model, and provides an innovative method for faster and more accurate system simulation calculation.
Drawings
FIG. 1 is a flow chart of a Modelica-based system simulation and neural network proxy model integration method of the present invention.
Fig. 2 is a flowchart of a training model of a method for integrating simulation of a system and a neural network proxy model based on Modelica according to an embodiment of the present invention.
Fig. 3 is an input data diagram of a data set 1 of a system simulation and neural network proxy model integration method based on Modelica according to an embodiment of the present invention.
Fig. 4 is a diagram of output data of a prediction agent model and observation data of a data set 1 of a model-based system simulation and neural network agent model integration method according to an embodiment of the present invention.
Fig. 5 is an error diagram of output data of a prediction agent model and observation data of a data set 1 of a system simulation and neural network agent model integration method based on Modelica according to an embodiment of the present invention.
Fig. 6 is an input data diagram of a data set 2 under a verification condition of a method for integrating a system simulation and a neural network proxy model based on Modelica according to an embodiment of the present invention.
Fig. 7 is a diagram of observation data of a data set 2 and output data of a proxy model under a verification working condition of a system simulation and neural network proxy model integration method based on Modelica according to an embodiment of the present invention.
Detailed Description
In order that the subject matter, technical solutions and advantages of the present invention may be more clearly understood, the present invention will be described in detail below with reference to the accompanying drawings and examples. It should be noted that the following description of the specific embodiments is for the purpose of illustrating the invention only and is not to be construed as limiting the invention. Furthermore, the embodiments of the present invention and the technical features in the embodiments may be combined with each other as long as they do not collide therewith.
The invention relates to a high-efficiency operation method of a coal-fired boiler based on Modelica modeling and genetic algorithm, which mainly comprises the following steps:
step 1, as shown in figure 1, a model of a steam circulation system is established based on a thermal Power library, wherein the model comprises a condensing pump, a steam-water separator, a boiler, a steam pump, a superheater, a steam valve, a steam turbine, a condenser and a generator. The connection mode is as follows: the boiler water supply heating is pumped into a steam-water separator through a steam pump, steam in the steam-water separator is further heated through a heater, then flows through a steam valve for throttling and controlling pressure, then enters a steam turbine for expansion work to generate power for a generator, finally, steam enters a condenser for condensing into water, and then is conveyed to the steam-water separator through a condensing pump to complete circulation.
Step 2, setting simulation time length to be 1 week (168 h), performing simulation solution on a system model by using a Dassl solver, selecting system simulation result data every 1 hour by using a data set 1, taking the heat supply quantity of a boiler, the overheat quantity of a superheater and the water supply quantity of a condensing pump as input data in the data set 1, and taking the generated energy of a generator, the heat exchange quantity of a condenser and the shaft power of a turbine as observation data in the data set 1.
And step 3, carrying out normalization processing on the input data and the observed data, and mapping the input data and the observed data to a (-1, 1) range.
First, find the minimum value of the input data (boiler heat supply, superheater heat supply and water supply of water pump) and the observed data (power generation of generator, heat exchange of condenser and shaft power of turbine) in the data set 1Maximum->Wherein->And->I is the input data dimension, i is the minimum and maximum of the input data, +.>And->J is the dimension of the observed data, which is the minimum value and the maximum value of the observed data; normalization is then performed by the following formula:
wherein,and->Normalized data set for input data and observed data, < >>And (3) withIs input data and observation data.
The parameters required for the neural network are then configured. Each of the input and output data contains 168 values, so the number of samples is 168. The input data includes boiler heat supply, superheater heat supply and water supply to the water pump, so the input dimension is 3. The output data includes generator power generation, condenser heat exchange capacity, and turbine shaft power, and thus the output dimension is 3.
If the learning rate is too high, the model may not converge in the training process, and the update steps of the parameters are too large, so that the weight and the deviation oscillate back and forth in the parameter space, and finally the optimal solution cannot be found; if the learning rate is too low, the step size of the model parameter update is too small, the training process may take a long time to converge to a minimum and may fall into a locally optimal condition, with the learning rate being chosen to be 0.001 in this example. Regarding the number of nodes, if the number of hidden layer nodes is set too high, the model may overfit the training data, i.e., learn the noise and details in the training data, but generalize the new data poorly and result in increased computational complexity. If the number of hidden layer nodes is set too low, the model may not capture the complex pattern of training data, resulting in a less accurate under-fit, so the number of selected nodes is 10 in this example.
Step 4, as shown in fig. 2, training a neural network model is started, and the specific process is as follows:
step (1), firstly determining a relation between a hidden layer and an input layer:
wherein,for hiding the output of the layer->For normalized input data, i.e. +.in step 3>,And->The initial value is set randomly for the weight coefficient.
Step (2), calculating output of an output layer:
wherein,for outputting of the output layer, +.>And->The initial value is set randomly for the weight coefficient.
Step (3), calculating errors of the output layer and the observed data:
wherein,for the total error->For the summation to be fit, if->If the error range is smaller than the expected error range, training is stopped, otherwise, the step (4) is executed.
Step (4), updating the weight coefficient、/>、/>、/>:
The loss function between the input layer and the hidden layer is:
the loss function between the hidden layer and the output layer is:
updating weight coefficients between the input layer and the hidden layer:
wherein rate is the learning rate in step (3);
updating the direct weight coefficient of the hidden layer and the output layer:
after obtaining the new weight coefficient, executing the step (1), and carrying out the loop calculation again until the training is finished when the error between the output result of the model and the observed data of the data set 1 is smaller than the error set value of 0.5. FIG. 5 shows that the error between the output data of the prediction agent model and the observed data of the data set 1 is predicted along with the increase of the training times, and when the training model reaches 17857 times, the error value is 0.49998, the requirement of an error set value is met, and the training is stopped.
And 5, obtaining steam cycle system data under another working condition by using the Modelica system model in the step 1 as a data set 2, checking, inputting the input data of the data set 2 into a prediction proxy model as shown in figure 6, and comparing the output data of the prediction proxy model with the observed data of the data set 2 as shown in figure 7. The errors of its three observations are calculated by the following formula:
wherein,for the number of samples +.>For checking the output value of the proxy model under the working condition, +.>And outputting a value for the simulation result of the Modelica system under the verification working condition. Observation data: the error values of the generated energy of the generator, the heat exchange amount of the condenser and the shaft power of the turbine are respectively as follows: 1.20%,1.18% and 0.95%. The errors are less than 3%, and the proxy model is successfully built.
The method is applied to a steam circulation system, and model simplification and calculation efficiency improvement are realized by analyzing characteristic data and determining the relation between input and output functions. In addition, the establishment of the proxy model in the method can be expanded and applied to other system simulation processes or practical application engineering, and the aim of rapidly establishing a simple model is fulfilled by definitely inputting and outputting data.
According to the invention, a steam circulation system model is established by adopting a thermal power library in Modelica, the heat supply quantity of a boiler, the overheat quantity of a superheater and the water supply quantity of a water pump are used as input data, the generated energy of a generator, the heat exchange quantity of a condenser and the shaft power of a turbine are used as observation data, and a neural network is used for training, so that a simplified and efficient proxy model is successfully obtained. Firstly, characteristic data in a system simulation result is selected as input and observation data of neural network training. After normalization processing, model training is started until a preset error standard is met. And then checking by adopting Modelica simulation result data of another working condition, ensuring that the error of the observed data is less than 3%, and finally generating a high-precision proxy model. The technology realizes the improvement of calculation efficiency, can provide quick feedback in real-time decision, reduces the dependence on traditional complex system simulation software, can accelerate the system design and optimization process and quickly predict the performance of the system under different conditions, and has important engineering application value.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made by 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 protection scope of the present invention.
Claims (5)
1. The Modelica-based system simulation and neural network integration method is characterized by comprising the following steps of:
step S1, a Modelica simulation model of a steam circulation system is built based on a thermal Power library, the model comprises a condensing pump, a steam-water separator, a boiler, a steam pump, a superheater, a steam valve, a steam turbine, a condenser and a generator, firstly, boiler water is heated and pumped into the steam-water separator through the steam pump, after being further heated by the superheater, steam in the steam-water separator flows through a steam valve for throttling and controlling pressure, then enters the steam turbine for expansion work to generate power for the generator, finally, the steam enters the condenser for condensing into water, and is then conveyed to the steam-water separator through the condensing pump to complete circulation;
s2, performing system simulation calculation to obtain characteristic data as a data set 1, wherein the boiler heat supply quantity, the superheater heat quantity and the water supply quantity of a condensing pump in a simulation result are used as input data of the data set 1, and the generating capacity of a generator, the heat exchange quantity of a condenser and the shaft power of a steam turbine are used as observation data of the data set 1;
step S3, carrying out normalization processing on the data set 1, and then setting parameters required by the neural network, wherein the parameters comprise the number of samples, the input dimension, the output dimension, the learning rate and the node number;
s4, training a neural network model, and obtaining a prediction agent model when the error between the model output result and the observed data of the data set 1 is smaller than an error set value;
and S5, obtaining steam circulation system data under another working condition by using the Modelica system model in the step S1 as a data set 2, checking, inputting the input data of the data set 2 into a prediction proxy model, comparing the output data of the prediction proxy model with the observed data of the data set 2, if the error is less than 3%, successfully building the proxy model, otherwise, returning to the step S4, and retraining.
2. The Modelica-based system simulation and neural network integration method according to claim 1, wherein the normalization processing of the data set in the step S3 includes the following specific implementation procedures of input data and observation data:
(1) First find the minimum of the input data and the observed data in the data set 1Maximum->Wherein->And->I is the input data dimension, i is the minimum and maximum of the input data, +.>And->J is the dimension of the observed data, which is the minimum value and the maximum value of the observed data;
(2) Mapping the input data to the observation data between (-1, 1) ranges:
,
,
wherein,and->Normalized data set for input data and observed data, < >>And->Is input data and observation data.
3. The Modelica-based system simulation and neural network integration method according to claim 1, wherein parameters required by the neural network in the step S3 include the number of samples, input dimension, output dimension, learning rate and node number, and are flexibly configured in a custom manner according to specific application requirements so as to achieve model performance.
4. The Modelica-based system simulation and neural network integration method according to claim 1, wherein the training of the neural network model in step S4 is performed as follows:
step (1), firstly determining a relation between a hidden layer and an input layer:
,
wherein,for hiding the output of the layer->For normalized input data, +.>And->Is a weight coefficient;
step (2), calculating output of an output layer:
,
wherein,for outputting of the output layer, +.>And->Is a weight coefficient;
step (3), calculating errors of the output layer and the observed data:
,
,
wherein,for the total error->For the summation to be fit, if->If the error range is smaller than the expected error range, stopping training, otherwise, executing the step (4);
step (4), updating the weight coefficient、/>、/>、/>:
The loss function between the input layer and the hidden layer is:
,
the loss function between the hidden layer and the output layer is:
,
updating weight coefficients between the input layer and the hidden layer:
,
,
wherein rate is the learning rate in step (3);
updating the direct weight coefficient of the hidden layer and the output layer:
,
,
after obtaining the new weight coefficient, executing the step (1), and carrying out the loop calculation again.
5. The Modelica-based system simulation and neural network integration method according to claim 1, wherein the check error value in step S5 is calculated by the following equation:
,
wherein,for the number of samples +.>For checking the output value of the proxy model under the working condition, +.>And outputting a value for the simulation result of the Modelica system under the verification working condition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410285076.7A CN117892635A (en) | 2024-03-13 | 2024-03-13 | Modelica-based system simulation and neural network integration method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410285076.7A CN117892635A (en) | 2024-03-13 | 2024-03-13 | Modelica-based system simulation and neural network integration method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117892635A true CN117892635A (en) | 2024-04-16 |
Family
ID=90642595
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410285076.7A Pending CN117892635A (en) | 2024-03-13 | 2024-03-13 | Modelica-based system simulation and neural network integration method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117892635A (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115796024A (en) * | 2022-11-24 | 2023-03-14 | 京能十堰热电有限公司 | Method for calculating variable working condition energy consumption of cogeneration unit |
-
2024
- 2024-03-13 CN CN202410285076.7A patent/CN117892635A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115796024A (en) * | 2022-11-24 | 2023-03-14 | 京能十堰热电有限公司 | Method for calculating variable working condition energy consumption of cogeneration unit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110941186B (en) | Steam temperature control optimization method based on neural network and universal gravitation search algorithm | |
EP2884059B1 (en) | Multistage HRSG control in combined cycle unit | |
CN115544815B (en) | Method and device for generating fan model | |
JP2020051385A (en) | Method and device for estimating internal state of thermal apparatus | |
US20130054213A1 (en) | Process for adaptive modeling of performance degradation | |
CN113111456B (en) | Online interval identification method for key operation parameters of gas turbine | |
CN117892635A (en) | Modelica-based system simulation and neural network integration method | |
JP2011508346A (en) | Integrated technology analysis process | |
JP2013161480A (en) | Steam turbine performance testing system and method | |
CN106446375A (en) | Method and device for controlling boiler and steam turbine in single machine unit based on data driving | |
CN117852222A (en) | Heat exchange network optimization method integrating organic Rankine cycle | |
US20180239315A1 (en) | Heat recovery steam generator adaptive control | |
Shirakawa et al. | Intelligent multi-objective model predictive control applied to steam turbine start-up | |
CN117216923A (en) | Turboset performance monitoring system, method and terminal based on thermodynamic system simulation | |
CN114491378A (en) | Steam turbine backpressure calculation method based on iteration method and electronic device | |
Hernandez et al. | Nonlinear identification and control of organic rankine cycle systems using sparse polynomial models | |
Li et al. | Operation Data based Modelling and Optimization of Thermal Power Units under Full Working Conditions | |
CN114424196A (en) | Nonlinear model linearization processing method, device and storage medium | |
CN112364552A (en) | High-pressure cylinder dynamic thermal stress analysis method based on finite element | |
CN114424128A (en) | Modeling method and device of nonlinear model and storage medium | |
CN115296335B (en) | Method and device for solving dynamic characteristics of thermal parameters of boiler in primary frequency modulation process | |
Woldemariam et al. | A machine learning based framework for model approximation followed by design optimization for expensive numerical simulation-based optimization problems | |
CN118378497B (en) | Method and device for optimally designing service life of pipeline with weld joint of liquid rocket engine | |
CN115774389B (en) | Fuzzy PID control method | |
CN114034033B (en) | Liquid level control method and terminal for heater of water supply and heat recovery system of thermal power plant |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |