CN117892635A - System Simulation and Neural Network Integration Method Based on Modelica - Google Patents

System Simulation and Neural Network Integration Method Based on Modelica Download PDF

Info

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
modelica
neural network
model
steam
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
Application number
CN202410285076.7A
Other languages
Chinese (zh)
Inventor
潘利
徐爱国
钱剑杰
夏飞鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Yuansi Intelligent Technology Co ltd
Original Assignee
Nanjing Yuansi Intelligent Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing Yuansi Intelligent Technology Co ltd filed Critical Nanjing Yuansi Intelligent Technology Co ltd
Priority to CN202410285076.7A priority Critical patent/CN117892635A/en
Publication of CN117892635A publication Critical patent/CN117892635A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning 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

本发明公开了一种基于Modelica的系统仿真与神经网络集成方法,通过运用Modelica语言构建精确的系统仿真模型,获取关键运行数据,借助Python实施神经网络训练关键运行数据,形成能够准确反映实际系统运行状态的简洁高效代理模型,实现了代理模型能够直接用于快速评估系统的功能,减少对复杂Modelica模型的直接依赖,提高计算效率,尤其是在需要频繁运行或进行快速评估的场景中,提供了一种既准确又高效的系统仿真和分析方法,这对于工程设计、系统优化以及决策支持等方面具有重要的实际应用价值。

The present invention discloses a method for integrating system simulation and neural network based on Modelica. The method uses the Modelica language to construct an accurate system simulation model, obtains key operation data, and uses Python to implement neural network training of key operation data to form a concise and efficient proxy model that can accurately reflect the actual system operation status. The proxy model can be directly used for the function of quickly evaluating the system, reduces the direct dependence on complex Modelica models, and improves computing efficiency. In particular, in scenarios that require frequent operation or rapid evaluation, an accurate and efficient system simulation and analysis method is provided, which has important practical application value for engineering design, system optimization, and decision support.

Description

基于Modelica的系统仿真与神经网络集成方法System Simulation and Neural Network Integration Method Based on Modelica

技术领域Technical Field

本发明涉及到神经网络代理模型集成领域,尤其涉于一种基于Modelica的系统仿真与神经网络代理模型集成方法。The invention relates to the field of neural network proxy model integration, and in particular to a method for integrating system simulation and neural network proxy model based on Modelica.

背景技术Background technique

Modelica是一种被广泛应用于描述和分析动态系统物理行为的建模和仿真语言。然而,随着系统模型复杂性的提升,一些模型可能包含成千上万的变量和方程。在这种情况下,传统的仿真方法可能会面临计算资源和时间的挑战,特别是在需要进行大规模参数优化或需要实时决策的场景中。这些挑战可能导致仿真过程的低效性,限制了对系统行为深入理解和优化的可能性。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, traditional simulation methods may face challenges in computing resources and time, especially in scenarios where large-scale parameter optimization or real-time decision-making is required. These challenges may lead to inefficiencies in the simulation process and limit the possibility of in-depth understanding and optimization of system behavior.

而神经网络代理模型作为一种机器学习技术,具有在大规模数据中学习模型的能力,可用于加速复杂系统的仿真过程。因此,将Modelica仿真模型与神经网络代理模型相结合,能够在保持准确性的同时提高仿真效率,特别是在需要频繁进行模型预测和优化的场景中。通过结合Modelica的物理建模能力和神经网络的数据学习能力,可以更好地应对复杂系统建模和优化的挑战,提高工程设计和决策的效率。As a machine learning technology, the neural network proxy model has the ability to learn models in large-scale data and can be used to accelerate the simulation process of complex systems. Therefore, combining the Modelica simulation model with the neural network proxy model can improve simulation efficiency while maintaining accuracy, especially in scenarios where frequent model prediction and optimization are required. By combining the physical modeling capabilities of Modelica and the data learning capabilities of neural networks, we can better cope with the challenges of complex system modeling and optimization and improve the efficiency of engineering design and decision-making.

发明内容Summary of the invention

