Natural Gas Pipeline Network System Simulation Method, System and Medium Based on Parameter Reconstruction

By constructing a multi-task-physical information neural network model and performing parameter reconstruction, and combining node air pressure and flow constraints for joint training, the accuracy and speed problems of dynamic simulation of natural gas pipeline systems are solved, and high-precision dynamic simulation is achieved.

CN120012334BActive Publication Date: 2025-07-01SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510472423.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-07-01
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately carry out dynamic simulation of natural gas pipeline systems, mainly due to the uncertainty of pipeline structure parameters and the complexity of partial differential equation systems.

Method used

Using a parameter reconstruction method, by constructing a multi-task-physical information neural network model, the strongly coupled partial differential equation system of the natural gas pipeline system is directly modeled, and the data-driven training of the pipeline network is used to complete the reconstruction of partial differential equation parameters, and the joint training is carried out through node air pressure constraints and node flow equilibrium constraints to obtain a multi-neural network combined simulation model.

Benefits of technology

It realizes high-precision dynamic simulation of natural gas pipeline system, and outputs dynamic field distribution in the whole domain including node air pressure and mass flow in real time, solving the problems of inaccurate acquisition of system parameters and low simulation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012334B_ABST
    Figure CN120012334B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of natural gas system control, and specifically provides a simulation method, system and medium for a natural gas pipeline network system based on parameter reconstruction, including: collecting the operation data of each pipeline in the natural gas pipeline network system, and respectively constructing partial differential equation groups for each pipeline; respectively constructing a multi-task-physics-informed neural network model for each pipeline and performing model training to complete the reconstruction of the model parameters and the parameters of the partial differential equation groups; obtaining the air pressure and mass flow at both ends of the pipeline based on the multi-task-physics-informed neural network model, and constructing the node air pressure constraint and node flow balance constraint of the natural gas pipeline network system; performing secondary training on the multi-task-physics-informed neural networks of all pipelines to obtain a multi-neural network combined simulation model, and performing simulation on the natural gas pipeline network system based on the multi-neural network combined simulation model. It realizes high-precision simulation of the natural gas pipeline network system and effectively processes the pipeline network operation data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural gas system control, and particularly relates to a simulation method, system and medium for a natural gas pipeline network system based on parameter reconstruction. Background Art

[0002] In related technologies, the large-scale access of gas turbines as flexible regulation resources has given rise to a new energy architecture of deep coupling between electricity and natural gas, and its energy transmission presents the remarkable characteristics of asynchronous response of heterogeneous energy flows in space and time. While this cross-energy coupling improves the operational flexibility of the system, it also induces multi-physical field coupling effects, resulting in strong non-linearity and high-order characteristics of the system's dynamic characteristics, posing a severe challenge to the coordinated planning and safe operation of the system.

[0003] The current theoretical system of power system dynamic analysis has tended to be perfect. However, due to the complex dynamic processes such as gas compressibility and pipeline gas storage effect in the natural gas network, the maturity of its modeling theory and simulation technology shows significant heterogeneous characteristics. Under this background, in order to better develop and utilize the integrated electricity-gas energy system, it is essential to establish a reliable dynamic model of the natural gas pipeline network system and perform simulation and solution.

[0004] However, in actual engineering, the structural parameters of the natural gas pipeline network often have uncertainties due to reasons such as pipeline aging, corrosion or construction errors. This parameter uncertainty will cause significant deviations between the system model and the actual dynamic response. In addition, since the partial differential equations describing the dynamic characteristics of natural gas pipelines are very complex and have strong spatio-temporal coupling characteristics, the common solution method is to discretize the original partial differential equations in space and time, and then use linearization means to handle the non-linear terms in the equations. However, a large number of intermediate variables are introduced into the equations after discrete processing, resulting in a large amount of calculation and slow solution speed. Moreover, inappropriate spatio-temporal discretization steps and linearization methods will reduce the solution accuracy, thus affecting the fast and accurate simulation of the natural gas pipeline network system. Summary of the Invention

[0005] In view of the above deficiencies of the prior art, the present invention provides a simulation method, system and medium for a natural gas pipeline network system based on parameter reconstruction to solve the above technical problems.

[0006] In a first aspect, the present invention provides a simulation method for a natural gas pipeline network system based on parameter reconstruction, including:

[0007] Collect the operation data of each pipeline in the natural gas pipeline network system. The operation data includes the spatio-temporal coordinates, air pressure and mass flow rate at a specified position of each pipeline, and construct a partial differential equation associated with the operation data for each pipeline based on the air pressure and mass flow rate;

[0008] Construct a multi-task physics-informed neural network model for each pipeline, train the corresponding multi-task physics-informed neural network model based on the operating data and partial differential equations of each pipeline, and complete the reconstruction of the parameters of the multi-task physics-informed neural network model and the partial differential equations during the model training process;

[0009] Obtain the air pressure and mass flow rate at both ends of the pipeline based on the multi-task physics-informed neural network model after parameter reconstruction, and construct the node air pressure constraint and node flow balance constraint of the natural gas pipeline network system based on the air pressure and mass flow rate at both ends of the pipeline;

[0010] Perform secondary training on the multi-task physics-informed neural networks of all pipelines based on the node air pressure constraint and node flow balance constraint combined with the joint training method to obtain a multi-neural network combined simulation model, and perform simulation of the natural gas pipeline network system based on the multi-neural network combined simulation model.

[0011] In an alternative embodiment, constructing the partial differential equations for each pipeline based on the air pressure and mass flow rate specifically includes:

