Natural gas pipeline network system simulation method and system based on parameter reconstruction and medium
Through a method based on parameter reconstruction, a multi-task-physical information neural network model is constructed and combined with node constraints for joint training, the problems of parameter uncertainty and low computing efficiency in the natural gas pipeline system are solved, and high-precision dynamic simulation is achieved.
Patent Information
- Application Number
- CN202510472423.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-16
AI Technical Summary
The prior art is difficult to effectively solve the problem of model and actual dynamic response deviation caused by parameter uncertainty in natural gas pipeline systems. The common solution methods are large in calculation and slow in speed, and the selection of space-time discrete walk length and linearization method will affect the accuracy of the simulation.
The natural gas pipeline system simulation method based on parameter reconstruction is adopted, and partial differential equations are constructed by collecting pipeline operation data, a multi-task-physical information neural network model is established, and parameters are reconstructed during the model training process, combining node air pressure constraints and node flow balance constraints for joint training to obtain a multi-neural network combined simulation model.
It realizes high-precision dynamic simulation of natural gas pipeline system, and outputs the entire domain dynamic field distribution including node air pressure and mass flow in real time, solving the problems of parameter uncertainty and low computing efficiency. It has reliable design principles, simple structure and wide application prospects.
Smart Images

Figure CN120012334A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural gas system control, and in particular relates to a natural gas pipeline network system simulation method, system and medium based on parameter reconstruction. Background Art
[0002] In related technologies, the large-scale access of gas units as flexible adjustment resources has given rise to a new energy architecture with deep coupling of electricity and natural gas, and its energy transmission presents the significant characteristics of asynchronous response of heterogeneous energy flows in time and space. While this cross-energy coupling improves the flexibility of system operation, it also induces multi-physical field coupling effects, resulting in strong nonlinear and high-order characteristics in the system dynamic characteristics, posing severe challenges to system collaborative planning and safe operation.
[0003] The current theoretical system of dynamic analysis of power systems has been perfected, but the natural gas network is limited by complex dynamic processes such as gas compressibility and pipeline gas storage effect, and its modeling theory and simulation technology maturity show significant heterogeneity. In this context, in order to better develop and utilize the electricity-gas integrated energy system, it is necessary to establish a reliable natural gas pipeline system dynamic model and perform simulation solutions.
[0004] However, in actual projects, the structural parameters of natural gas pipeline networks are often uncertain due to pipeline aging, corrosion or construction errors. This parameter uncertainty will lead to significant deviations between the system model and the actual dynamic response. In addition, since the partial differential equations that describe the dynamic characteristics of natural gas pipelines are very complex and have strong spatiotemporal coupling characteristics, the common solution method is to discretize the original partial differential equations in time and space, and then use linearization to deal with the nonlinear terms in the equations. However, the discrete equations introduce a large number of intermediate variables, which results in a large amount of calculation and slow solution speed. In addition, inappropriate time and space discrete steps and linearization methods will reduce the solution accuracy, thus affecting the rapid and accurate simulation of the natural gas pipeline system. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a natural gas pipeline network system simulation method, system and medium based on parameter reconstruction to solve the above-mentioned technical problems.
[0006] In a first aspect, the present invention provides a natural gas pipeline network system simulation method based on parameter reconstruction, comprising: 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; 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.
[0007] In an optional embodiment, constructing a group of partial differential equations for each pipeline based on air pressure and mass flow specifically includes:
[0008] 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.
[0009] In an optional implementation, before the multi-task-physical information neural network model is constructed, the operation data and the partial differential equation group of each pipeline are dimensionally processed, specifically including: Introducing the characteristic scale, all running data are converted to dimensionless form:
[0010] 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: .
[0011] In an optional embodiment, 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, and adopt a soft parameter sharing mechanism 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 is fused 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 rate and partial differential equation group parameters, and the loss value between the 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 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 solvers Adam and L-BFGS; After the model training is completed, the neural network model parameters and the partial differential equation group parameters are reconstructed.
[0012] In an optional implementation, in the multi-task-physical information neural network model training, the loss function is constructed as follows:
[0013]
[0014]
[0015]
[0016] 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 (parameters that need to be identified). 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.
[0017] In an optional implementation, constructing node gas pressure constraints and node flow balance constraints of the natural gas pipeline network system includes: 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.
[0018] In an optional embodiment, performing secondary training on the multi-task-physical information neural network of 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.
[0019] In an optional implementation, constructing a loss function based on the node air pressure constraint and the node flow balance constraint specifically includes:
[0020]
[0021] 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 terminal 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 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.
[0022] In a second aspect, the present invention provides a natural gas pipeline network system simulation system based on parameter reconstruction. When the system is implemented, the natural gas pipeline network system simulation method based on parameter reconstruction is executed. 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; 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.
[0023] According to a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the methods described in the above aspects.
[0024] The beneficial effect of the present invention lies in that the natural gas pipeline system simulation method, system and medium based on parameter reconstruction provided by the present invention directly model the continuous space-time dynamic characteristics of the strongly coupled partial differential equation group of the natural gas pipeline system by constructing a multi-task-physical information neural network, and use the pipeline operation data to drive training, and complete the partial differential equation parameter reconstruction under the premise of maintaining the physical constraints of the equation. Then, the model realizes multi-neural network joint training through the natural gas pipeline network constraints. Only a small number of core parameters need to be adjusted to build a high-precision dynamic simulation system, and the global dynamic field distribution including node gas pressure and mass flow rate is output in real time to realize the dynamic simulation of the natural gas pipeline system.
[0025] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0027] Figure 1 It is a schematic flow chart of a natural gas pipeline network system simulation method based on parameter reconstruction according to an embodiment of the present invention.
[0028] Figure 2It is a schematic block diagram of a natural gas pipeline network system simulation system based on parameter reconstruction according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art 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.
[0031] The natural gas pipeline network system simulation method based on parameter reconstruction provided in the embodiment of the present invention is executed by a computer device, and accordingly, the natural gas pipeline network system simulation system based on parameter reconstruction runs in the computer device.
[0032] Figure 1 FIG. 1 is a schematic flow chart of a natural gas pipeline network system simulation method based on parameter reconstruction according to an embodiment of the present invention. Figure 1 The execution subject may be a natural gas pipeline network system simulation system based on parameter reconstruction. According to different requirements, the order of the steps in the flow chart may be changed, and some may be omitted.
[0033] like Figure 1 As shown, the method includes: Step S1, collecting the operation data of each pipeline in the natural gas pipeline network system, the operation data including the time and space coordinates, air pressure and mass flow of the specified position of each pipeline, and constructing a group of partial differential equations associated with the operation data for each pipeline based on the air pressure and mass flow; Sensors are installed at designated locations on each pipeline in the natural gas pipeline network system to collect time-space coordinates, air pressure, and mass flow data in real time. Through professional data analysis software, a corresponding set of partial differential equations is constructed for each pipeline based on the changing characteristics of air pressure and mass flow and physical principles. The operation data of the natural gas pipeline network is fully and accurately obtained, providing a reliable foundation for subsequent in-depth analysis of the operation status of the pipeline network. The constructed set of partial differential equations can describe the changes in the pipeline from the level of physical laws, which helps to accurately understand and grasp the flow characteristics of natural gas in the pipeline.
[0034] Step S2, constructing a multi-task-physical information neural network model for each pipeline, training the corresponding multi-task-physical information neural network model based on the operation data of each pipeline and the partial differential equation group, and completing the reconstruction of the multi-task-physical information neural network model parameters and the partial differential equation group parameters during the model training process; For each pipeline, a multi-task-physical information neural network model is built using a deep learning framework. The operating data collected in step S1 is used as input, combined with the constructed partial differential equations, and the neural network model parameters and partial differential equations parameters are continuously adjusted during the training process with the help of optimization algorithms to achieve parameter reconstruction. The neural network model can fully learn the characteristics of the pipeline operation data, while integrating physical laws to improve the accuracy and generalization ability of the model. Parameter reconstruction can enable the model to better adapt to the characteristics of different pipelines and provide a more effective tool for the simulation and prediction of the pipeline network system.
[0035] Step S3, obtaining 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 constructing 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 trained multi-task-physical information neural network model is applied to each pipeline to obtain the gas 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, node gas pressure constraints and node flow balance constraints are constructed based on these data. The operating rules and restrictions at the nodes in the natural gas pipeline network system are clarified to provide a constraint basis for the stable operation and analysis of the pipeline network system.
[0036] Step S4, based on the node gas pressure constraint and the node flow balance constraint 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 combination simulation model, and the natural gas pipeline system is simulated based on the multi-neural network combination simulation model.
[0037] The node pressure constraint and node flow balance constraint constructed in step S3 are integrated into the joint training method, and the multi-task-physical information neural network of all pipelines is trained twice to obtain a multi-neural network combined simulation model. The model is used to input relevant parameters to simulate the natural gas pipeline network system. Through the secondary training, each pipeline model is integrated so that the combined model can better reflect the operating status of the entire natural gas pipeline network system.
[0038] Optionally, as an embodiment of the present invention, the operation data of each pipeline in the natural gas system (including the time and space coordinates, gas pressure and mass flow rate of each location of the pipeline in each time period) is collected and the data is processed.
[0039] For the gas flow dynamics in the pipeline, general assumptions are adopted for simplification, and the partial differential equation model of the natural gas pipeline described by the air pressure p(x, t) and the mass flow m(x, t) can be obtained:
[0040] in, and represents the space-time coordinates, and The distribution represents the gas pressure and 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.
[0041] Each pipeline can be described by the partial differential equation shown in formula (1), so it is necessary to collect data for each pipeline separately and train its corresponding neural network model. For each pipeline, the operation data of each pipeline at each time period is collected to obtain a series of discrete grid data points ,in and represents the spatiotemporal coordinates of the sampled data points in the pipeline, where , and Represents a pipeline The air pressure and mass flow rate corresponding to the sampled data points.
[0042] Optionally, as an embodiment of the present invention, before model training, because the pipeline operation data actually measured and collected are equidistant in time and space and the data volume is limited, in order to obtain enough asynchronous data for neural network training, bilinear interpolation is performed on the grid data sampled from each pipeline (because the pipeline airflow is dynamic and slow, the use of linear interpolation has little effect on the accuracy).
[0043] In the process of training physical information neural network, in order to avoid gradient explosion, improve the training convergence speed, and prevent normalization from making the relationship between data lose physical meaning, it is necessary to non-dimensionalize the data and partial differential equations: 1) Introduce characteristic scale and convert all variable data into unitless relative values:
[0044] 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.
[0045] 2) According to the introduced characteristic scale, the partial differential equations can also be transformed into dimensionless form:
[0046] The training data set for each pipeline can be obtained through bilinear interpolation and dimensionless processing. By combining dimensionless partial differential equations, the neural network agent model corresponding to each pipeline can be trained.
[0047] Step 2: Build a multi-task-physical information neural network, train the neural network model corresponding to each pipeline, and identify the parameters of the pipeline partial differential equation group.
[0048] Optionally, as an embodiment of the present invention, since the parameters of different pipelines are different, a separate multi-task-physical information neural network is established for each pipeline to fit the partial differential equations of the pipeline. Its multi-task learning architecture is used to capture the trajectory of the evolution of air pressure p and mass flow m over time and space, avoiding the different spatiotemporal characteristics of air pressure and mass flow that cause the training of the physical information neural network to fail to converge.
[0049] The multi-task-physical information neural network model includes two parallel neural networks, which together constitute the feature extraction layer, the sharing layer, and the multi-task learning layer. The soft parameter sharing mechanism is adopted to fit the changes of air pressure and mass flow through two parallel neural networks. 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. The two neural networks in the feature extraction layer and the multi-task learning layer are parallel. The sharing layer of each task can be expressed as:
[0050] in, It's a task The output vector of the corresponding feature extraction layer network, It's a task The corresponding output vector of the shared layer network, (·) represents an operator that connects multiple vectors. and Indicates the task The corresponding weights and biases of the shared layer network, Represents the activation function of the shared layer network. The output vectors of the shared layer are respectively input into the parallel neural network in the multi-task learning layer to generate the values of air pressure and mass flow.
[0051] In order to enable the trained neural network model to identify the relevant parameters of the partial differential equations, it is necessary to include the partial differential equations and their boundary conditions in 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: (5) (6) (7) (8) in, and represents the air pressure and mass flow data set; and Representation of air pressure and mass flow predicted by 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 (parameters that need to be identified). 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.
[0052] Using the constructed loss function The multi-task-physical information neural network is trained, and the parameters of the neural network are optimized using the gradient descent method using the optimization solvers Adam and L-BFGS. Update, as the loss function decreases to a sufficiently small value The training is completed in 1 hour. As unknown parameters in the partial differential equation, they are considered as The same learnable parameters, when updating the parameters hour Will also be updated together until the training is completed to get the final partial differential equation parameters *, that is, the parameter reconstruction of the partial differential equation system is completed.
[0053] Optionally, as an embodiment of the present invention, the multi-task-physical information neural network corresponding to pipeline 1 can be expressed as: (9) in, and Represents a pipeline The gas pressure and mass flow distribution, Represents a pipeline The corresponding multi-task-physical information neural network, and represents the space coordinate and time coordinate, Represents a pipeline The corresponding training completed multi-task-physical information neural network parameters, Represents a pipeline The corresponding parameters of the partial differential equation system.
[0054] The multi-task-physical information neural network trained in step 2 can not only identify the unknown parameters of the partial differential equations, but also perform real-time simulation of the pipeline dynamics described by the partial differential equations because the partial differential equations and boundary conditions are incorporated into the loss function.
[0055] Dynamic simulation of the natural gas system not only needs to satisfy the partial differential equations of the natural gas pipeline, but also needs to introduce network constraints of the natural gas system to ensure that the state variables of each pipeline conform to the dynamic operation of the system. Therefore, it is necessary to use the node pressure constraints and node flow balance constraints of the natural gas network to jointly train the multi-task-physical information neural network of all pipelines.
[0056] In the joint training process, the multi-task-physical information neural network of each pipeline is used as a prediction unit. Through these prediction units, the state variables at the two ports of each pipeline can be predicted in real time, and then combined with the pipeline network constraints for training. The specific execution process is as follows: 1) By inputting the time and space coordinates of the input port and output port of the pipeline into the corresponding prediction unit, the real-time air pressure and mass flow at both ends of the pipeline are obtained: (10) (11) Among them, 0 represents the spatial coordinate of the pipeline input port; Represents a pipeline The length of the pipeline The spatial coordinates of the output port; Represents any moment that needs to be predicted, that is, the time coordinate; Indicates time pipeline Gas pressure and mass flow rate at the input port; Indicates time pipeline Gas pressure and mass flow rate at the output port.
[0057] 2) Construct node pressure constraints and node flow balance constraints of the natural gas system: A. For the gas source node in the natural gas system, since the gas source pressure is known and constant, the following node pressure constraints are satisfied: (12) in, Represents a collection of gas sources; Indication and gas source A collection of interconnected natural gas pipelines; Indicates gas source This formula indicates that the air pressure at the input port of the pipeline connected to the air source is equal to the air pressure of the air source.
[0058] B. For the terminal node in the natural gas system, which is connected to the natural gas load, the following node flow balance constraints can be obtained based on the known load: (13) in, represents the set of natural gas loads at the terminal nodes; Indicates natural gas load A collection of interconnected natural gas pipelines; Indicates time Natural gas load This formula indicates that the sum of the mass flow rates of the output ports of the pipelines connected to the end nodes is equal to the natural gas load at the end nodes.
[0059] C. For general nodes in the natural gas system, they connect the input and output ports of multiple pipelines and often have natural gas loads. The following node pressure constraints and node flow balance constraints need to be met:
[0060] (15) Where J represents the set of general nodes in the natural gas system; and Represents input ports, output ports and nodes respectively A collection of connected pipes; represents the set of natural gas loads at general nodes; Represents a pipeline The air pressure at the input port, Represents a pipeline The air pressure at the output port. Equation (14) represents the pressure at the node The air pressure at the connected pipe ports is equal; Equation (15) represents the node The natural gas inflow and outflow are balanced in real time.
[0061] Optionally, as an embodiment of the present invention, performing secondary training on the multi-task-physical information neural network of all pipelines includes: Before joint training, a hierarchical 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. During the joint training process, by keeping the weights and biases of the feedforward network structure unchanged, only the connection weights and biases of the output layer are dynamically optimized, so as to achieve high-precision fitting of the linear constraint relationship of the pipeline network while maintaining the strong constraints of the pipeline partial differential equation group; 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 pressure constraint and the node flow balance constraint. The loss value between the predicted pressure and mass flow at both ends of the pipeline and the actual pressure and mass flow at both ends of the pipeline is calculated based on the loss function. Back propagation 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. The initial learning rate of the Adam optimizer is set to The magnitude is reduced to suppress the gradient amplitude during the parameter update process, ensuring that the numerical solution always meets the constraints of the pipeline partial differential equations. Based on the optimizer, a joint update strategy for network parameters is implemented to achieve collaborative learning of pipeline network physical constraints and data features while satisfying Lipschitz continuity.
[0062] Optionally, as an embodiment of the present invention, constructing a loss function based on a node air pressure constraint and a node flow balance constraint specifically includes:
[0063]
[0064] 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 terminal 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 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.
[0065] After the above steps, a pipeline partial differential equation parameter reconstruction model with excellent generalization performance can be constructed. The multi-neural network combination model trained jointly has efficient simulation capabilities, can accurately analyze the dynamic characteristics of the natural gas system, and output the key state parameters (gas pressure, mass flow) of each node in the pipeline network in real time.
[0066] In summary, a multi-task-physical information neural network model is constructed, which combines the characteristics of the multi-task learning architecture and the physical information network to realize the fitting of the partial differential equations of the natural gas pipeline, accurately identifies the parameters of the partial differential equations in a data-driven manner, and solves the problem of inaccurate system parameter acquisition. In addition, the present invention also integrates the neural network proxy models of multiple pipelines through joint training, and uses the hierarchical parameter freezing strategy and the method of limiting the optimizer learning rate to update a small number of neural network parameters, thereby obtaining a multi-neural network combination model to realize real-time dynamic simulation of the natural gas system.
[0067] In some embodiments, the natural gas pipeline network system simulation system based on parameter reconstruction may include multiple functional modules composed of computer program segments. The computer program of each program segment in the natural gas pipeline network system simulation system based on parameter reconstruction may be stored in the memory of a computer device and executed by at least one processor to execute (see Figure 1 Description) Function of natural gas pipeline network system simulation based on parameter reconstruction.
[0068] In this embodiment, the natural gas pipeline network system simulation system based on parameter reconstruction can be divided into multiple functional modules according to the functions it performs, such as Figure 2 As shown. The functional modules of the system may include: a data acquisition and processing module, a pipeline model training module, a constraint condition building module, and a joint model training simulation module. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments. 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; 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.
[0069] The data acquisition and processing module is used to obtain the operation data of the natural gas pipeline network and construct a group of partial differential equations. The pipeline model training module constructs and trains the neural network models and reconstruction parameters of each pipeline. The constraint condition construction module constructs node constraints based on the data obtained by the neural network. The joint model training and simulation module performs secondary training to obtain a combined simulation model, which can realize high-precision simulation of the natural gas pipeline network system, effectively process the operation data of the pipeline network, and combine physical laws with neural networks to improve the accuracy and reliability of the model.
[0070] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0071] 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 this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which 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 disk or an optical disk, and other media that can store program codes, including several instructions for enabling 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 each embodiment of the present invention.
[0072] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0073] In the 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 only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.
[0074] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0075] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0076] Although the present invention has been described in detail by referring to the accompanying 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, a person skilled in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, and they shall be within the scope of protection 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; 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: The multi-task-physical information neural network model includes two parallel neural networks, which together constitute the feature extraction layer, sharing layer, and multi-task learning layer. The 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 is fused 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 rate and partial differential equation group parameters, and the loss value between the 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 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 solvers Adam and L-BFGS; After the model training is completed, the neural network model parameters and the partial differential equation group parameters are reconstructed.
5. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 4 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.
6. 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.
7. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 6 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.
8. The natural gas pipeline network system simulation method based on parameter reconstruction according to claim 7 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 terminal 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 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.
9. 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 8 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; 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.
10. 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-7 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
Comprehensive energy system state estimation method based on physical information neural network
CN117592235A
Hydrogen transmission pipeline modeling method and system based on physical information neural network
CN117951850A
Method and apparatus for determining pipeline flow status parameter of natural gas pipeline network
US20150261893A1