本发明提出了一种基于Modelica的系统仿真与神经网络代理模型集成方法。该方法通过借助Modelica系统仿真的运行结果数据,构建神经网络代理模型,在提高仿真效率的同时,也为模型简化和优化提供了强有力的工具,为复杂系统的深入理解和高效设计带来了新的可能性。The present invention proposes a method for integrating system simulation and neural network proxy model based on Modelica. The method constructs a neural network proxy model by using the operation result data of Modelica system simulation, which not only improves the simulation efficiency, but also provides a powerful tool for model simplification and optimization, bringing new possibilities for in-depth understanding and efficient design of complex systems.

一种基于Modelica的系统仿真与神经网络代理模型集成方法,包括如下步骤:A method for integrating system simulation and neural network agent model based on Modelica comprises the following steps:

步骤S1、基于ThermalPower库建立蒸汽循环系统的Modelica仿真模型,模型包含冷凝泵、汽水分离器、锅炉、汽水泵、过热器、蒸汽阀、汽轮机、冷凝器与发电机。首先,锅炉给水加热经过汽水泵抽取到汽水分离器中,汽水分离器中的水蒸气经过热器进一步加热后,流经蒸汽阀节流控压,然后进入汽轮机扩张做功给发电机发电。最后,蒸汽进入冷凝器冷凝为水,再由冷凝泵输送到汽水分离器,完成循环。Step S1, build a Modelica simulation model of the steam cycle system based on the ThermalPower library. The model includes a condensate pump, a steam-water separator, a boiler, a steam-water pump, a superheater, a steam valve, a steam turbine, a condenser and a generator. First, the boiler feed water is heated and pumped into the steam-water separator by the steam-water pump. The water vapor in the steam-water separator is further heated by the superheater, flows through the steam valve for throttling and pressure control, and then enters the steam turbine to expand and generate electricity for the generator. Finally, the steam enters the condenser and condenses into water, which is then transported to the steam-water separator by the condensate pump to complete the cycle.

步骤S2、进行系统仿真计算,获取特征数据作为数据集1,仿真结果中的锅炉供热量、过热器过热量与冷凝泵的给水量作为数据集1的输入数据,发电机的发电量、冷凝器的换热量与汽轮机的轴功率作为数据集1的观测数据。Step S2, perform system simulation calculations, obtain characteristic data as data set 1, the boiler heating capacity, superheater superheat and condenser pump feed water volume in the simulation results are used as input data of data set 1, and the generator power generation, condenser heat exchange and turbine shaft power are used as observation data of data set 1.

步骤S3、将数据集1进行归一化处理,然后设置神经网络所需要的参数,包括样本数量、输入维度、输出维度、学习率与节点数;Step S3, normalize the data set 1, and then set the parameters required by the neural network, including the number of samples, input dimension, output dimension, learning rate and number of nodes;

步骤S4、训练神经网络模型,当模型输出结果与数据集1的观测数据误差小于误差设定值时,获得预测代理模型。Step S4, training the neural network model, when the error between the model output result and the observed data of data set 1 is less than the error setting value, the prediction agent model is obtained.

步骤S5、利用步骤S1中的Modelica系统模型得到另一工况下的蒸汽循环系统数据作为数据集2,进行校验,将数据集2的输入数据输入到预测代理模型中,将预测代理模型的输出数据与数据集2的观测数据进行比较。如果误差小于3%,则成功建立代理模型;否则返回步骤S4,重新训练。Step S5: Use the Modelica system model in step S1 to obtain steam cycle system data under another working condition as data set 2 for verification, input the input data of data set 2 into the prediction proxy model, and compare the output data of the prediction proxy model with the observed data of data set 2. If the error is less than 3%, the proxy model is successfully established; otherwise, return to step S4 and retrain.