[0012]

[0013] where represents the spatial coordinate, represents the time coordinate, represents the air pressure, represents the mass flow rate, represents the speed of sound in the air flow, represents the cross-sectional area of the pipeline, represents the pipeline diameter, represents the friction coefficient of the pipeline inner wall.

[0014] In an alternative embodiment, before constructing the multi-task physics-informed neural network model, perform non-dimensionalization processing on the operating data and partial differential equations of each pipeline, specifically including:

[0015] Introduce characteristic scales and convert all operating data into non-dimensional form:

[0016]

[0017] where , T , , represent the selected characteristic length, characteristic time, characteristic air pressure, and characteristic mass flow rate respectively; x *, t *, p *, m * represent the relative values corresponding to the spatial coordinate, time coordinate, air pressure, and mass flow rate respectively;

[0018] The partial differential equation system is transformed into a dimensionless form according to the introduced characteristic scale:

[0019] 。

[0020] In an alternative embodiment, the multi-task physics-informed neural network model includes two parallel neural networks, which together constitute a feature extraction layer, a shared layer, and a multi-task learning layer. A soft parameter sharing mechanism is adopted, and the changes in air pressure and mass flow are respectively fitted by the two parallel neural networks;

[0021] During the model training process, the feature extraction layer receives spatio-temporal coordinates and extracts the distribution features of the coordinates, and then conveys the feature vectors to the shared layer. Information fusion is achieved through the interaction between the two neural networks in the shared layer, and the air pressure and mass flow at both ends of the pipeline are output by the model;

[0022] A loss function is constructed based on the output air pressure, mass flow, and the parameters of the partial differential equation system, and the loss value between the air pressure and mass flow at both ends of the pipeline obtained from the model and the actual air pressure and mass flow at both ends of the pipeline is calculated based on the loss function. The neural network model parameters and the partial differential equation system parameters are updated using the gradient descent method through the optimization solvers Adam and L-BFGS;

[0023] After the model training is completed, the reconstruction of the neural network model parameters and the partial differential equation system parameters is completed.

[0024] In an alternative embodiment, during the training of the multi-task physics-informed neural network model, the loss function is constructed as follows:

[0025]

[0026]

[0027]

[0028]

[0029] Wherein, and represent the air pressure and mass flow data sets; and represent the air pressure and mass flow output by the multi-task physics-informed neural network; and represent the collocation points of the partial differential equation constraints and the boundary condition collocation points; and represent the partial differential equation operator and the boundary condition operator respectively; Represent the model parameters of the neural network, including the weights and biases of neurons in each layer; Represent the unknown parameters in the partial differential equation (parameters to be identified). The entire loss function Is divided into three parts, and added according to the weights Add up. Represents the data loss term, which is obtained by calculating the mean square error from the known operating data and the model prediction data; Represents the partial differential equation residual loss term, which calculates the mismatch by substituting the model prediction value into the partial differential equation; Represents the boundary condition loss term, which is obtained by calculating the mean square error using the data points on the boundary.

[0030] In an alternative embodiment, the construction of the node pressure constraint and node flow balance constraint of the natural gas pipeline network system includes:

[0031] For the gas source nodes in the natural gas pipeline network system, since the gas source pressure is known and constant, the node pressure constraint that the pressure at the input port of the pipeline connected to the gas source is equal to the gas source pressure is satisfied;

[0032] For the end nodes in the natural gas pipeline network system, which are connected to the natural gas load, the node flow balance constraint that the sum of the mass flows at the output ports of the pipelines connected to the end nodes is equal to the natural gas load at the end nodes can be obtained from the known load;

[0033] For the general nodes in the natural gas pipeline network system, which connect the input and output ports of multiple pipelines and there is a natural gas load, therefore, for the general nodes, the node pressure constraint that the pressures at the pipeline ports connected to the node are equal and the node flow balance constraint that the natural gas inflow and outflow at the node are in real-time balance need to be satisfied.

[0034] In an alternative embodiment, the secondary training of the multi-task physical information neural network for all pipelines includes:

[0035] Before the joint training, for the multi-task physical information neural network model of each pipeline, adopt the hierarchical parameter freezing strategy to freeze the weights and bias parameters of all hidden layers except the output layer;

[0036] During the joint training, after the forward propagation of the input operating data and the partial differential equation system, the predicted pressures and mass flows at both ends of the pipeline are obtained;

[0037] Construct a loss function based on the node air pressure constraint and the node flow balance constraint, calculate the loss value between the predicted air pressure and mass flow rate at both ends of the pipeline and the actual air pressure and mass flow rate at both ends of the pipeline based on the loss function, perform backpropagation based on the loss value, calculate the gradient of the output layer parameters, and update the output layer parameters based on the Adam optimizer according to the set initial learning rate.

[0038] In an alternative embodiment, constructing a loss function based on the node air pressure constraint and the node flow balance constraint specifically includes:

[0039]

[0040]

[0041] Among them, are the loss functions corresponding to the air pressure constraint of the gas source node, the flow balance constraint of the end node, the air pressure constraint of the general node, and the flow balance constraint of the general node respectively, 、 、 、 are the selected weight coefficients, represents the total number of time steps in the time series, i represents the time step index, represents the set of gas sources, represents the set of natural gas pipelines connected to the gas source , represents the air pressure at the gas source , represents the air pressure at the input port of the pipeline at time , represents the set of natural gas loads at the end node, represents the set of natural gas pipelines connected to the natural gas load , represents the natural gas load at the natural gas load at time , represents the mass flow rate at the output port of the pipeline at time ,J represents the set of general nodes in the natural gas pipeline network system, and respectively represent the sets of pipelines connecting the input port and the output port to the general node , represents the air pressure at the input port of the pipeline at time , represents the air pressure at the output port of the pipeline at time , represent the mass flow rate at the input port of the pipeline at the moment represent the natural gas load at the moment the natural gas load at , represent the set of natural gas loads at general nodes.

