A natural gas network system model construction method and parameter identification method
By constructing a natural gas network system model and utilizing partial differential dynamic equations and difference equations, combined with topological constraints and loss functions, the problem of parameter identification in the natural gas system model was solved, achieving high-precision parameter identification and scheduling decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2023-03-28
- Publication Date
- 2026-05-15
AI Technical Summary
Existing natural gas system models struggle to obtain accurate dynamic parameters during scheduling, leading to significant discrepancies between model predictions and actual processes. Furthermore, they are unable to measure the state of gas in the pipeline, impacting the accuracy of scheduling decisions.
A natural gas network system model is constructed by discretizing the physical model into a difference equation model through partial differential dynamic equations, setting topological constraints and network variables, and updating model parameters by combining loss functions to achieve parameter identification.
It achieves high-precision identification of natural gas network parameters, establishes a linear dynamic model, which is suitable for simulation calculation and scheduling decision-making, and reduces the dependence on the accurate system model.
Smart Images

Figure CN116561939B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural gas system scheduling technology, and in particular to a method for constructing a natural gas network system model and a method for parameter identification. Background Technology
[0002] Current natural gas system regulation faces numerous challenges, including the construction of natural gas system models and parameter identification for natural gas network models. Parameter identification refers to determining a set of parameter values based on experimental data and the established model, ensuring that the numerical results calculated by the model best fit the test data. This allows for prediction and guidance of the production process. When the error between the predicted numerical results and the measured values is large, the model is considered inconsistent with the actual process or has a significant discrepancy, leading to model modification and parameter reselection. Therefore, parameter identification is an inverse problem; the quality of parameter estimation determines the reliability of the model's interpretation of real-world problems.
[0003] Current natural gas system models are slow-dynamic processes, and transient processes cannot be ignored during scheduling, making scheduling decisions difficult. The parameter identification problem in natural gas network models is specifically manifested in the following ways: accurate dynamic parameters of the natural gas network are often difficult to obtain precisely, resulting in significant errors and making model-driven methods difficult to apply in practice; measurements of the natural gas system only exist at the nodes and endpoints of the network, making it impossible to measure the gas state in the middle of the pipeline. Summary of the Invention
[0004] To address the aforementioned problems, the inventors have developed this invention, which, through specific implementation methods, provides a method for constructing a natural gas network system model and a method for parameter identification.
[0005] In a first aspect, embodiments of the present invention provide a method for constructing a natural gas network system model, comprising the following steps:
[0006] A physical model of the partial differential dynamic equations of a natural gas pipeline is constructed. The physical model of the partial differential dynamic equations is discretized into a difference equation model. Topological constraints and variables of the natural gas network are set. Based on the difference equation model, topological constraints, and natural gas network variables, the natural gas network system model is determined.
[0007] Specifically, constructing a physical model of the partial differential dynamic equations for a natural gas pipeline includes the following steps:
[0008] Use Euler's formula to describe the dynamics of natural gas in a natural gas pipeline.
[0009]
[0010] in, The symbol is a partial differential, where ρ represents the density of natural gas, v represents the flow velocity of natural gas, x represents the position, π represents the pressure of natural gas, λ represents the friction coefficient of the natural gas pipeline, D represents the diameter of the natural gas pipeline, g represents the acceleration due to gravity, and α represents the angle between the natural gas pipeline and the horizontal plane.
[0011] Will Simplified to
[0012] The pressure and flow rate of natural gas are expressed as:
[0013] π = u 2 ρ and G = ρvA
[0014] Where u represents the speed of sound, G represents the natural gas flow rate, and A represents the cross-sectional area of the natural gas pipeline.
[0015] Will Expanding the quadratic term at the base velocity, we get: v b Indicates the base value of natural gas flow rate;
[0016] Let π=u 2 ρ, G = ρvA and Substitution and A physical model of the partial differential dynamic equations for a natural gas pipeline is obtained.
[0017]
[0018] Specifically, the difference equation model is as follows:
[0019]
[0020] Where, π i,t Let represent the gas pressure at calculation node i at time t, where i represents the calculation node number. A calculation node is a virtual node in the natural gas network used for calculation. u represents the speed of sound, Δt represents the discrete time interval, and A l Δx represents the cross-sectional area of pipe l, where l represents the pipe number. l G represents the discrete length interval of pipe l. i,t G represents the natural gas flow rate at node i at time t. i-1,t π represents the natural gas flow rate at node i-1 at time t. i,t-1 λ represents the air pressure at node i at time t-1. l V represents the coefficient of friction of pipe l. b,l D represents the base velocity value of pipe l. l π represents the diameter of pipe l. i-1,t G represents the air pressure at node i-1 calculated at time t. i,t-1The value represents the natural gas flow rate at node i at time t-1.
[0021] Specifically, setting topology constraints for the natural gas network includes the following steps:
[0022] Set gas pressure topology constraints for natural gas network nodes.
[0023] Where, π i,t This represents the gas pressure at computation node i at time t, where i represents the computation node number. A computation node refers to a virtual node in the natural gas network used for computation. S represents the gas pressure at actual node n at time t, where n represents the actual node number. An actual node refers to the intersection of pipelines in the natural gas network. u This represents the set of compute node numbers located at the actual node n;
[0024] Configure gas flow topology constraints for natural gas network nodes.
[0025] Among them, G i,t This represents the natural gas flow rate at node i at time t. This represents the actual injected natural gas flow rate at node n at time t. G represents the set of compute node numbers that flow into the actual node n. j,t This represents the natural gas flow rate at computation node j at time t, where j represents the computation node number. This represents the set of compute node numbers that flow out of the actual node n.
[0026] Set compressor pressurization constraints in the natural gas network.
[0027] Where, π j,t Δπ represents the air pressure at node j calculated at time t. k,t This represents the boost pressure value of the k-th compressor at time t, where k represents the compressor number. This represents the set of computing node numbers that flow into the k-th compressor. This represents the set of computing node numbers that flow out of the k-th compressor.
[0028] Specifically, setting natural gas network variables includes the following steps:
[0029] Set control variables for the natural gas network system model Among them, u t u represents the vector formed by the control variables of each actual node at time t. n,t This represents the control variable at actual node n at time t, where n represents the actual node number. An actual node refers to the intersection point between pipelines in the natural gas network. The colon (:=) indicates a definition symbol. This represents the actual air pressure at node n at time t. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G A set representing the actual node numbers for natural gas flow control;
[0030] Set the output variables of the natural gas network system model.
[0031] Among them, y t y represents the vector formed by the measured variables at each actual node at time t. n,t Represents the measured variable at the actual node n at time t;
[0032] Set the state variables for the natural gas network system model.
[0033] Where, π t π represents the vector formed by the gas pressure variables at each computation node at time t. A computation node refers to a virtual node in the natural gas network used for computation. i,t G represents the air pressure at node i at time t, where i represents the node number. t G represents the vector formed by the airflow variables at each computation node at time t. i,t S represents the natural gas flow rate at node i at time t. s h represents the set of all compute node IDs. t Indicates that time t is determined by not t and G t The state variable vector formed by splicing.
[0034] Specifically, based on the difference equation model, topological constraints, and natural gas network variables, the natural gas network system model is determined, including the following steps:
[0035] By rearranging the difference equation model, topological constraints, and natural gas network variables, we obtain the difference state equation.
[0036]
[0037] Where K(θ) represents a sparse matrix composed of parameters θ, and θ represents the parameter vector of the natural gas network to be identified. This represents the vector formed by the gas pressures at each actual node at time t. An actual node refers to the intersection point between pipelines in the natural gas network. t h represents the vector formed by the control variables of each actual node at time t. t Indicates time t by π t and G t The state variable vector formed by splicing, πt G represents the vector formed by the gas pressure variables at each computation node at time t. A computation node refers to a virtual node in the natural gas network used for computation. t h represents the vector formed by the airflow variables at each computation node at time t. t-1 Indicates time t-1 is determined by π t-1 and G t-1 The state variable vector formed by splicing, π t-1 G represents the vector formed by the air pressure variables at each computation node at time t. t-1 Let S represent the vector formed by the gas flow variables at each calculation node at time t, and let S represent the constant matrix used to select the independent state variables from the state variables. The state variables refer to the state variables of the natural gas network system model. Where, π i,t G represents the air pressure at node i at time t, where i represents the node number. i,t S represents the natural gas flow rate at node i at time t. s Represents the set of all compute node IDs;
[0038] Based on the aforementioned differential state equations, a natural gas network system model is constructed as follows:
[0039] Among them, J (1) To J (4) Let J be the inverse of matrix K(θ), and H be the constant matrix used to select the output variables, where the output variables refer to the output variables of the natural gas network system model. Among them, y t y represents the vector formed by the measured variables at each actual node at time t. n,t Represents the measured variable at the actual node n at time t; This represents the air pressure at actual node n at time t, where n represents the actual node number. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G This represents the set of actual node numbers for natural gas flow control.
[0040] Secondly, embodiments of the present invention provide a method for identifying model parameters of a natural gas network system, comprising the following steps:
[0041] A physical model of partial differential dynamic equations for a natural gas pipeline is constructed. This physical model is then discretized into a difference equation model. Topological constraints and variables for the natural gas network are set. Based on the difference equation model, topological constraints, and natural gas network variables, a natural gas network system model is determined.
[0042] The parameters learned by the natural gas network system model are output.
[0043] Set the loss function for the natural gas network system model parameters;
[0044] The initial state of the natural gas network system and the parameters learned by the model are updated using the loss function. When the update termination condition is met, the parameter values of the natural gas network system model are determined.
[0045] Specifically, the loss function for identifying parameters in the natural gas network system model is set as follows: Where L represents the loss function, T represents the total number of time points, and L t Let λ represent the error vector between the output value and the measured value of the natural gas network system model at time t, and let λ represent the weight hyperparameter. θ represents the parameter values learned by the natural gas network system model, and θ0 represents the initial parameter estimates of the natural gas network system model. y represents the output value of the natural gas network system model. t It represents the vector formed by the measured variables at each actual node at time t. The actual node refers to the intersection point between pipelines in the natural gas network.
[0046] Specifically, the initial state of the natural gas network system and the parameters learned by the model are updated based on the loss function, including the following steps:
[0047] by Update h0, where h0 represents the initial state of the natural gas network system, L represents the loss function, and α h This represents the learning rate hyperparameter of h0;
[0048] by renew in, α represents the parameter values learned from the natural gas network system model. θ express The learning rate hyperparameter.
[0049] Specifically, through Sure Where T represents the total number of time points, p represents a time point, and S represents a constant matrix used to select independent state variables from the state variables. The state variables refer to the state variables of the natural gas network system model. h t Indicates time t by π t and G t The state variable vector formed by splicing, π tG represents the vector formed by the gas pressure variables at each computation node at time t. A computation node refers to a virtual node in the natural gas network used for computation. t π represents the vector formed by the airflow variables at each calculation node at time t. i,t G represents the air pressure at node i at time t, where i represents the node number. i,t S represents the natural gas flow rate at node i at time t. s J represents the set of all compute node IDs. (1) The top-left block matrix among the four block matrices representing the inverse of matrix K(θ), where K(θ) represents a sparse matrix composed of parameters θ, θ represents the parameter vector of the natural gas network to be identified, and H represents a constant matrix used to select output variables, where the output variables refer to the output variables of the natural gas network system model. Among them, y t This represents the vector formed by the measured variables at each actual node at time t. An actual node refers to the intersection point between pipelines in the natural gas network. n,t Represents the measured variable at the actual node n at time t; This represents the air pressure at actual node n at time t, where n represents the actual node number. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G y represents the set of actual node numbers for natural gas flow control. T-p The vector representing time Tp is composed of the measured variables at each actual node.
[0050] pass
[0051]
[0052] Sure The kth element Where, r (1) Representation matrix J (1) The number of rows, r (2) Representation matrix J (2) The number of rows, J (2) Let K(θ) be the top-right block matrix among the four block matrices representing the inverse of matrix K(θ), where K(θ) is a sparse matrix composed of parameters θ, θ represents the natural gas network parameter vector to be identified, and c is the top-right block matrix among the four block matrices representing the inverse of matrix K(θ). (1) Representation matrix J (1) The number of columns, c (2) Representation matrix J (2) The number of columns, Representation matrix J (1) The element in row iA and column jA, Representation matrix J(2) The element in row iA and column jA, Let λ represent the identification result of the k-th parameter, λ represent the weight hyperparameter, and θ0 represent the initial parameter estimates of the natural gas network system model. express The element in row iA and column jA, express The element in row iA and column jA;
[0053] pass Sure pass Sure Among them, h t-1 Indicates time t-1 is determined by π t-1 and G t-1 The state variable vector formed by splicing, π t-1 G represents the vector formed by the air pressure variables at each computation node at time t. t-1 U represents the vector formed by the airflow variables at each computation node at time t. t This represents a vector at time t composed of the control variables of each actual node. The control variables refer to the control variables of the natural gas network system model. Among them, u t u represents the vector formed by the control variables of each actual node at time t. n,t This represents the control variable at actual node n at time t, where n represents the actual node number. This represents the actual air pressure at node n at time t. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G This represents the set of actual node numbers for natural gas flow control.
[0054] Based on the same inventive concept, embodiments of the present invention also provide a natural gas network system model, which is constructed by the aforementioned natural gas network system model construction method.
[0055] Based on the same inventive concept, this embodiment of the invention also provides a natural gas network system model parameter identification device, which uses the aforementioned natural gas network system model parameter identification method to perform parameter identification.
[0056] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:
[0057] The method proposed in this invention can achieve physical interpretability of natural gas network parameters. Compared with existing methods, it does not rely on the precise system model parameters of the natural gas network, but can achieve parameter identification of the system solely based on the network measurement results. At the same time, the established natural gas system is a linear dynamic model with high accuracy and can be widely used in simulation calculation and scheduling decision-making.
[0058] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.
[0059] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0060] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0061] Figure 1 This is a flowchart of a natural gas network system model construction method according to an embodiment of the present invention;
[0062] Figure 2 This is a flowchart of a method for identifying model parameters of a natural gas network system according to an embodiment of the present invention. Detailed Implementation
[0063] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0064] To address the problems existing in the prior art, embodiments of the present invention provide a method for constructing a natural gas network system model and a method for parameter identification.
[0065] This invention provides a method for constructing a natural gas network system model, the process of which is as follows: Figure 1 As shown, it includes the following steps:
[0066] Step S1: Construct a physical model of the partial differential dynamic equations of the natural gas pipeline.
[0067] In some specific embodiments, constructing a physical model of the partial differential dynamic equations of a natural gas pipeline includes the following steps: describing the dynamics of natural gas in the pipeline using Euler's formula. in, The symbol is a partial differential, where ρ represents the density of natural gas, v represents the flow velocity of natural gas, x represents the position, π represents the pressure of natural gas, λ represents the friction coefficient of the natural gas pipeline, D represents the diameter of the natural gas pipeline, g represents the acceleration due to gravity, and α represents the angle between the natural gas pipeline and the horizontal plane.
[0068] In high-pressure pipelines, The convection term can be ignored; it is approximately zero. Furthermore, α is typically set to 0. Therefore, Simplified to
[0069] The pressure and flow rate of natural gas are expressed as: π = u 2 ρ and G = ρvA, where u represents the speed of sound, G represents the natural gas flow rate, and A represents the cross-sectional area of the natural gas pipeline.
[0070] Will Expanding the quadratic term at the base velocity, we get: v b Indicates the base value of natural gas flow rate;
[0071] Let π=u 2 ρ, G = ρvA and Substitution and A physical model of the partial differential dynamic equations for a natural gas pipeline is obtained.
[0072]
[0073] Step S2: Discretize the physical model of the partial differential dynamic equation into a difference equation model.
[0074] In some specific embodiments, the difference equation model is as follows:
[0075]
[0076] Where, π i,t Let represent the gas pressure at calculation node i at time t, where i represents the calculation node number. A calculation node is a virtual node in the natural gas network used for calculation. u represents the speed of sound, Δt represents the discrete time interval, and A l Δx represents the cross-sectional area of pipe l, where l represents the pipe number. l G represents the discrete length interval of pipe l. i,t G represents the natural gas flow rate at node i at time t. i-1,t π represents the natural gas flow rate at node i-1 at time t.i,t-1 λ represents the air pressure at node i at time t-1. l V represents the coefficient of friction of pipe l. b,l D represents the base velocity value of pipe l. l π represents the diameter of pipe l. i-1,t G represents the air pressure at node i-1 calculated at time t. i,t-1 The value represents the natural gas flow rate at node i at time t-1.
[0077] Step S3: Set the topology constraints for the natural gas network.
[0078] In some specific embodiments, setting topological constraints for the natural gas network includes the following steps:
[0079] Set gas pressure topology constraints for natural gas network nodes.
[0080] Where, π i,t This represents the gas pressure at computation node i at time t, where i represents the computation node number. A computation node refers to a virtual node in the natural gas network used for computation. S represents the gas pressure at actual node n at time t, where n represents the actual node number. An actual node refers to the intersection of pipelines in the natural gas network. n This represents the set of compute node numbers located at the actual node n;
[0081] Configure gas flow topology constraints for natural gas network nodes.
[0082] Among them, G i,t This represents the natural gas flow rate at node i at time t. This represents the actual injected natural gas flow rate at node n at time t. G represents the set of compute node numbers that flow into the actual node n. j,i This represents the natural gas flow rate at computation node j at time t, where j represents the computation node number. This represents the set of compute node numbers that flow out of the actual node n.
[0083] Set compressor pressurization constraints in the natural gas network.
[0084] Where, π j,t Δπ represents the air pressure at node j calculated at time t. k,t This represents the boost pressure value of the k-th compressor at time t, where k represents the compressor number. This represents the set of computing node numbers that flow into the k-th compressor. This represents the set of computing node numbers that flow out of the k-th compressor.
[0085] Step S4: Set natural gas network variables.
[0086] In some specific embodiments, setting natural gas network variables includes the following steps:
[0087] Set control variables for the natural gas network system model Among them, u t u represents the vector formed by the control variables of each actual node at time t. n,t This represents the control variable at actual node n at time t, where n represents the actual node number. An actual node refers to the intersection point between pipelines in the natural gas network. The colon (:=) indicates a definition symbol. This represents the actual air pressure at node n at time t. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G A set representing the actual node numbers for natural gas flow control;
[0088] Set the output variables of the natural gas network system model Among them, y t y represents the vector formed by the measured variables at each actual node at time t. n,t Represents the measured variable at the actual node n at time t;
[0089] Set the state variables of the natural gas network system model Where, π t π represents the vector formed by the gas pressure variables at each computation node at time t. A computation node refers to a virtual node in the natural gas network used for calculation. i,t G represents the air pressure at node i at time t, where i represents the node number. t G represents the vector formed by the airflow variables at each computation node at time t. i,t S represents the natural gas flow rate at node i at time t. s h represents the set of all compute node IDs. t Indicates time t by π t and G t The state variable vector formed by splicing.
[0090] Step S5: Determine the natural gas network system model based on the difference equation model, topological constraints, and natural gas network variables.
[0091] In some specific embodiments, the natural gas network system model is determined based on the difference equation model, topological constraints, and natural gas network variables, including the following steps:
[0092] By rearranging the difference equation model, topological constraints, and natural gas network variables, we obtain the difference state equation.
[0093]
[0094] Where K(θ) represents a sparse matrix composed of parameters θ, and θ represents the parameter vector of the natural gas network to be identified. This represents the vector formed by the gas pressures at each actual node at time t. An actual node refers to the intersection point between pipelines in the natural gas network. t h represents the vector formed by the control variables of each actual node at time t. t Indicates time t by π t and G t The state variable vector formed by splicing, π t G represents the vector formed by the gas pressure variables at each computation node at time t. A computation node refers to a virtual node in the natural gas network used for computation. t h represents the vector formed by the airflow variables at each computation node at time t. t-1 Indicates time t-1 is determined by π t-1 and G t-1 The state variable vector formed by splicing, π t-1 G represents the vector formed by the air pressure variables at each computation node at time t. t-1 Let S represent the vector formed by the gas flow variables at each calculation node at time t, and let S represent the constant matrix used to select the independent state variables from the state variables. The state variables refer to the state variables of the natural gas network system model. Where, π i,t G represents the air pressure at node i at time t, where i represents the node number. i,t S represents the natural gas flow rate at node i at time t. s Represents the set of all compute node IDs;
[0095] Based on the measurement data and the differential state equation, a natural gas network system model is constructed as follows:
[0096] Among them, J (1) To J (4) Let J be the inverse of matrix K(θ), and H be the constant matrix used to select the output variables, where the output variables refer to the output variables of the natural gas network system model. Among them, y t y represents the vector formed by the measured variables at each actual node at time t. n,t Represents the measured variable at the actual node n at time t; This represents the air pressure at actual node n at time t, where n represents the actual node number. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G This represents the set of actual node numbers for natural gas flow control.
[0097] In the above method of this embodiment, the established natural gas system model is a linear dynamic model with high accuracy and can be widely used in simulation calculation and scheduling decision-making.
[0098] This invention also provides a method for identifying model parameters of a natural gas network system, the process of which is as follows: Figure 2 As shown, it includes the following steps:
[0099] A physical model of partial differential dynamic equations for a natural gas pipeline is constructed. This physical model is then discretized into a difference equation model. Topological constraints and variables for the natural gas network are set. Based on the difference equation model, topological constraints, and natural gas network variables, a natural gas network system model is determined.
[0100] The parameters learned by the natural gas network system model are output.
[0101] Set the loss function for the natural gas network system model parameters;
[0102] The initial state of the natural gas network system and the parameters learned by the model are updated using the loss function. When the update termination condition is met, the parameter values of the natural gas network system model are determined.
[0103] In some specific embodiments, the loss function for identifying parameters of the natural gas network system model is set as follows: Where L represents the loss function, T represents the total number of time points, and L t Let λ represent the error vector between the output value and the measured value of the natural gas network system model at time t, and let λ represent the weight hyperparameter. θ represents the parameter values learned by the natural gas network system model, and θ0 represents the initial parameter estimates of the natural gas network system model. y represents the output value of the natural gas network system model. t It represents the vector formed by the measured variables at each actual node at time t. The actual node refers to the intersection point between pipelines in the natural gas network.
[0104] In some specific embodiments, the initial state of the natural gas network system and the parameters learned by the model are updated in conjunction with the loss function, including the following steps:
[0105] by Update h0, where h0 represents the initial state of the natural gas network system, L represents the loss function, and α h This represents the learning rate hyperparameter of h0;
[0106] by renew in, α represents the parameter values learned from the natural gas network system model. θ express The learning rate hyperparameter.
[0107] In some specific embodiments, by Sure Where T represents the total number of time points, p represents a time point, and S represents a constant matrix used to select independent state variables from the state variables. The state variables refer to the state variables of the natural gas network system model. h t Indicates time t by π t and G t The state variable vector formed by splicing, π t G represents the vector formed by the gas pressure variables at each computation node at time t. A computation node refers to a virtual node in the natural gas network used for computation. t π represents the vector formed by the airflow variables at each calculation node at time t. i,t G represents the air pressure at node i at time t, where i represents the node number. i,t S represents the natural gas flow rate at node i at time t. s J represents the set of all compute node IDs. (1) The top-left block matrix among the four block matrices representing the inverse of matrix K(θ), where K(θ) represents a sparse matrix composed of parameters θ, θ represents the parameter vector of the natural gas network to be identified, and H represents a constant matrix used to select output variables, where the output variables refer to the output variables of the natural gas network system model. Among them, y t This represents the vector formed by the measured variables at each actual node at time t. An actual node refers to the intersection point between pipelines in the natural gas network. n,t Represents the measured variable at the actual node n at time t; This represents the air pressure at actual node n at time t, where n represents the actual node number. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G y represents the set of actual node numbers for natural gas flow control. T-p The vector representing time Tp is composed of the measured variables at each actual node.
[0108] pass
[0109]
[0110] Sure The kth element Where, r (1) Representation matrix J (1) The number of rows, r (2) Representation matrix J (2) The number of rows, J (2) Let K(θ) be the top-right block matrix among the four block matrices representing the inverse of matrix K(θ), where K(θ) is a sparse matrix composed of parameters θ, θ represents the natural gas network parameter vector to be identified, and c is the top-right block matrix among the four block matrices representing the inverse of matrix K(θ). (1) Representation matrix J (1) The number of columns, c (2) Representation matrix J (2) The number of columns, Representation matrix J (1) The element in row iA and column jA, Representation matrix J (2) The element in row iA and column jA, Let λ represent the identification result of the k-th parameter, λ represent the weight hyperparameter, and θ0 represent the initial parameter estimates of the natural gas network system model. express The element in row iA and column jA, express The element in row iA and column jA;
[0111] pass Sure pass Sure Among them, h t-1 Indicates time t-1 is determined by π t-1 and G t-1 The state variable vector formed by splicing, π t-1 G represents the vector formed by the air pressure variables at each computation node at time t. t-1 U represents the vector formed by the airflow variables at each computation node at time t. t This represents a vector at time t composed of the control variables of each actual node. The control variables refer to the control variables of the natural gas network system model. Among them, u t u represents the vector formed by the control variables of each actual node at time t. n,t This represents the control variable at actual node n at time t, where n represents the actual node number. This represents the actual air pressure at node n at time t. N represents the actual injected natural gas flow rate at node n at time t. π N represents the set of actual node numbers for air pressure control. G This represents the set of actual node numbers for natural gas flow control.
[0112] In this embodiment, the method proposed in this invention can achieve physical interpretability of natural gas network parameters. Compared with existing methods, it does not rely on the precise system model parameters of the natural gas network, but can achieve parameter identification of the system solely based on the network measurement results. At the same time, the established natural gas system is a linear dynamic model with high accuracy and can be widely used in simulation calculations and scheduling decisions.
[0113] Based on the same inventive concept, embodiments of the present invention also provide a natural gas network system model, which is constructed by the aforementioned natural gas network system model construction method.
[0114] Based on the same inventive concept, this embodiment of the invention also provides a natural gas network system model parameter identification device, which uses the aforementioned natural gas network system model parameter identification method to perform parameter identification.
[0115] Those skilled in the art can change the above order without departing from the scope of protection of this disclosure. Any modifications, additions, and equivalent substitutions made within the principles of this invention shall still fall within the patent coverage of this invention.
Claims
1. A method for constructing a natural gas network system model, characterized in that, Includes the following steps: A physical model of the partial differential dynamic equations of a natural gas pipeline is constructed. This physical model is then discretized into a difference equation model. Topological constraints and variables of the natural gas network are set. The difference equation model, topological constraints, and natural gas network variables are then rearranged to obtain the difference state equations. in, Indicates by parameters The sparse matrix formed by them This represents the vector of parameters of the natural gas network to be identified. Indicates time t A vector composed of the gas pressures at each actual node, where an actual node refers to the intersection of pipelines in the natural gas network. Indicates time t A vector composed of the control variables of each actual node. Indicates time t Depend on and The state variable vector formed by splicing Indicates time t A vector composed of gas pressure variables at each computation node, where a computation node is a virtual node in the natural gas network used for calculations. Indicates time t A vector composed of airflow variables at each calculation node. Indicates time t -1 by and The state variable vector formed by splicing Indicates time t A vector composed of the air pressure variables at each calculation node. Indicates time t A vector composed of airflow variables at each calculation node. This represents the constant matrix used to select the independent state variables from the state variables, where the state variables refer to the state variables of the natural gas network system model. ,in, Indicates time t compute nodes i The air pressure at that location i Indicates the compute node number. Indicates time t compute nodes i Natural gas flow rate at the location Represents the set of all compute node IDs; Based on the aforementioned differential state equations, the natural gas network system model is constructed as follows: in, to Representation matrix The four block matrices, Representation matrix The inverse matrix, This represents the constant matrix used to select the output variables, which refer to the output variables of the natural gas network system model. ,in, Indicates time t A vector composed of the measured variables at each actual node. Indicates time t actual node n Measurement variables at the location; Indicates time t actual node n The air pressure at that location n Indicates the actual node number. Indicates time t actual node n The injected natural gas flow rate at the location, This represents the set of actual node numbers for air pressure control. This represents the set of actual node numbers for natural gas flow control.
2. The method as described in claim 1, characterized in that, Constructing a physical model of the partial differential dynamic equations for a natural gas pipeline includes the following steps: Use Euler's formula to describe the dynamics of natural gas in a natural gas pipeline. in, The symbol is for partial differentials. ρ Indicates the density of natural gas. v Indicates the natural gas flow rate. x Indicates location, π Indicates natural gas pressure. λ Indicates the friction coefficient of natural gas pipelines. D Indicates the diameter of the natural gas pipeline. g Represents gravitational acceleration. α Indicates the angle between the natural gas pipeline and the horizontal plane; Will Simplified to , The pressure and flow rate of natural gas are expressed as follows: and in, u Indicates the speed of sound. G Indicates natural gas flow rate. A This represents the cross-sectional area of the natural gas pipeline. Will Expanding the quadratic term at the base velocity, we get: , v b Indicates the base value of natural gas flow rate; Will , and Substitute and The physical model of the partial differential dynamic equations of the natural gas pipeline was obtained. 。 3. The method as described in claim 1, characterized in that, The difference equation model is as follows: in, Indicates time t compute nodes i The air pressure at that location i This indicates the compute node number. A compute node is a virtual node in the natural gas network used for computation. u Indicates the speed of sound. Represents discrete time intervals. Indicates pipeline l cross-sectional area, l Indicates the pipe number. Indicates pipeline l Discrete length intervals, Indicates time t compute nodes i Natural gas flow rate at the location Indicates time t compute nodes i Natural gas flow rate at -1 Indicates time t -1 compute node i The air pressure at that location Indicates pipeline l The coefficient of friction, Indicates pipeline l The baseline flow velocity, Indicates pipeline l The diameter, Indicates time t compute nodes i The air pressure at -1 Indicates time t -1 compute node i Natural gas flow rate at the location.
4. The method as described in claim 1, characterized in that, Setting topology constraints for a natural gas network includes the following steps: Set gas pressure topology constraints for natural gas network nodes. ,in, Indicates time t compute nodes i The air pressure at that location i This indicates the compute node number. A compute node is a virtual node in the natural gas network used for computation. Indicates time t actual node n The air pressure at that location n This indicates the actual node number. An actual node refers to the intersection point between pipelines in a natural gas network. Indicates the location of the actual node n The set of computation node numbers at the location; Configure gas flow topology constraints for natural gas network nodes. ,in, Indicates time t compute nodes i Natural gas flow rate at the location Indicates time t actual node n The injected natural gas flow rate at the location, Indicates the flow into the actual node n The set of compute node numbers, Indicates time t compute nodes j Natural gas flow rate at the location j Indicates the compute node number. Indicates the actual node flowing out. n The set of compute node numbers, Set compressor pressurization constraints in the natural gas network. ,in, Indicates time t compute nodes j The air pressure at that location Indicates time t No. k The boost pressure value of each compressor, k Indicates the compressor number. Indicates the inflow of the first k A set of compute node numbers for each compressor. Indicates the outflow of the first k A set of compute node numbers for each compressor.
5. The method as described in claim 1, characterized in that, Setting up natural gas network variables includes the following steps: Set control variables for the natural gas network system model ,in, Indicates time t A vector composed of the control variables of each actual node. Indicates time t actual node n Control variables at the location, n This indicates the actual node number. An actual node refers to the intersection point between pipelines in a natural gas network. Indicates the definition symbol, Indicates time t actual node n The air pressure at that location Indicates time t actual node n The injected natural gas flow rate at the location, This represents the set of actual node numbers for air pressure control. A set representing the actual node numbers for natural gas flow control; Set the output variables of the natural gas network system model. ,in, Indicates time t A vector composed of the measured variables at each actual node. Indicates time t actual node n Measurement variables at the location; Set the state variables for the natural gas network system model. ,in, Indicates time t A vector composed of gas pressure variables at each computation node, where a computation node is a virtual node in the natural gas network used for calculations. Indicates time t compute nodes i The air pressure at that location i Indicates the compute node number. Indicates time t A vector composed of airflow variables at each calculation node. Indicates time t compute nodes i Natural gas flow rate at the location Represents the set of all compute node IDs. Indicates time t Depend on and The state variable vector formed by splicing.
6. A method for identifying parameters of a natural gas network system model, characterized in that, Includes the following steps: A physical model of the partial differential dynamic equations of a natural gas pipeline is constructed. This physical model is then discretized into a difference equation model. Topological constraints and variables of the natural gas network are set. The difference equation model, topological constraints, and natural gas network variables are then rearranged to obtain the difference state equations. in, Indicates by parameters The sparse matrix formed by them This represents the vector of parameters of the natural gas network to be identified. Indicates time t A vector composed of the gas pressures at each actual node, where an actual node refers to the intersection of pipelines in the natural gas network. Indicates time t A vector composed of the control variables of each actual node. Indicates time t Depend on and The state variable vector formed by splicing Indicates time t A vector composed of gas pressure variables at each computation node, where a computation node is a virtual node in the natural gas network used for calculations. Indicates time t A vector composed of airflow variables at each calculation node. Indicates time t -1 by and The state variable vector formed by splicing Indicates time t A vector composed of the air pressure variables at each calculation node. Indicates time t A vector composed of airflow variables at each calculation node. This represents the constant matrix used to select the independent state variables from the state variables, where the state variables refer to the state variables of the natural gas network system model. ,in, Indicates time t compute nodes i The air pressure at that location i Indicates the compute node number. Indicates time t compute nodes i Natural gas flow rate at the location Represents the set of all compute node IDs; Based on the aforementioned differential state equations, a natural gas network system model is constructed as follows: in, to Representation matrix The four block matrices, Representation matrix The inverse matrix, This represents the constant matrix used to select the output variables, which refer to the output variables of the natural gas network system model. ,in, Indicates time t A vector composed of the measured variables at each actual node. Indicates time t actual node n Measurement variables at the location; Indicates time t actual node n The air pressure at that location n Indicates the actual node number. Indicates time t actual node n The injected natural gas flow rate at the location, This represents the set of actual node numbers for air pressure control. A set representing the actual node numbers for natural gas flow control; The parameters learned by the natural gas network system model are output. Set the loss function for the natural gas network system model parameters; The initial state of the natural gas network system and the parameters learned by the model are updated using the loss function. When the update termination condition is met, the parameter values of the natural gas network system model are determined.
7. The method as described in claim 6, characterized in that, The loss function for identifying parameters in the natural gas network system model is set as follows: ,in, Represents the loss function. This represents the total number of moments. Indicates time t The error vector between the output value and the measured value of the natural gas network system model. This represents the weight hyperparameter. This represents the parameter values learned from the natural gas network system model. This represents the initial estimates of the parameters of the natural gas network system model. This represents the output value of the natural gas network system model. Indicates time t A vector consisting of measured variables at each actual node, where an actual node refers to the intersection of pipelines in a natural gas network.
8. The method as described in claim 6, characterized in that, The initial state of the natural gas network system and the parameters learned by the model are updated using the loss function, including the following steps: by renew ,in, This indicates the initial state of the natural gas network system. Represents the loss function. express The learning rate hyperparameter; by renew ,in, This represents the parameter values learned from the natural gas network system model. express The learning rate hyperparameter.
9. The method as described in claim 8, characterized in that, pass Sure ,in, This represents the total number of moments. Indicates time, This represents the constant matrix used to select the independent state variables from the state variables, where the state variables refer to the state variables of the natural gas network system model. , Indicates time t Depend on and The state variable vector formed by splicing Indicates time t A vector composed of gas pressure variables at each computation node, where a computation node is a virtual node in the natural gas network used for calculations. Indicates time t A vector composed of airflow variables at each calculation node. Indicates time t compute nodes i The air pressure at that location i Indicates the compute node number. Indicates time t compute nodes i Natural gas flow rate at the location Represents the set of all compute node IDs. Representation matrix The top-left block matrix among the four block matrices of the inverse matrix. Indicates by parameters The sparse matrix formed by them This represents the vector of parameters of the natural gas network to be identified. This represents the constant matrix used to select the output variables, which refer to the output variables of the natural gas network system model. ,in, Indicates time t A vector composed of measured variables at each actual node, where an actual node refers to the intersection of pipelines in the natural gas network. Indicates time t actual node n Measurement variables at the location; Indicates time t actual node n The air pressure at that location n Indicates the actual node number. Indicates time t actual node n The injected natural gas flow rate at the location, This represents the set of actual node numbers for air pressure control. This represents the set of actual node numbers for natural gas flow control. Indicates time A vector composed of the measured variables at each actual node; pass Sure The k element ,in, Representation matrix the number of rows, Representation matrix the number of rows, Representation matrix The top-right block matrix among the four block matrices of the inverse matrix. Indicates by parameters The sparse matrix formed by them This represents the vector of parameters of the natural gas network to be identified. Representation matrix The number of columns, Representation matrix The number of columns, Representation matrix The iA Line number jA Column elements, Representation matrix The iA Line number jA Column elements, Indicates the first k The identification results of each parameter This represents the weight hyperparameter. This represents the initial estimates of the parameters of the natural gas network system model. express The iA Line number jA Column elements, express The iA Line number jA Column elements; pass Sure ,pass Sure ,in, Indicates time t -1 by and The state variable vector formed by splicing Indicates time t A vector composed of the air pressure variables at each calculation node. Indicates time t A vector composed of airflow variables at each calculation node. Indicates time t A vector composed of control variables from each actual node, where the control variables refer to the control variables of the natural gas network system model. ,in, Indicates time t A vector composed of the control variables of each actual node. Indicates time t actual node n Control variables at the location, n Indicates the actual node number. Indicates time t actual node n The air pressure at that location Indicates time t actual node n The injected natural gas flow rate at the location, This represents the set of actual node numbers for air pressure control. This represents the set of actual node numbers for natural gas flow control.
10. A natural gas network system model, characterized in that, Constructed by the natural gas network system model construction method according to any one of claims 1 to 5.
11. A device for identifying parameters of a natural gas network system model, characterized in that, The parameters are identified using the natural gas network system model parameter identification method as described in any one of claims 6 to 9.