总而言之,本发明首先根据工艺流程与热力学原理,利用Modelica语言搭建物理系统模型。以蒸汽循环系统为例,构建包括锅炉、过热器、汽轮机、发电机、冷凝器以及泵等组件的基本热力循环系统,进行仿真求解,得到详实的运行结果数据。在这个基础上,通过选择系统模型中的特征数据作为输入数据与观测数据,其中输入数据成为神经网络的输入层,观测数据为神经网络的输出结果的比较值。通过对模型进行训练,直至误差达到预定要求。此后,在选取系统仿真的另一个工况进行校验,最终实现了一个简化而高效的神经网络代理模型的生成。具体而言,本发明通过选取系统仿真结果数据进行神经网络训练,生成了一个精炼的代理模型。在训练模型的过程中,系统不断优化,减小误差值以达到所需的准确度水平。通过持续的迭代优化过程,本发明实现了对复杂系统仿真模型的高效简化处理,为更快速、更准确地为系统仿真计算提供了一种创新性的方法。In summary, the present invention first uses the Modelica language to build a physical system model based on the process flow and thermodynamic principles. Taking the steam cycle system as an example, a basic thermodynamic cycle system including components such as a boiler, a superheater, a steam turbine, a generator, a condenser, and a pump is constructed, and simulation is performed to obtain detailed operation result data. On this basis, by selecting the characteristic data in the system model as input data and observation data, the input data becomes the input layer of the neural network, and the observation data is the comparison value of the output result of the neural network. The model is trained until the error reaches the predetermined requirement. Thereafter, another operating condition of the system simulation is selected for verification, and finally a simplified and efficient neural network proxy model is generated. Specifically, the present invention generates a refined proxy model by selecting the system simulation result data for neural network training. In the process of training the model, the system is continuously optimized to reduce the error value to achieve the required accuracy level. Through the continuous iterative optimization process, the present invention realizes the efficient simplification of complex system simulation models, and provides an innovative method for faster and more accurate system simulation calculations.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本发明一种基于Modelica的系统仿真与神经网络代理模型集成方法的流程图。FIG1 is a flow chart of a method for integrating system simulation and neural network proxy model based on Modelica according to the present invention.

图2是本发明实施例提供的一种基于Modelica的系统仿真与神经网络代理模型集成方法的训练模型流程图。FIG2 is a flow chart of a training model of a method for integrating a system simulation and a neural network proxy model based on Modelica provided in an embodiment of the present invention.

图3是本发明实施例提供的一种基于Modelica的系统仿真与神经网络代理模型集成方法的数据集1的输入数据图。FIG3 is an input data diagram of a data set 1 of a method for integrating system simulation and a neural network proxy model based on Modelica provided in an embodiment of the present invention.

图4是本发明实施例提供的一种基于Modelica的系统仿真与神经网络代理模型集成方法的预测代理模型输出数据与数据集1的观测数据图。FIG. 4 is a diagram showing output data of a prediction proxy model and observation data of a data set 1 in a method for integrating a system simulation and a neural network proxy model based on Modelica provided by an embodiment of the present invention.

图5是本发明实施例提供的一种基于Modelica的系统仿真与神经网络代理模型集成方法的预测代理模型输出数据与数据集1观测数据的误差图。5 is an error diagram of the output data of the prediction proxy model and the observation data of data set 1 of a method for integrating system simulation and neural network proxy model based on Modelica provided by an embodiment of the present invention.

图6是本发明实施例提供的一种基于Modelica的系统仿真与神经网络代理模型集成方法的校验工况下数据集2的输入数据图。FIG6 is an input data diagram of data set 2 under verification conditions of a method for integrating system simulation and neural network proxy model based on Modelica provided in an embodiment of the present invention.

图7是本发明实施例提供的一种基于Modelica的系统仿真与神经网络代理模型集成方法的校验工况下数据集2的观测数据与代理模型的输出数据图。7 is a diagram of the observed data of data set 2 and the output data of the proxy model under the verification condition of a method for integrating system simulation and neural network proxy model based on Modelica provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了更清楚地了解本发明的主题、技术方案和优点,下文将结合附图和实施例详细地描述本发明。需要注意的是,下文描述的具体实施例只是为了解释本发明,而不是限定于本发明。此外,本发明的实施例与实施例中的技术特征可以相互结合,只要它们不与之产生冲突即可。In order to more clearly understand the subject, technical solutions and advantages of the present invention, the present invention will be described in detail below in conjunction with the accompanying drawings and embodiments. It should be noted that the specific embodiments described below are only for explaining the present invention, but are not limited to the present invention. In addition, the embodiments of the present invention and the technical features in the embodiments can be combined with each other as long as they do not conflict with each other.

本发明的一种基于Modelica建模和遗传算法的燃煤锅炉高效运行方法主要包括如下流程:The present invention provides a coal-fired boiler efficient operation method based on Modelica modeling and genetic algorithm, which mainly includes the following process:

步骤1、如附图1所示,基于ThermalPower库建立蒸汽循环系统的Modelica仿真模型,模型包含冷凝泵、汽水分离器、锅炉、汽水泵、过热器、蒸汽阀、汽轮机、冷凝器与发电机。连接方式为:锅炉给水加热经过汽水泵抽取到汽水分离器中,汽水分离器中的水蒸气经过热器进一步加热后,流经蒸汽阀节流控压,然后进入汽轮机扩张做功给发电机发电,最后,蒸汽进入冷凝器冷凝为水,再由冷凝泵输送到汽水分离器,完成循环。Step 1, as shown in Figure 1, a Modelica simulation model of a steam cycle system is established based on the ThermalPower library. The model includes a condenser pump, a steam-water separator, a boiler, a steam-water pump, a superheater, a steam valve, a steam turbine, a condenser, and a generator. The connection method is: the boiler feed water is heated and pumped into the steam-water separator through a steam-water pump. The water vapor in the steam-water separator is further heated by the superheater, flows through the steam valve for throttling and pressure control, and then enters the steam turbine to expand and generate electricity for the generator. Finally, the steam enters the condenser and condenses into water, which is then transported to the steam-water separator by the condenser pump to complete the cycle.

步骤2、仿真时长设置为1周时间(168h),步长为1h,利用Dassl求解器对系统模型进行仿真求解,数据集1每隔1个小时选取系统仿真结果数据,锅炉供热量、过热器过热量与冷凝泵的给水量作为数据集1中的输入数据,发电机的发电量、冷凝器的换热量与涡轮的轴功率作为数据集1中的观测数据。Step 2: The simulation duration is set to 1 week (168 hours) with a step length of 1 hour. The system model is simulated and solved using the Dassl solver. Data set 1 selects system simulation result data every hour. The boiler heating supply, superheater superheat and condensing pump feed water volume are used as input data in data set 1. The generator power generation, condenser heat exchange and turbine shaft power are used as observation data in data set 1.

步骤3、将输入数据与观测数据进行归一化处理,将输入数据与观测数据映射到(-1,1)范围之间。Step 3: Normalize the input data and the observed data, and map the input data and the observed data to the range of (-1, 1).

首先寻找到数据集1中的输入数据(锅炉供热量、过热器过热量与水泵的给水量)与观测数据(发电机的发电量、冷凝器的换热量与涡轮的轴功率)的最小值和最大值/>,其中/>与/>为输入数据的最小值和最大值,i为输入数据维度,/>与/>为观测数据的最小值和最大值,j为观测数据维度;然后由以下公式进行归一化:First, find the minimum value of the input data (boiler heat supply, superheater superheat and water pump feed) and the observed data (generator power generation, condenser heat exchange and turbine shaft power) in data set 1. and maximum value/> , where/> With/> is the minimum and maximum value of the input data, i is the input data dimension, /> With/> is the minimum and maximum value of the observed data, j is the dimension of the observed data; then it is normalized by the following formula:

其中,与/>为输入数据与观测数据归一化后的数据集,/>为输入数据与观测数据。in, With/> is the data set after the input data and observation data are normalized,/> and are the input data and the observed data.

然后配置神经网络所需的参数。每个输入和输出数据均包含168个值,因此样本数量为168。输入数据包括锅炉供热量、过热器过热量和水泵给水量,因此输入维度为3。输出数据包括发电机发电量、冷凝器换热量和涡轮轴功率,因此输出维度为3。Then configure the parameters required by the neural network. Each input and output data contains 168 values, so the number of samples is 168. The input data includes boiler heat supply, superheater superheat, and water pump feed water, so the input dimension is 3. The output data includes generator power generation, condenser heat exchange, and turbine shaft power, so the output dimension is 3.

如果学习率过高,模型可能在训练过程中无法收敛,参数的更新步伐太大,导致权重和偏差在参数空间中来回振荡,最终无法找到最优解;如果学习率太低,模型参数更新的步长太小,训练过程可能需要很长时间才能收敛到最小值并且可能陷入局部最优情况,本例选择学习率为0.001。关于节点数,如果隐藏层节点数设置得过高,模型可能会过度拟合训练数据,即学到了训练数据中的噪声和细节,但对新数据的泛化性能较差并导致计算复杂度增加。而如果隐藏层节点数设置得过低,模型可能无法捕捉到训练数据的复杂模式,导致欠拟合,准确的较差,因此本例选择节点数为10。If the learning rate is too high, the model may not converge during the training process, and the update step of the parameters is too large, causing the weights and biases to oscillate back and forth in the parameter space, and ultimately failing to find the optimal solution; if the learning rate is too low, the step size of the model parameter update is too small, and the training process may take a long time to converge to the minimum value and may fall into a local optimal situation. In this example, the learning rate is selected as 0.001. Regarding the number of nodes, if the number of hidden layer nodes is set too high, the model may overfit the training data, that is, it learns the noise and details in the training data, but the generalization performance of new data is poor and the computational complexity increases. If the number of hidden layer nodes is set too low, the model may not be able to capture the complex patterns of the training data, resulting in underfitting and poor accuracy. Therefore, the number of nodes is selected as 10 in this example.