[0042] In a second aspect, the present invention provides a simulation system for a natural gas pipeline network based on parameter reconstruction. When the system is implemented, the above-mentioned simulation method for a natural gas pipeline network based on parameter reconstruction is executed. The system includes:

[0043] A data acquisition and processing module that acquires the operation data of each pipeline in the natural gas pipeline network system. The operation data includes the spatio-temporal coordinates, air pressure, and mass flow rate at specified positions of each pipeline. Based on the air pressure and mass flow rate, a partial differential equation system associated with the operation data is constructed for each pipeline;

[0044] A pipeline model training module that constructs a multi-task physics-informed neural network model for each pipeline respectively, trains the corresponding multi-task physics-informed neural network model based on the operation data and partial differential equation system of each pipeline, and completes the reconstruction of the parameters of the multi-task physics-informed neural network model and the parameters of the partial differential equation system during the model training process;

[0045] A constraint condition construction module that obtains the air pressure and mass flow rate at both ends of the pipeline based on the multi-task physics-informed neural network model after parameter reconstruction, and constructs the node air pressure constraint and node flow balance constraint of the natural gas pipeline network system based on the air pressure and mass flow rate at both ends of the pipeline;

[0046] A joint model training and simulation module that performs secondary training on the multi-task physics-informed neural networks of all pipelines based on the node air pressure constraint and node flow balance constraint in combination with the joint training method to obtain a multi-neural network combined simulation model, and performs simulation on the natural gas pipeline network system based on the multi-neural network combined simulation model.

[0047] In a third aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium, and when it runs on a computer, the computer is caused to execute the methods described in the above aspects.

[0048] ​The beneficial effects of the present invention are as follows. The simulation method, system and medium of the natural gas pipeline network system based on parameter reconstruction provided by the present invention directly model the continuous spatio-temporal dynamic characteristics of the strongly coupled partial differential equations of the natural gas pipeline network system by constructing a multi-task physics-informed neural network, and use the pipeline operation data to drive the training to complete the parameter reconstruction of the partial differential equations while maintaining the physical constraints of the equations. Then, the model realizes the joint training of multiple neural networks through the constraints of the natural gas pipeline network, and a high-precision dynamic simulation system can be constructed only by adjusting a small number of core parameters, and the global dynamic field distribution including node air pressure and mass flow can be output in real time to realize the dynamic simulation of the natural gas pipeline network system.

[0049] In addition, the design principle of the present invention is reliable, the structure is simple, and it has a very wide application prospect. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0051] Figure 1 is a schematic flowchart of the simulation method of the natural gas pipeline network system based on parameter reconstruction according to an embodiment of the present invention.

[0052] Figure 2 is a schematic block diagram of the simulation system of the natural gas pipeline network system based on parameter reconstruction according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.

[0055] The simulation method of the natural gas pipeline network system based on parameter reconstruction provided by the embodiments of the present invention is executed by a computer device. Correspondingly, the simulation system of the natural gas pipeline network system based on parameter reconstruction runs in the computer device.

[0056] Figure 1 is a schematic flowchart of a simulation method for a natural gas pipeline network system based on parameter reconstruction according to an embodiment of the present invention. Among them, Figure 1 The execution subject can be a simulation system for a natural gas pipeline network system based on parameter reconstruction. According to different requirements, the order of steps in this flowchart can be changed, and some can be omitted.

[0057] As Figure 1 shown, this method includes:

[0058] Step S1, collect the operation data of each pipeline in the natural gas pipeline network system. The operation data includes the spatio-temporal coordinates, air pressure, and mass flow rate at specified positions of each pipeline. Based on the air pressure and mass flow rate, construct a partial differential equation system associated with the operation data for each pipeline;

[0059] Install sensors at the specified positions of each pipeline in the natural gas pipeline network system to collect spatio-temporal coordinates, air pressure, and mass flow rate data in real time. Through professional data analysis software, according to the variation characteristics and physical principles of air pressure and mass flow rate, construct a corresponding partial differential equation system for each pipeline. Obtain the operation data of the natural gas pipeline network comprehensively and accurately, providing a reliable basis for subsequent in-depth analysis of the pipeline network operation status. The constructed partial differential equation system can describe the changes inside the pipeline from the level of physical laws, helping to accurately understand and grasp the flow characteristics of natural gas in the pipeline.

[0060] Step S2, construct a multi-task physics-informed neural network model for each pipeline respectively. Train the corresponding multi-task physics-informed neural network model based on the operation data and partial differential equation system of each pipeline, and complete the reconstruction of the parameters of the multi-task physics-informed neural network model and the parameters of the partial differential equation system during the model training process;

[0061] For each pipeline, use a deep learning framework to build a multi-task physics-informed neural network model. Take the operation data collected in Step S1 as input, combine the constructed partial differential equation system, and continuously adjust the neural network model parameters and partial differential equation system parameters during the training process with the help of an optimization algorithm to achieve parameter reconstruction. Enable the neural network model to fully learn the features in the pipeline operation data, and at the same time integrate physical laws to improve the accuracy and generalization ability of the model. Parameter reconstruction can make the model better adapt to the characteristics of different pipelines, providing a more effective tool for the simulation and prediction of the pipeline network system.

[0062] Step S3, obtain the air pressure and mass flow rate at both ends of the pipeline based on the multi-task physics-informed neural network model after parameter reconstruction, and construct the node air pressure constraint and node flow balance constraint of the natural gas pipeline network system based on the air pressure and mass flow rate at both ends of the pipeline;

[0063] Apply the trained multi-task physics-informed neural network model to each pipeline to obtain the air pressure and mass flow data at both ends of the pipeline. Based on the topological structure and physical connection relationship of the natural gas pipeline network system, construct node air pressure constraints and node flow balance constraints based on this data. Clarify the operating rules and limiting conditions at the nodes in the natural gas pipeline network system to provide a constraint basis for the stable operation and analysis of the pipeline network system.

[0064] Step S4, based on the node air pressure constraints and node flow balance constraints, combine the joint training method to perform secondary training on the multi-task physics-informed neural networks of all pipelines to obtain a multi-neural network combined simulation model, and perform natural gas pipeline network system simulation based on the multi-neural network combined simulation model.

[0065] Integrate the node air pressure constraints and node flow balance constraints constructed in step S3 into the joint training method, perform secondary training on the multi-task physics-informed neural networks of all pipelines to obtain a multi-neural network combined simulation model. Use this model to input relevant parameters to simulate and analyze the natural gas pipeline network system. Through secondary training, integrate each pipeline model so that the combined model can better reflect the operating state of the entire natural gas pipeline network system.

[0066] Optionally, as an embodiment of the present invention, collect the operating data of each pipeline in the natural gas system (including the spatio-temporal coordinates, air pressure, and mass flow at various locations of the pipeline at each time period), and process the data.

[0067] For the gas flow dynamics in the pipeline, a general assumption is used for simplification, and a partial differential equation model of the natural gas pipeline described by the air pressure p(x, t) and mass flow m(x, t) can be obtained:

[0068]

[0069] Among them, and represent spatio-temporal coordinates, and respectively represent air pressure and mass flow, represents the speed of sound in the gas flow, represents the cross-sectional area of the pipeline, represents the pipeline diameter, represents the friction coefficient of the pipeline inner wall.

[0070] Each pipeline can be described by the partial differential equation shown in formula (1). Therefore, it is necessary to collect data for each pipeline separately and train its corresponding neural network model. For each pipeline, collect the operating data at various locations of the pipeline at each time period to obtain a series of discrete grid data points , where and Represents the spatio-temporal coordinates of the sampled data points in the pipeline, where , and represent the air pressure and mass flow rate corresponding to the sampled data points in the pipeline .

[0071] Optionally, as an embodiment of the present invention, before model training, since the pipeline operation data collected by actual measurement is equidistant in time and space and the data volume is limited, in order to obtain enough asynchronous data for the training of the neural network, bilinear interpolation is performed on the grid data sampled from each pipeline (because the gas flow dynamics in the pipeline is slow, using linear interpolation has little impact on the accuracy).

[0072] During the process of training the physics-informed neural network, in order to avoid gradient explosion, improve the training convergence speed, and prevent the normalization from making the relationship between data lose physical meaning, it is necessary to perform non-dimensionalization processing on the data and partial differential equations:

[0073] 1) Introduce characteristic scales to convert all variable data into dimensionless relative values:

[0074]

[0075] where , T , , represent the selected characteristic length, characteristic time, characteristic air pressure, and characteristic mass flow rate respectively; x *, t *, p *, m * represent the relative values corresponding to the spatial coordinate, time coordinate, air pressure, and mass flow rate respectively.

[0076] 2) According to the introduced characteristic scales, the partial differential equation system can also be converted into a dimensionless form:

[0077]

[0078] Through bilinear interpolation and non-dimensionalization processing, the training data set of each pipeline can be obtained Combined with the non-dimensionalized partial differential equations, the neural network surrogate model corresponding to each pipeline can be trained.

[0079] Step 2: Construct a multi-task physics-informed neural network, train the neural network model corresponding to each pipeline, and identify the parameters of the pipeline partial differential equation system.

[0080] Optionally, as an embodiment of the present invention, due to the different parameters of different pipelines, a separate multi-task - physical information neural network is established for each pipeline to fit the partial differential equation system of the pipeline. The architecture of its multi-task learning is used to capture the trajectories of the air pressure p and the mass flow rate m evolving over time and space, avoiding the non-convergence of the training of the physical information neural network caused by the different spatio-temporal characteristics of the air pressure and the mass flow rate.

[0081] The multi-task - physical information neural network model includes two parallel neural networks. The two neural networks together constitute a feature extraction layer, a shared layer, and a multi-task learning layer. The soft parameter sharing mechanism is adopted, and the changes of the air pressure and the mass flow rate are respectively fitted through the two parallel neural networks. The feature extraction layer receives spatio-temporal coordinates and extracts the distribution features of the coordinates, and then conveys the feature vectors to the shared layer. The information fusion is realized through the interaction between the two neural networks in the shared layer. The two neural networks in the feature extraction layer and the multi-task learning layer are parallel. The shared layer for each task can be expressed as:

[0082]