步骤4、如附图2所示,开始训练神经网络模型,具体过程如下:Step 4: As shown in FIG. 2, start training the neural network model. The specific process is as follows:

步骤(1)、首先确定隐藏层与输入层的关系式:Step (1), first determine the relationship between the hidden layer and the input layer:

其中,为隐藏层的输出,/>为标准化后的输入数据,即步骤3中的/>与/>为权重系数,初始值随机设定。in, is the output of the hidden layer, /> is the standardized input data, i.e., the one in step 3/> , With/> is the weight coefficient, and the initial value is set randomly.

步骤(2)、计算输出层的输出:Step (2), calculate the output of the output layer:

其中,为输出层的输出,/>与/>为权重系数,初始值随机设定。in, is the output of the output layer, /> With/> is the weight coefficient, and the initial value is set randomly.

步骤(3)、计算输出层与观测数据误差:Step (3), calculate the error between the output layer and the observed data:

其中,为总体误差,/>为求和计算符合,如果/>小于期望误差范围,则停止训练,否则执行步骤(4)。in, is the overall error, /> To calculate the sum, if /> If the error is smaller than the expected range, stop training; otherwise, execute step (4).

步骤(4)、更新权重系数、/>、/>、/>Step (4), update 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:

更新输入层与隐藏层之间的权重系数:Update the weight coefficients between the input layer and the hidden layer:

其中,rate为步骤(3)中的学习率;Where rate is the learning rate in step (3);

更新隐藏层与输出层直接的权重系数:Update the weight coefficients of the hidden layer and the output layer:

得到新的权重系数后,执行步骤(1),重新进行循环计算,直到当模型的输出结果与数据集1观测数据误差小于误差设定值0.5时,训练结束。附图5为随着训练次数的增加预测代理模型输出数据与数据集1观测数据的误差,当训练模型达到17857次数时,误差值为0.49998,满足误差设定值要求,停止训练。After obtaining the new weight coefficient, execute step (1) and repeat the calculation until the error between the output of the model and the observed data of data set 1 is less than the error setting value of 0.5, and the training ends. Figure 5 shows the error between the output data of the predicted proxy model and the observed data of data set 1 as the number of training times increases. When the training model reaches 17857 times, the error value is 0.49998, which meets the error setting value requirement, and the training stops.

步骤5、利用步骤1中的Modelica系统模型得到另一工况下的蒸汽循环系统数据作为数据集2,进行校验,数据集2的输入数据如附图6所示,将输入数据输入到预测代理模型中,预测代理模型的输出数据与数据集2的观测数据进行比较,如附图7所示。其三个观测数据的误差由以下公式计算:Step 5: Use the Modelica system model in step 1 to obtain steam cycle system data under another working condition as data set 2 for verification. The input data of data set 2 is shown in Figure 6. The input data is input into the prediction agent model. The output data of the prediction agent model is compared with the observation data of data set 2, as shown in Figure 7. The errors of the three observation data are calculated by the following formula:

其中,为样本数量,/>为校验工况下代理模型输出值,/>为校验工况下Modelica系统仿真结果输出值。观测数据:发电机的发电量、冷凝器的换热量与涡轮的轴功率的三者误差值分别为:1.20%,1.18%与0.95%。误差均小于3%,成功建立代理模型。in, is the sample size, /> Output value of the proxy model under the verification condition, /> The output value of the simulation result of the Modelica system under the verification condition. Observation data: The error values of the power generation of the generator, the heat exchange of the condenser and the shaft power of the turbine are 1.20%, 1.18% and 0.95% respectively. The errors are all less than 3%, and the proxy model is successfully established.

该方法在蒸汽循环系统中的应用,通过分析特征数据并确定输入与输出函数关系,实现了模型简化和计算效率提升。此外,该方法中的代理模型的建立,也可以拓展应用到其他系统仿真过程或者实际应用工程中,通过明确输入与输出数据,实现快速建立简约模型的目标。The application of this method in the steam cycle system can simplify the model and improve the calculation efficiency by analyzing the characteristic data and determining the input and output function relationship. In addition, the establishment of the proxy model in this method can also be extended to other system simulation processes or practical application projects, and the goal of quickly establishing a simple model can be achieved by clarifying the input and output data.

本发明通过采用Modelica中的ThermalPower库建立蒸汽循环系统模型,以锅炉供热量、过热器过热量与水泵的给水量作为输入数据,发电机的发电量、冷凝器的换热量与涡轮的轴功率作为观测数据,运用神经网络训练,成功得到一个简化而高效的代理模型。首先,选取系统仿真结果中的特征数据作为神经网络训练的输入与观测数据。在进行归一化处理后,启动模型训练,直至满足预设误差标准。然后采用另一个工况的Modelica仿真结果数据进行校核,确保观测数据的误差小于3%,最终生成高精度的代理模型。该技术实现了计算效率的提升,并且能够在实时决策中提供快速反馈,减少了对传统复杂系统仿真软件的依赖,能够加速系统设计和优化过程以及快速预测在不同条件下系统的表现性能,具有重要的工程应用价值。The present invention establishes a steam cycle system model by using the ThermalPower library in Modelica, takes the boiler heat supply, superheat of the superheater and the water supply of the water pump as input data, the power generation of the generator, the heat exchange of the condenser and the shaft power of the turbine as observation data, and uses neural network training to successfully obtain a simplified and efficient proxy model. First, the characteristic data in the system simulation results are selected as the input and observation data for neural network training. After normalization, the model training is started until the preset error standard is met. Then the Modelica simulation result data of another working condition is used for verification to ensure that the error of the observation data is less than 3%, and finally a high-precision proxy model is generated. This technology achieves an improvement in computing efficiency, and can provide fast feedback in real-time decision-making, reducing dependence on traditional complex system simulation software, accelerating the system design and optimization process, and quickly predicting the performance of the system under different conditions, and has important engineering application value.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims (5)