[0083] Wherein, is the output vector of the feature extraction layer network corresponding to task , is the output vector of the shared layer network corresponding to task , (·) represents the operator connecting multiple vectors, and represent the weights and biases of the shared layer network corresponding to task , represents the activation function of the shared layer network. The output vectors of the shared layer are respectively input into the parallel neural networks in the multi-task learning layer to generate the values of the air pressure and the mass flow rate.

[0084] In order to enable the trained neural network model to identify the relevant parameters of the partial differential equation system, the partial differential equation system and its boundary conditions need to be incorporated into the loss function to guide the training of the neural network. The partial differential terms can be realized through the automatic differentiation characteristics of the neural network. The loss function of the multi-task - physical information neural network is constructed as follows:

[0085] (5)

[0086] (6)

[0087] (7)

[0088] (8)

[0089] Wherein, and Denote the air pressure and mass flow rate datasets; and Denote the air pressure and mass flow rate predicted by the multi-task physics-informed neural network; and Denote the collocation points of the partial differential equation constraints and the boundary condition collocation points; and Denote the partial differential equation operator and the boundary condition operator respectively; Denote the model parameters of the neural network, including the weights and biases of the neurons in each layer; Denote the unknown parameters in the partial differential equation (parameters to be identified). The entire loss function Is divided into three parts and added according to the weights Together. Denote the data loss term, which is calculated by the mean square error of the known operating data and the model prediction data; Denote the partial differential equation residual loss term, which calculates the mismatch by substituting the model prediction value into the partial differential equation; Denote the boundary condition loss term, which is calculated by the mean square error using the data points on the boundary.

[0090] Use the constructed loss function To train the multi-task physics-informed neural network. Use the gradient descent method to update the parameters of the neural network through the optimization solvers Adam and L-BFGS Until the loss function decreases to a small enough value To complete the training. And As the unknown parameter in the partial differential equation, is regarded as a learnable parameter like And will be updated together when updating the parameter Until the training is completed, the final partial differential equation system parameters Can be obtained, that is, the parameter reconstruction of the partial differential equation system is completed. *

[0091] Optionally, as an embodiment of the present invention, the multi-task physics-informed neural network corresponding to pipeline l can be expressed as:

[0092] (9)

[0093] Wherein, and Denote the air pressure and mass flow rate distributions of pipeline , Denote the multi-task physics-informed neural network corresponding to pipeline , and Represent spatial coordinates and temporal coordinates, Represent a pipeline The corresponding trained multi-task physics-informed neural network parameters, Represent a pipeline The corresponding partial differential equation system parameters.

[0094] In step 2, the trained multi-task physics-informed neural network can not only identify the unknown parameters of the partial differential equation system but also perform real-time simulation of the pipeline dynamics described by the partial differential equation system because the partial differential equation system and boundary conditions are incorporated into the loss function.

[0095] To perform dynamic simulation of the natural gas system, not only the partial differential equation system of the natural gas pipeline needs to be satisfied, but also the network constraints of the natural gas system need to be introduced to ensure that the state variables of each pipeline conform to the dynamic operation of the system. Therefore, the node pressure constraints and node flow balance constraints of the natural gas network are used to jointly train the multi-task physics-informed neural network of all pipelines.

[0096] During the joint training process, the multi-task physics-informed neural network of each pipeline is used as a prediction unit. Through these prediction units, the state variables at both ends of each pipeline can be predicted in real time, and then the training is carried out in combination with the pipeline network constraints. The specific execution process is as follows:

[0097] 1) By inputting the spatio-temporal coordinates of the input and output ports of the pipeline into the corresponding prediction unit, the air pressure and mass flow rate at both ends of the pipeline in real time are obtained:

[0098] (10)

[0099] (11)

[0100] Among them, 0 represents the spatial coordinate of the input port of the pipeline; Represents the pipeline Length, that is, the pipeline Spatial coordinate of the output port; Represents any moment to be predicted, that is, the temporal coordinate; Represents the moment Pipeline Air pressure and mass flow rate at the input port; Represents the moment Pipeline Air pressure and mass flow rate at the output port.

[0101] 2) Construct the node pressure constraints and node flow balance constraints of the natural gas system:

[0102] A. For the gas source nodes in the natural gas system, since the gas source pressure is known and constant, the following node pressure constraints are satisfied:

[0103] (12)

[0104] Among them, represents the set of gas sources; represents the set of natural gas pipelines connected to the gas source ; represents the gas source . The pressure at the input port of the pipeline connected to the gas source is equal to the gas source pressure.

[0105] B. For the end nodes in the natural gas system, which are connected to the natural gas load, the following node flow balance constraints can be obtained from the known load:

[0106] (13)

[0107] Among them, represents the set of natural gas loads at the end nodes; represents the set of natural gas pipelines connected to the natural gas load ; represents the moment the natural gas load . The sum of the mass flows at the output ports of the pipelines connected to the end nodes is equal to the natural gas load at the end nodes.

[0108] C. For the general nodes in the natural gas system, which connect the input and output ports of multiple pipelines and often have natural gas loads, for the following node pressure constraints and node flow balance constraints need to be satisfied:

[0109]

[0110] (15)

[0111] Among them, J represents the set of general nodes in the natural gas system; and respectively represent the sets of pipelines whose input and output ports are connected to the node ; represents the set of natural gas loads at the general nodes; represents the pressure at the input port of the pipeline , represents the pressure at the output port of the pipeline . Equation (14) represents the connection with the node The air pressures at the connected pipe ports are equal; Equation (15) represents the node where the real-time balance of the natural gas inflow and outflow.

[0112] Optionally, as an embodiment of the present invention, the secondary training of the multi-task physical information neural network for all pipelines includes:

[0113] Before the joint training, for the multi-task physical information neural network model of each pipeline, a hierarchical parameter freezing strategy is adopted to freeze the weights and bias parameters of all hidden layers except the output layer. During the joint training, by keeping the weights and biases of the feedforward network structure unchanged and only dynamically optimizing the connection weights and biases of the output layer, while maintaining the strong constraint conditions of the pipeline partial differential equations, a high-precision fitting of the linear constraint relationship of the pipe network is achieved;

[0114] During the joint training, after the input operation data and the partial differential equations are propagated forward, the predicted air pressures and mass flows at both ends of the pipeline are obtained;

[0115] Based on the node air pressure constraint and the node flow balance constraint, a loss function is constructed. Based on the loss function, the loss value between the predicted air pressures and mass flows at both ends of the pipeline and the actual air pressures and mass flows at both ends of the pipeline is calculated. Based on the loss value, backpropagation is performed to calculate the gradient of the output layer parameters, and the output layer parameters are updated based on the Adam optimizer according to the set initial learning rate. Among them, the initial learning rate of the Adam optimizer is set to order of magnitude to suppress the gradient amplitude during the parameter update process and ensure that the numerical solution always conforms to the constraints of the pipeline partial differential equations. Based on this optimizer, a joint update strategy of network parameters is implemented to achieve the collaborative learning of the physical constraints and data characteristics of the pipe network under the premise of satisfying the Lipschitz continuity.

[0116] Optionally, as an embodiment of the present invention, constructing a loss function based on the node air pressure constraint and the node flow balance constraint specifically includes:

[0117]

[0118]

[0119] Among them, are the loss functions corresponding to the air pressure constraint of the gas source node, the flow balance constraint of the end node, the air pressure constraint of the general node, and the flow balance constraint of the general node respectively, , , , are the selected weight coefficients, represents the total number of time steps in the time series, and i represents the time step index, Represents the set of gas sources, Represents the set of natural gas pipelines connected to the gas sources, Represents the gas pressure at the gas source, Represents the gas pressure at the input port of the pipeline at time Represents the set of natural gas loads at the end nodes, Represents the set of natural gas pipelines connected to the natural gas loads, Represents the amount of natural gas load at the natural gas load at time Represents the mass flow rate at the output port of the pipeline at time and respectively represent the sets of pipelines connected to the input port and the output port to the general node, Represents the gas pressure at the input port of the pipeline at time Represents the gas pressure at the output port of the pipeline at time Represents the mass flow rate at the input port of the pipeline at time Represents the amount of natural gas load at the natural gas load at time , Represents the set of natural gas loads at the general nodes.

[0120] After the above steps, a pipeline partial differential equation parameter reconstruction model with excellent generalization performance can be constructed. The combined model of multiple neural networks trained jointly has high-efficiency simulation ability, can accurately analyze the dynamic characteristics of the natural gas system, and output the key state parameters (gas pressure, mass flow rate) of each node in the pipeline network in real time.

[0121] In summary, a multi-task physics-informed neural network model is constructed. By combining the characteristics of the multi-task learning architecture and the physics-informed network, the fitting of the partial differential equation system of the natural gas pipeline is realized, and the parameters of the partial differential equation are accurately identified in a data-driven manner, solving the problem of inaccurate acquisition of system parameters. In addition, the present invention also fuses the neural network surrogate models of multiple pipelines through joint training, and updates a small number of neural network parameters by using a hierarchical parameter freezing strategy and a method of restricting the learning rate of the optimizer, thereby obtaining a combined multi-neural network model to realize the real-time dynamic simulation of the natural gas system.

[0122] In some embodiments, the simulation system of the natural gas pipeline network based on parameter reconstruction may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the simulation system of the natural gas pipeline network based on parameter reconstruction can be stored in the memory of the computer device and executed by at least one processor to execute (see details in Figure 1 the description) the functions of the simulation of the natural gas pipeline network based on parameter reconstruction.

[0123] In this embodiment, according to the functions it executes, the simulation system of the natural gas pipeline network based on parameter reconstruction can be divided into multiple functional modules, such as Figure 2 shown. The functional modules of the system may include: a data acquisition and processing module, a pipeline model training module, a constraint condition construction module, and a joint model training and simulation module. The module referred to in the present invention means a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in the memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments. The system includes:

[0124] The data acquisition and processing module collects the operation data of each pipeline in the natural gas pipeline network. The operation data includes the spatio-temporal coordinates, air pressure, and mass flow rate at specified positions of each pipeline, and constructs a partial differential equation system associated with the operation data for each pipeline based on the air pressure and mass flow rate;

[0125] The pipeline model training module constructs a multi-task physics-informed neural network model for each pipeline respectively, trains the corresponding multi-task physics-informed neural network model based on the operation data and partial differential equation system of each pipeline, and completes the reconstruction of the parameters of the multi-task physics-informed neural network model and the parameters of the partial differential equation system during the model training process;

[0126] The constraint condition construction module obtains the air pressure and mass flow rate at both ends of the pipeline based on the multi-task physics-informed neural network model after parameter reconstruction, and constructs the node air pressure constraint and node flow balance constraint of the natural gas pipeline network based on the air pressure and mass flow rate at both ends of the pipeline;

[0127] The combined model training and simulation module performs secondary training on the multi-task physical information neural networks of all pipelines based on the node air pressure constraint and the node flow balance constraint combined with the combined training method to obtain a multi-neural network combined simulation model, and performs natural gas pipeline network system simulation based on the multi-neural network combined simulation model.