1.一种基于Modelica的系统仿真与神经网络集成方法,其特征在于包括以下步骤:1. A system simulation and neural network integration method based on Modelica, characterized by comprising the following steps: 步骤S1、基于ThermalPower库建立蒸汽循环系统的Modelica仿真模型,模型包含冷凝泵、汽水分离器、锅炉、汽水泵、过热器、蒸汽阀、汽轮机、冷凝器与发电机,首先,锅炉给水加热经过汽水泵抽取到汽水分离器中,汽水分离器中的水蒸气经过热器进一步加热后,流经蒸汽阀节流控压,然后进入汽轮机扩张做功给发电机发电,最后,蒸汽进入冷凝器冷凝为水,再由冷凝泵输送到汽水分离器,完成循环;Step S1, based on the ThermalPower library, a Modelica simulation model of a steam cycle system is established. The model includes a condensate pump, a steam-water separator, a boiler, a steam-water pump, a superheater, a steam valve, a steam turbine, a condenser and a generator. First, the boiler feed water is heated and pumped into the steam-water separator through a steam-water pump. The water vapor in the steam-water separator is further heated by the superheater, flows through the steam valve for throttling and pressure control, and then enters the steam turbine for expansion to generate electricity for the generator. Finally, the steam enters the condenser and condenses into water, which is then transported to the steam-water separator by the condensate pump to complete the cycle. 步骤S2、进行系统仿真计算,获取特征数据作为数据集1,仿真结果中的锅炉供热量、过热器过热量与冷凝泵的给水量作为数据集1的输入数据,发电机的发电量、冷凝器的换热量与汽轮机的轴功率作为数据集1的观测数据;Step S2, perform system simulation calculation, obtain characteristic data as data set 1, the boiler heat supply, superheat of superheater and water supply of condenser pump in the simulation result are used as input data of data set 1, the power generation of generator, heat exchange capacity of condenser and shaft power of steam turbine are used as observation data of data set 1; 步骤S3、将数据集1进行归一化处理,然后设置神经网络所需要的参数,包括样本数量、输入维度、输出维度、学习率与节点数;Step S3, normalize the data set 1, and then set the parameters required by the neural network, including the number of samples, input dimension, output dimension, learning rate and number of nodes; 步骤S4、训练神经网络模型,当模型输出结果与数据集1的观测数据误差小于误差设定值时,获得预测代理模型;Step S4, training the neural network model, when the error between the model output result and the observed data of data set 1 is less than the error setting value, obtaining the prediction agent model; 步骤S5、利用步骤S1中的Modelica系统模型得到另一工况下的蒸汽循环系统数据作为数据集2,进行校验,将数据集2的输入数据输入到预测代理模型中,将预测代理模型的输出数据与数据集2的观测数据进行比较,如果误差小于3%,则成功建立代理模型;否则返回步骤S4,重新训练。Step S5, using the Modelica system model in step S1 to obtain the steam cycle system data under another working condition as data set 2, and verify it, input the input data of data set 2 into the prediction proxy model, and compare the output data of the prediction proxy model with the observation data of data set 2. If the error is less than 3%, the proxy model is successfully established; otherwise, return to step S4 and retrain. 2.根据权利要求1所述的基于Modelica的系统仿真与神经网络集成方法,其特征在于,所述步骤S3中的将数据集进行归一化处理,包括输入数据与观测数据,其归一化具体实现的过程如下:2. The method for system simulation and neural network integration based on Modelica according to claim 1 is characterized in that the data set in step S3 is normalized, including input data and observation data, and the specific implementation process of the normalization is as follows: (1)、首先寻找到数据集1中的输入数据与观测数据的最小值和最大值/>,其中/>与/>为输入数据的最小值和最大值,i为输入数据维度,/>与/>为观测数据的最小值和最大值,j为观测数据维度;(1) First, find the minimum value of the input data and the observed data in data set 1 and maximum value/> , where/> With/> is the minimum and maximum value of the input data, i is the input data dimension, /> With/> is the minimum and maximum value of the observed data, j is the dimension of the observed data; (2)、将输入数据与观测数据映射到(-1,1)范围之间:(2) Map the input data and observation data to the range of (-1, 1): , , 其中,与/>为输入数据与观测数据归一化后的数据集,/>与/>为输入数据与观测数据。in, With/> is the data set after the input data and observation data are normalized,/> With/> are the input data and the observed data. 3.根据权利要求1所述的基于Modelica的系统仿真与神经网络集成方法,其特征在于,所述步骤S3中的神经网络所需的参数,包括样本数量、输入维度、输出维度、学习率与节点数,根据具体应用需求进行灵活的自定义配置,以达到模型性能。3. The method for system simulation and neural network integration based on Modelica according to claim 1 is characterized in that the parameters required for the neural network in step S3, including the number of samples, input dimension, output dimension, learning rate and number of nodes, are flexibly customized according to specific application requirements to achieve model performance. 4.根据权利要求1所述的基于Modelica的系统仿真与神经网络集成方法,其特征在于,所述步骤S4中的训练神经网络模型的具体过程如下:4. The method for system simulation and neural network integration based on Modelica according to claim 1, characterized in that the specific process of training the neural network model in step S4 is as follows: 步骤(1)、首先确定隐藏层与输入层的关系式:Step (1), first determine the relationship between the hidden layer and the input layer: , 其中,为隐藏层的输出,/>为标准化后的输入数据,/>与/>为权重系数;in, is the output of the hidden layer, /> is the standardized input data, /> With/> is the weight coefficient; 步骤(2)、计算输出层的输出:Step (2), calculate the output of the output layer: , 其中,为输出层的输出,/>与/>为权重系数;in, is the output of the output layer, /> With/> is the weight coefficient; 步骤(3)、计算输出层与观测数据误差:Step (3), calculate the error between the output layer and the observed data: , , 其中,为总体误差,/>为求和计算符合,如果/>小于期望误差范围,则停止训练,否则执行步骤(4);in, is the overall error, /> To calculate the sum, if /> If the error is less than the expected error range, stop training, otherwise execute step (4); 步骤(4)、更新权重系数、/>、/>、/>Step (4), update 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: , 更新输入层与隐藏层之间的权重系数:Update the weight coefficients between the input layer and the hidden layer: , , 其中,rate为步骤(3)中的学习率;Where rate is the learning rate in step (3); 更新隐藏层与输出层直接的权重系数:Update the weight coefficients of the hidden layer and the output layer: , , 得到新的权重系数后,执行步骤(1),重新进行循环计算。After obtaining the new weight coefficient, execute step (1) and repeat the cycle calculation again. 5.根据权利要求1所述的基于Modelica的系统仿真与神经网络集成方法,其特征在于,所述步骤S5中的校验误差值由以下方程进行计算:5. The method for system simulation and neural network integration based on Modelica according to claim 1, wherein the calibration error value in step S5 is calculated by the following equation: , 其中,为样本数量,/>为校验工况下代理模型输出值,/>为校验工况下Modelica系统仿真结果输出值。in, is the sample size, /> Output value of the proxy model under the verification condition, /> It is the output value of the simulation result of Modelica system under the verification condition.
CN202410285076.7A 2024-03-13 2024-03-13 System Simulation and Neural Network Integration Method Based on Modelica Pending CN117892635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410285076.7A CN117892635A (en) 2024-03-13 2024-03-13 System Simulation and Neural Network Integration Method Based on Modelica

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410285076.7A CN117892635A (en) 2024-03-13 2024-03-13 System Simulation and Neural Network Integration Method Based on Modelica

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 System Simulation and Neural Network Integration Method Based on Modelica

Country Status (1)

Country Link
CN (1) CN117892635A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119808611A (en) * 2025-03-17 2025-04-11 中汽数据(天津)有限公司 Modelica proxy model generation method, device and medium

Citations (1)

* Cited by examiner, † Cited by third party
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

Patent Citations (1)

* Cited by examiner, † Cited by third party
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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119808611A (en) * 2025-03-17 2025-04-11 中汽数据(天津)有限公司 Modelica proxy model generation method, device and medium

Similar Documents

Publication Publication Date Title
CN111581189B (en) Completion method and completion device for air quality detection data loss
Song et al. Distributed collaborative probabilistic design of multi-failure structure with fluid-structure interaction using fuzzy neural network of regression
CN117892635A (en) System Simulation and Neural Network Integration Method Based on Modelica
CN111142381B (en) Control-oriented NCB type steam turbine heating system composite dynamic modeling method
US20150159518A1 (en) Multistage hrsg control in a combined cycle unit
Pires et al. Response surface method applied to the thermoeconomic optimization of a complex cogeneration system modeled in a process simulator
RU2621422C2 (en) System and method for steam turbine parameter testing
CN117932960A (en) Agent model-based aero-engine overall performance multi-objective optimization method
CN113867294A (en) Data processing method and device, storage medium and electronic device
CN119005091A (en) Intelligent design system and design method for analog integrated circuit
CN119578272A (en) Comprehensive energy system polymorphic simulation method, system, equipment and medium
Rovira et al. A new methodology to solve non‐linear equation systems using genetic algorithms. Application to combined cyclegas turbine simulation
Jiang et al. ECMFGN: extended conditional mapping feature generation network for severe few-shot fault diagnosis of chillers
Chaibakhsh Modelling and long-term simulation of a heat recovery steam generator
Wang et al. Real-time stress field reconstruction method using online monitoring parameters for thick-walled power plant components based on gappy proper orthogonal decomposition
CN116932992A (en) Data processing method based on nonlinear multi-delay feedback kernel least mean square algorithm
CN111985681B (en) Data prediction method, model training method, device and equipment
CN103970653A (en) Sensor network software accessibility verification method
CN114491378A (en) A method and electronic device for calculating back pressure of steam turbine based on iterative method
CN119644768B (en) Neural network control method of heat exchange module
CN115296335B (en) Method and device for solving dynamic characteristics of thermal parameters of boiler in primary frequency modulation process
CN118856361A (en) A method for generating a combustion furnace air distribution scheme and a related device
CN111832799A (en) A method and system for optimizing performance of energy-saving retrofit of coal-fired generating units
Yudhanto et al. Performance optimization of gas turbine generator based on operating conditions using ANN-GA at Saka Indonesia Pangkah Ltd
CN118381128A (en) Primary frequency modulation simulation analysis method and device for thermal power generating unit

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20240416

RJ01 Rejection of invention patent application after publication