[0128] The data acquisition and processing module obtains the operation data of the natural gas pipeline network and constructs a partial differential equation system. The pipeline model training module constructs and trains the neural network models of each pipeline and reconstructs the parameters. The constraint condition construction module constructs node constraints based on the data obtained by the neural network. The combined model training and simulation module performs secondary training to obtain a combined simulation model, which can achieve high-precision simulation of the natural gas pipeline network system, effectively process the operation data of the pipeline network, and improve the accuracy and reliability of the model by combining physical laws and neural networks.

[0129] The present invention also provides a computer storage medium, wherein the computer storage medium can store a program, and when the program is executed, it can include some or all of the steps in the various embodiments provided by the present invention. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0130] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution in the embodiments of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program codes, and includes several instructions to enable a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0131] For the same or similar parts among the various embodiments in this specification, reference can be made to each other. In particular, for the terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the description in the method embodiments.

[0132] In several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of systems or modules can be in electrical, mechanical or other forms.

[0133] The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0134] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing module, or each module can exist physically alone, or two or more modules can be integrated in one module.

[0135] Although the present invention has been described in detail by referring to the drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, those of ordinary skill in the art can make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions should all be within the scope of the present invention. / Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, and they should all be covered within the protection scope of the present invention.

Claims

1. A natural gas pipeline network system simulation method based on parameter reconstruction, characterized in that: The following steps are involved: Collect the operation data of each pipeline in the natural gas pipeline network system, the operation data includes the time and space coordinates, air pressure and mass flow of the specified position of each pipeline, and construct a group of partial differential equations associated with the operation data for each pipeline based on the air pressure and mass flow; A multi-task-physical information neural network model is constructed for each pipeline, and the corresponding multi-task-physical information neural network model is trained based on the operation data and partial differential equation group of each pipeline, and the multi-task-physical information neural network model parameters and partial differential equation group parameters are reconstructed during the model training process; Among them, the multi-task-physical information neural network model includes two parallel neural networks, which together constitute a feature extraction layer, a sharing layer, and a multi-task learning layer. A soft parameter sharing mechanism is adopted to fit the changes of air pressure and mass flow through two parallel neural networks respectively. During the model training process, the feature extraction layer receives the spatiotemporal coordinates and extracts the distribution characteristics of the coordinates, and then transmits the feature vector to the sharing layer. The information fusion is realized through the interaction between the two neural networks in the sharing layer, and the model outputs the air pressure and mass flow at both ends of the pipeline. A loss function is constructed based on the output air pressure, mass flow and partial differential equation group parameters, and the loss value between the air pressure and mass flow at both ends of the pipeline and the actual air pressure and mass flow at both ends of the pipeline is calculated based on the loss function, and the neural network model parameters and partial differential equation group parameters are updated using the gradient descent method through the optimization solver Adam and L-BFGS. After the model training is completed, the reconstruction of the neural network model parameters and partial differential equation group parameters is completed. The gas pressure and mass flow at both ends of the pipeline are obtained based on the multi-task-physical information neural network model after parameter reconstruction, and the node gas pressure constraint and node flow balance constraint of the natural gas pipeline network system are constructed based on the gas pressure and mass flow at both ends of the pipeline. Based on the node gas pressure constraints and node flow balance constraints combined with the joint training method, the multi-task-physical information neural network of all pipelines is trained twice to obtain a multi-neural network combined simulation model, and the natural gas pipeline system simulation is carried out based on the multi-neural network combined simulation model.

2. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 1 is characterized in that: The partial differential equations for each pipeline are constructed based on air pressure and mass flow, including: in, represents the spatial coordinates, represents the time coordinate, Indicates air pressure, represents the mass flow rate, is the speed of sound in the airflow, represents the cross-sectional area of ​​the pipe, Indicates the pipe diameter, Represents the friction coefficient of the inner wall of the pipe.

3. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 2 is characterized in that: Before the multi-task-physical information neural network model is constructed, the operating data and partial differential equations of each pipeline are dimensionlessly processed, including: Introducing the characteristic scale, all running data are converted to dimensionless form: in, , T , , They represent the selected characteristic length, characteristic time, characteristic pressure, and characteristic mass flow rate respectively; x *, t *, p *, m *Represents the relative values ​​of space coordinates, time coordinates, air pressure, and mass flow rate respectively; The partial differential equations are transformed into dimensionless form according to the introduced characteristic scale: 。 4. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 1 is characterized in that: In the training of the multi-task-physical information neural network model, the loss function is constructed as follows: in, and represents the air pressure and mass flow data set; and Represents the gas pressure and mass flow rate output by the multi-task-physical information neural network; and Collocation points representing partial differential equation constraints and boundary condition collocation points; and denote the partial differential equation operator and the boundary condition operator respectively; Represents the model parameters of the neural network, including the weights and biases of each layer of neurons; represents the unknown parameters in the partial differential equation, the entire loss function Divided into three parts, according to weight Add, represents the data loss term, which is obtained by calculating the mean square error between the known operating data and the model prediction data; represents the residual loss term of the partial differential equation, which is the mismatch calculated by substituting the model prediction value into the partial differential equation; Represents the boundary condition loss term, which is obtained by calculating the mean square error using the data points on the boundary.

5. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 1 is characterized in that: The node pressure constraints and node flow balance constraints for building a natural gas pipeline network system include: For the gas source node in the natural gas pipeline network system, since the gas source pressure is known and constant, the node pressure constraint that the gas pressure at the input port of the pipeline connected to the gas source is equal to the gas source pressure is satisfied; For the terminal node in the natural gas pipeline network system, which is connected to the natural gas load, the sum of the mass flow rates of the output ports of the pipelines connected to the terminal node can be obtained from the known load amount, which is equal to the node flow balance constraint of the natural gas load at the terminal node; For general nodes in the natural gas pipeline network system, they are connected to the input ports and output ports of multiple pipelines and there is natural gas load. Therefore, for general nodes, it is necessary to satisfy the node gas pressure constraint that the gas pressure at the pipeline port connected to the node is equal and the node flow balance constraint that the natural gas inflow and outflow at the node are balanced in real time.

6. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 5 is characterized in that: Secondary training of multi-task-physics-informed neural networks for all pipelines includes: Before joint training, a layered parameter freezing strategy is adopted for the multi-task-physical information neural network model of each pipeline to freeze the weights and bias parameters of all hidden layers except the output layer; In the joint training, the input operation data and the partial differential equations are forward propagated to obtain the predicted gas pressure and mass flow at both ends of the pipeline; A loss function is constructed based on the node air pressure constraint and the node flow balance constraint. The loss value between the predicted air pressure and mass flow at both ends of the pipeline and the actual air pressure and mass flow at both ends of the pipeline is calculated based on the loss function. Backpropagation is performed based on the loss value to calculate the gradient of the output layer parameters. The output layer parameters are updated based on the Adam optimizer according to the set initial learning rate.

7. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 6 is characterized in that: The loss function constructed based on the node pressure constraint and the node flow balance constraint specifically includes: in, They are the loss functions corresponding to the gas source node pressure constraint, the terminal node flow balance constraint, the general node node pressure constraint, and the general node node flow balance constraint, , , , is the selected weight coefficient, represents the total number of time steps in the time series, i represents the time step index, represents the collection of gas sources, Indication and gas source A collection of interconnected natural gas pipelines, Indicates gas source The air pressure at express Moment Pipeline The air pressure at the input port, represents the set of natural gas loads at the end nodes, Indicates natural gas load A collection of interconnected natural gas pipelines, express Natural gas load at the moment The natural gas load at express Moment Pipeline The mass flow rate at the output port, J represents the set of general nodes in the natural gas pipeline network system, and Represents input ports, output ports and general nodes respectively A collection of connected pipes, express Moment Pipeline The air pressure at the input port, express Moment Pipeline The air pressure at the output port, express Moment Pipeline The mass flow rate at the input port, express Natural gas load at the moment The natural gas load at , Represents the collection of natural gas loads at a general node.

8. A natural gas pipeline network system simulation system based on parameter reconstruction, characterized in that: When the system is implemented, the natural gas pipeline network system simulation method based on parameter reconstruction according to any one of claims 1 to 7 is executed, and the system includes: The data acquisition and processing module collects the operation data of each pipeline in the natural gas pipeline network system. The operation data includes the time and space coordinates, air pressure and mass flow of the specified position of each pipeline. Based on the air pressure and mass flow, a group of partial differential equations associated with the operation data is constructed for each pipeline respectively; The pipeline model training module builds a multi-task-physical information neural network model for each pipeline, trains the corresponding multi-task-physical information neural network model based on the operation data and partial differential equation group of each pipeline, and completes the reconstruction of the multi-task-physical information neural network model parameters and partial differential equation group parameters during the model training process; Among them, the multi-task-physical information neural network model includes two parallel neural networks, which together constitute a feature extraction layer, a sharing layer, and a multi-task learning layer. A soft parameter sharing mechanism is adopted to fit the changes of air pressure and mass flow through two parallel neural networks respectively. During the model training process, the feature extraction layer receives the spatiotemporal coordinates and extracts the distribution characteristics of the coordinates, and then transmits the feature vector to the sharing layer. The information fusion is realized through the interaction between the two neural networks in the sharing layer, and the model outputs the air pressure and mass flow at both ends of the pipeline. A loss function is constructed based on the output air pressure, mass flow and partial differential equation group parameters, and the loss value between the air pressure and mass flow at both ends of the pipeline and the actual air pressure and mass flow at both ends of the pipeline is calculated based on the loss function, and the neural network model parameters and partial differential equation group parameters are updated using the gradient descent method through the optimization solver Adam and L-BFGS. After the model training is completed, the reconstruction of the neural network model parameters and partial differential equation group parameters is completed. The constraint condition construction module obtains the gas pressure and mass flow at both ends of the pipeline based on the multi-task-physical information neural network model after parameter reconstruction, and constructs the node gas pressure constraint and node flow balance constraint of the natural gas pipeline network system based on the gas pressure and mass flow at both ends of the pipeline; The joint model training simulation module performs secondary training on the multi-task-physical information neural network of all pipelines based on the node gas pressure constraints and node flow balance constraints combined with the joint training method to obtain a multi-neural network combined simulation model, and simulates the natural gas pipeline system based on the multi-neural network combined simulation model.

9. A computer-readable storage medium, characterized in that: The readable storage medium stores a natural gas pipeline system simulation program based on parameter reconstruction, and when the natural gas pipeline system simulation program based on parameter reconstruction is executed by the processor, the steps of the natural gas pipeline system simulation method based on parameter reconstruction as described in any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Solving method and system for dynamic simulation of natural gas transmission pipe network system

    CN115688340A

  • Natural gas network system model construction method and parameter identification method

    CN116561939A