Electricity-gas energy flow rapid analysis method based on gas network global linearization port model

By employing a globally linearized port model and machine learning methods in an integrated electric-gas energy system, the contradiction between energy flow calculation efficiency and accuracy is resolved, achieving efficient and accurate energy flow analysis, which is suitable for rapid analysis of integrated electric-gas energy systems.

CN121766099APending Publication Date: 2026-03-31SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies for energy flow analysis in integrated electric and gas energy systems face problems such as low computational efficiency, insufficient accuracy, and strong dependence on internal information, making them particularly difficult to meet the needs of large-scale system analysis and real-time scheduling scenarios.

Method used

We adopt a global linearized port model based on the gas network and combine it with machine learning methods to identify key parameters. By establishing a global linearized port model and performing order reduction processing, we construct an efficient electro-gas energy flow analysis method. We use Koopman operator theory and time delay embedding to process nonlinear dynamic systems, eliminate internal variables, establish a unified matrix expression, and optimize parameter identification through the augmented Lagrange method.

Benefits of technology

It achieves efficient and high-precision calculation of electric-gas energy flow, reduces the amount of computation, improves the practicality and timeliness of large-scale energy system analysis and decision-making, and solves the problem that it is difficult to balance computational efficiency and accuracy in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121766099A_ABST
    Figure CN121766099A_ABST
Patent Text Reader

Abstract

The invention discloses a gas network global linearization port model-based electricity-gas energy flow rapid analysis method, which comprises the steps of firstly establishing a global linearization port model of a natural gas network, then identifying key parameters of the port model by adopting a machine learning method, and finally realizing efficient electricity-gas energy flow analysis based on the gas network port model. According to the method, systematic variable elimination and order reduction are carried out on a whole-network dynamic equation, key parameters are identified in combination with a data driving method, and a global linearization port model which is efficient in calculation and can accurately represent the external dynamic characteristics of the complex gas network is obtained; the method can effectively solve the core problems that traditional energy flow calculation efficiency and calculation precision are difficult to give consideration to and dependence on internal complete information is high, so that efficient and high-precision dynamic energy flow calculation of the electricity-gas comprehensive energy system is achieved, and the practicability and timeliness of analysis and decision making of a large-scale energy system are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of integrated energy system operation and analysis, and mainly relates to a rapid analysis method of electric-gas energy flow based on a global linearized port model of a gas network. Background Technology

[0002] The integrated electric-gas energy system, through the deep coupling of the power grid and the natural gas grid, achieves flexible energy conversion and efficient utilization, and is a core component in building a modern energy system. In this system, gas turbines provide rapid peak-shaving capabilities for the power system, while technologies such as power-to-gas conversion offer effective ways to absorb large-scale renewable energy. Therefore, accurate and efficient energy flow analysis of the integrated electric-gas energy system is of paramount importance, forming the basis for ensuring the system's safe and stable operation and achieving optimized scheduling and planning.

[0003] However, existing technologies still face significant challenges in energy flow analysis of integrated electric-gas energy systems. First, natural gas networks inherently possess highly nonlinear and complex dynamic characteristics. Developing high-precision physical models for these networks is computationally intensive and time-consuming, making traditional calculation methods inefficient for large-scale system analysis or scenarios with high real-time requirements, such as online scheduling and fault analysis. Second, accurate gas network models often rely on detailed real-time operational data within the network, such as pressure and flow rates within each pipeline. However, in practical engineering, due to limitations in monitoring equipment, this internal data is often missing or incomplete, significantly restricting the practical application value of high-fidelity models. Summary of the Invention

[0004] To address the shortcomings mentioned in the background, this invention proposes a rapid analysis method for electricity-gas energy flow based on a globally linearized port model of a gas network. First, a globally linearized port model of the natural gas network is established. Then, machine learning methods are used to identify key parameters of the port model. Finally, efficient electricity-gas energy flow analysis is achieved based on the gas network port model. This invention obtains a computationally efficient globally linearized port model that accurately characterizes the complex external dynamic characteristics of the gas network by systematically eliminating and reducing the order of the dynamic equations of the entire network and combining this with data-driven methods to identify key parameters. The proposed method effectively solves the core problems of traditional energy flow calculations, which struggle to balance efficiency and accuracy and are highly dependent on complete internal information. This enables efficient and high-precision dynamic energy flow calculation for integrated electricity-gas energy systems, significantly improving the practicality and timeliness of large-scale energy system analysis and decision-making.

[0005] To achieve the above objectives, the technical solution adopted by this invention is: a rapid analysis method for electro-gas energy flow based on a global linearized port model of a gas network, comprising the following steps:

[0006] S1: Establish a global linearized port model for the natural gas network. This model is based on the fundamental model of the gas network pipeline, elevating the state space to a higher dimension and introducing time-delay embedding. Under constraints at the natural gas network nodes, a unified matrix expression for the linearized gas network is established. After eliminating gas network pipeline variables, internal node variables, and known boundary node variables, the gas network port model is obtained, specifically:

[0007]

[0008] in, and It is the port model coefficient matrix. for A column vector consisting of all boundary unknowns in the natural gas network at any given time. This is a vector representing the historical information of the pipeline. for The known quantities of the boundary of the natural gas network at any given time;

[0009] S2: Establish a parameter identification and optimization model for the gas network port model and a dynamic evolution model for the system, and use machine learning methods to identify key parameters of the port model;

[0010] S3. Establish an electrical-gas energy flow analysis model, and solve the model based on the unified energy flow solution algorithm of the Newton-Raphson method to realize the analysis of electrical-gas energy flow.

[0011] As an improvement of the present invention, step S1 specifically includes the following steps:

[0012] S11. Based on Koopman operator theory, global linearization of a single pipeline in a gas network is achieved: the state variables of the original nonlinear dynamic system of the pipeline are mapped to a high-dimensional linear space through a nonlinear observation function, a linear dynamic evolution equation is constructed, and time delay embedding is introduced; the linear model after the introduction is extended into an extended Koopman equation containing historical information.

[0013] ;

[0014] in, yes The observation vector at time t, It is a column vector consisting of all pipe state variables in the original space. It is a pipe The A Koopman operator for a number of historical embedded states. It is a pipe The A linear operator that embeds historical input quantities. It is the number of embeddings of state variables. It is the number of embeddings of the input. yes Time Pipeline Input quantity;

[0015] S12. Establish constraints at natural gas network nodes: The constraints include at least node pressure continuity, node flow balance and boundary conditions. Specifically, the boundary conditions are: the net external injection / extraction flow of internal transmission nodes is zero.

[0016] S13. Establish a unified matrix expression for the linearized gas network:

[0017] ;

[0018] in, In the pipeline equation linear coefficients, A 0-1 binary selection matrix is ​​used for the nodal pressure balance in the second equation. A 0-1 binary selection matrix is ​​used for flow conservation in third-party processes. This is a 0-1 binary selection matrix used to independently constrain the fourth set of boundary condition equations. To improve the state vector of the entire network pipeline, This is the control input vector for the entire network pipeline. This is the state vector of all nodes in the network. It is a column vector composed of historical data of the pipeline. It is the vector of boundary condition parameters known at the current moment;

[0019] S14. Eliminating Gas Network Pipeline Variables: By eliminating state variables that are dynamically related to the pipeline, a reduced-order model described only by nodal variables is obtained, specifically:

[0020] ;

[0021] in, It is a node state vector. It is the complement of the original system matrix with respect to Schur. It is the constant vector on the right side after dimensionality reduction;

[0022] S15. Eliminating internal node variables and known boundary node variables of the gas network: The node variables are classified and rearranged, and the internal node variables are eliminated using Schur's complement theory to obtain the boundary port model, specifically:

[0023] ;

[0024] in, It is the vector of unknown boundary variables to be solved. and This is a constant coefficient matrix characterizing the port properties, derived through the Schur complement process.

[0025] S16. Construct the expression for the final gas network port model: Construct historical information vectors. Its structure is defined as follows: ;

[0026] The term representing historical influence in the boundary port model is rewritten as a more compact matrix-vector product to obtain the final gas network port model.

[0027] As another improvement of the present invention, step S2 specifically includes the following steps:

[0028] S21. Establish the parameter identification and optimization model of the gas network port model: By analyzing the explicit linear expression between all internal state variables of the pipeline and the historical state and the current boundary input, a reconstruction equation is formed to reconstruct the internal state of the pipeline and establish a dynamic evolution model of the system.

[0029] S22. Construct the augmented Lagrangian function and use machine learning methods to solve the parameter identification problem of the gas network port model, obtaining the final globally linearized gas network port model:

[0030] S23. Solving the optimization problem: The augmented Lagrange method is used to iteratively solve the optimization problem established in step S21. The parameter matrix to be identified, as well as the Lagrange multipliers and penalty parameters, are initialized. The augmented Lagrange function is minimized and the parameters are updated using inner and outer loops. The solution is iteratively solved until the constraints are satisfied and the objective function converges, and the identified key parameters are obtained.

[0031] As another improvement of the present invention, the objective function and constraints for constructing the optimization problem in step S21 are as follows:

[0032]

[0033] in, These are the parameters to be optimized in the gas network port model. This represents the total number of moments. For the internal state variables of the pipeline, the objective function is... To minimize the model's prediction error; Here is the stability constraint function. It is a constant greater than 0. The spectral radius of the matrix is... For the reason The calculated system matrix;

[0034] The augmented Lagrangian function constructed in step S22 Specifically:

[0035]

[0036] in, It is the augmented Lagrange objective function that needs to be minimized in each iteration; These are Lagrange multipliers associated with stability constraints; It is a positive penalty parameter.

[0037] As another improvement of the present invention, step S23 specifically includes the following steps:

[0038] S231: Initialization settings , , , ;in, These are the initial values ​​for the Lagrange multipliers; This is the initial value for the penalty parameter; and These are the initial values ​​for the parameter matrix;

[0039] S232: Inner minimization, fixing the current Lagrange multipliers. and penalty parameters A gradient-based optimization algorithm is used to optimize the augmented Lagrangian function. Minimize the parameters to obtain a set of currently optimal model parameter matrices. and The inner optimization mathematical model is:

[0040] ;

[0041] S233: After the inner solution converges, update the Lagrange multipliers based on the current solution's satisfaction of the constraints. and penalty parameters The value of the Lagrange multiplier update rule is as follows:

[0042]

[0043] Penalty parameter update rules:

[0044]

[0045] in, To penalize growth factors;

[0046] S234: Determine the termination condition; iterate in the outer layer until the constraints of the original problem are satisfied. And the objective function convergence If the maximum number of outer iterations is reached, the iteration will stop.

[0047] As another improvement of the present invention, the electro-gas energy flow analysis model in step S3 is expressed as follows: ,in Is the system at any time The full-state vector is defined as:

[0048] ;

[0049] Unified system of equations It consists of the following three coupled sub-equations, and its mathematical model is as follows:

[0050]

[0051] in, , and These are the AC power flow equations for the power grid, the global linearized port model equations for the gas grid, and the constraint equations for the electro-gas coupling elements, respectively. and These are the voltage magnitude and phase angle vectors of all nodes in the power grid, respectively. and These are the active and reactive power output vectors of the generator nodes in the power grid, respectively. It is the pressure vector of all boundary nodes of the gas network; It is the mass flow rate vector of all boundary nodes of the gas network; It is the electrical power consumed by the electro-gas conversion equipment; It is the electrical power generated by the gas turbine; It is the net injection / outflow mass flow rate of the gas network node where the coupling device is located;

[0052] For the model Before the iterative solution begins, an initial state vector is constructed, and the state vector is continuously corrected until convergence through the iterative process of the Newton-Raphson method.

[0053] As a further improvement of the present invention, step S3, specifically the iterative solution of the electro-gas flow analysis model, includes the following steps:

[0054] S31: Calculate the unbalance vector, and then... The state vector of the next iteration Substitute into the unified energy flow equations Calculate the system imbalance under the current state:

[0055] ;

[0056] S32: Calculate the energy flow equations Regarding the state vector Jacobian matrix and at the current state point Perform the evaluation:

[0057] ;

[0058] S33: Construct and solve the following system of linear equations to obtain the correction amount of the state vector. :

[0059] ;

[0060] S34: Apply the calculated correction to the current state vector to obtain the update value for the next iteration:

[0061]

[0062] After each iteration, it is checked whether the convergence condition is met. The convergence condition is specifically: the maximum norm of the system's imbalance vector is less than the preset convergence accuracy. : If this condition is met, the iteration terminates, and the current state vector is the optimal solution; if not, then let... Then return to step S31 to continue iteratively solving.

[0063] Compared with existing technologies, the present invention has the following advantages: The present invention discloses a rapid analysis method for electricity-gas energy flow based on a globally linearized port model of a gas network. By reducing the model order, the complex nonlinear gas network model is simplified into a globally linearized external port equivalent model, resulting in a computationally efficient globally linearized port model that can accurately characterize the external dynamic characteristics of a complex gas network. By using machine learning methods for parameter identification, the dynamic characteristics of the gas network can be accurately learned from the data. The proposed method can effectively solve the core problem of traditional energy flow calculation efficiency and accuracy being difficult to balance, and is highly dependent on complete internal information. It effectively solves the conflict and contradiction between energy flow calculation efficiency and accuracy, significantly reduces the computational load of electricity-gas joint analysis, realizes efficient and high-precision dynamic energy flow calculation of integrated electricity-gas energy systems, and significantly improves the practicality and timeliness of large-scale energy system analysis and decision-making. Attached Figure Description

[0064] Figure 1 This is a schematic diagram of the integrated energy system structure to which the method of the present invention is applicable;

[0065] Figure 2 This is a flowchart of the steps of the fast analysis method of electric-gas energy flow based on the global linearized port model of the gas network of the present invention;

[0066] Figure 3This is a graph showing the fitting error of the gas network port model parameters in the test example of this invention;

[0067] Figure 4 This is an error diagram of the energy flow calculation results for 20 scenarios in the test examples of this invention;

[0068] Figure 5 This is an error comparison chart from the test examples of this invention. Detailed Implementation

[0069] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0070] Example 1

[0071] A fast method for analyzing electro-gas energy flow based on a globally linearized port model of a gas network, such as... Figure 2 As shown, the specific steps include the following:

[0072] Step S1: Establish a globally linearized port model for the natural gas network:

[0073] S11. Based on Koopman operator theory, achieve global linearization of a single pipeline in a gas network:

[0074] First, establish a basic model of the gas network pipeline:

[0075]

[0076] in, It refers to air pressure; It is airflow; Speed ​​of sound; This refers to the cross-sectional area of ​​the pipe. The coefficient of friction of the pipeline; Pipe diameter.

[0077] By elevating the state space to a higher dimension, the state variables of the original nonlinear dynamic system of the pipeline are transformed through a set of nonlinear "observation functions". This maps to a higher-dimensional linear space. Specifically, for the pipe's state variables, such as the inlet mass flow rate... and export pressure Construct nonlinear basis functions respectively and Then, these basis functions are combined into a high-dimensional observation vector. This vector contains richer information than the original state variables, and its dimension is [missing information]. Through this "lifting" operation, the nonlinear evolutionary relationship in the original state space will be transformed into a linear evolutionary relationship in a high-dimensional observation space.

[0078] Secondly, a linear dynamic evolution equation is constructed. In the enhanced high-dimensional space, the dynamic characteristics of the pipeline can be precisely described by a linear equation:

[0079]

[0080] in, yes The observation vector at time; and It is the Koopman operator matrix under the finite-dimensional approximation; yes The control input vector at each time step; It describes the self-evolution of the system state, while It describes the effect of control inputs on the system state.

[0081] Finally, time-delay embedding is introduced to handle the delay characteristics. Considering the significant time-delay characteristics of natural gas pipeline flow—that is, the current state is not only related to the previous state but also influenced by multiple historical states and inputs over a past period—time-delay embedding is employed to extend the above linear model into an extended Koopman equation incorporating historical information:

[0082]

[0083] in, It is the number of embeddings of state variables. This represents the number of embeddings in the input. The model indicates that at the current time... The state is the past The state at a given moment and the past A linear combination of the inputs at each time step.

[0084] S12. Establish constraints at natural gas network nodes:

[0085] Establish a set of continuity equations for nodal pressure: For slave nodes Outflowing pipe The outlet pressure of the pipeline It must be equal to its starting node. node pressure :

[0086] ,

[0087] in, and Pipes Export and import pressures; For nodes The node pressure; Installed on node The compressor compression ratio at that node. If there is no compressor at that node, then At this point, the inlet pressure of the pipeline is directly equal to the node pressure.

[0088] Establish a system of node flow balance equations: Based on the law of conservation of mass, ensure that at any node, the sum of all mass flows into that node equals the sum of all mass flows out of that node. The mathematical expression is as follows:

[0089]

[0090] in, Is At any moment, from the pipeline Outflow mass flow rate; Is At any time, to the pipeline Inflow mass flow rate; Is At any moment, from the outside to the node Net mass flow rate of injection (positive) or extraction (negative); Based on nodes The set of pipes originating from the point of origin; Based on nodes A collection of pipelines with the endpoint as the destination.

[0091] Establish a system of boundary condition equations: for internal transmission nodes These nodes are neither gas sources nor loads; they are used solely for natural gas transmission. Therefore, their net external injection / extraction flow is zero.

[0092]

[0093] For gas source nodes These nodes represent sources of natural gas, and their node pressures are typically set to known, given values.

[0094]

[0095] For load nodes These nodes represent points of natural gas consumption, and their external net flow is set to the known user demand, typically a negative value.

[0096]

[0097] in, and These are nodes exist The node pressure and net mass flow rate at any given time; Is At any given moment, the gas source node The known source pressure; Is At any given time, the load node The known demand flow; It is the set of all nodes in the network. It is the set of all gas source nodes. It is the set of all load nodes.

[0098] S13. Establish a unified matrix expression for the linearized gas network:

[0099] First, define and integrate all network system variables. This includes the network-wide pipeline elevation state vector. : The high-dimensional observation vector after linearizing all pipelines using the Koopman operator Stacked sequentially; whole network pipeline control input vector : Control input vectors for all pipelines Stacked sequentially, typically containing the pressure at the beginning and end of the pipe and the mass flow rate; the state vector of all network nodes. : The node state vector of all nodes Stacked sequentially, including node pressure and node net injection mass flow rate .

[0100] Subsequently, the three global vectors mentioned above are further integrated to form the total column vector to be solved for the entire linearized gas network system. : .

[0101] Secondly, a unified matrix expression is constructed, centered around the total column vector to be solved. The variables in the equations are used to establish four sets of linear equations that satisfy the network physics laws involved in steps S11 and S12: the pipeline dynamic equation set, the node pressure continuity equation set, the node flow balance equation set, and the boundary condition equation set. These four sets of linear equations are then integrated and arranged to form a large-scale sparse linear equation system, which is expressed in a unified matrix form.

[0102]

[0103] in, It is a column vector composed of historical data of the pipeline. This is the known boundary condition parameter vector at the current moment, and it represents the current control input of the model.

[0104]

[0105]

[0106] in, and It is a time lag The global Koopman operator matrix at time; It refers to At that moment, the gas source nodes The known source pressure value; It refers to At that moment, the load nodes The known demand flow value; and These represent the total number of gas source nodes and load nodes in the network, respectively. This represents the number of internal nodes.

[0107] S14. Eliminate gas network pipeline variables:

[0108] This step aims to reduce the model order of the unified matrix expression for the entire network established in step S1. By eliminating state variables that are dynamically related to the pipeline, a reduced-order model is finally obtained, which is described only by node variables.

[0109] The total column vector to be solved The variables in the pipeline are reorganized into two categories: pipeline variables. and node variables Based on this, the original unified matrix equation for the entire network is rewritten in the following 2x2 block matrix form:

[0110]

[0111] Wherein, submatrix It is derived from the original coefficient matrix Blocks in Recombined, and matrix Full rank and reversible.

[0112] Solving the first row of the above block matrix equation reveals the variables within the pipeline. Represented as node variables Functions:

[0113]

[0114] Subsequently, substituting this expression into the second line of the block matrix equation completely eliminates the variables within the pipeline. After sorting, we can obtain:

[0115]

[0116] Let's write the equation obtained in the previous step in a more compact form:

[0117]

[0118] in, It is the only unknown quantity remaining in the system, namely the node state vector; , is the original system matrix about The Schur complement forms a new, lower-dimensional coefficient matrix that describes the equivalent coupling relationships between nodes; , is the new right-hand constant vector.

[0119] S15. Eliminate internal node variables and known boundary node variables of the gas network:

[0120] First, the node variables are classified and rearranged. This involves removing the pipeline variables from the model's node variable vectors. Divided into three different groups:

[0121] Internal node variables The set of variables to be determined for all non-boundary nodes in the network, such as the set of pressure and net flow.

[0122] Known boundary variables : Parameters known at the boundary nodes, such as a given pressure at the gas source point or a given consumption flow rate at the load point;

[0123] Unknown boundary variables : The quantity to be solved at the boundary node, such as the flow rate that the gas source point needs to provide, or the pressure that the load point needs to reach;

[0124] Based on this classification, the original equation coefficient matrix in The columns are reordered to obtain a new, rearranged equivalent linear system.

[0125] Secondly, Schur's complement theory is used to eliminate internal node variables. The rearranged system is then rewritten as a 2x2 block matrix; this partitioning is to eliminate internal node variables. Boundary known variables With unknown boundary variables Separately. Its form is as follows:

[0126]

[0127] Wherein, submatrix It is reversible. Applying the Schur's complement method again, we first express from the first row of equations... Then, substituting this into the second line of the equation completely eliminates all internal node variables and known boundary node variables. After simplification, a reduced-order equation containing only boundary variables is obtained, which is composed of a new constant matrix that depends only on the network topology. leading.

[0128] By rearranging and solving the equation obtained in the previous step, which only contains boundary variables, we finally obtain the unknown boundary variables. An explicit expression for all known quantities. This expression is the port model that eliminates the internal nodes of the gas network, also known as the boundary port model, and its final form is:

[0129]

[0130] in, It is the vector of unknown boundary variables to be solved. and This is a constant coefficient matrix characterizing the port properties, derived through the Schur complement process.

[0131] S16. Construct the expression for the final gas network port model:

[0132] To represent all terms related to historical dynamics in the model in a unified way, we first construct a single, complete historical information vector. This vector is generated by stacking the boosted state vectors of all pipelines in the entire network over a past time window. and control input vector It is thus formed. Its structure is defined as follows:

[0133] ;

[0134] Using the newly defined historical information vector The items representing historical influences in the boundary port model can be... Rewritten as a more compact matrix-vector product Thus, the final form of the gas network port model is obtained:

[0135]

[0136] in, and These are the final, constant port model coefficient matrices, which linearly map the system's historical dynamics and current boundary conditions to the model's output, respectively.

[0137] Step S2: Identify key parameters of the port model using machine learning methods:

[0138] S21. Establish a parameter identification and optimization model for the gas network port model.

[0139] First, the internal state of the pipeline is reconstructed. According to the global linearized port model of the gas network, at the current moment... Based on the gas network port model and the power grid model, the variables of the electro-gas coupling nodes can be determined, thus obtaining the complete system boundary. With input vector In order to achieve the state vector at the next time step. The recursive update needs to be based on and Reconstruct the internal state of the pipeline.

[0140] State reconstruction is the reverse operation of the elimination processes in steps S14 and S15. The state obtained in S1... This is then substituted back into the intermediate state equations, which were retained during the Schur elimination process and describe the relationship between the internal and boundary states. Through this reverse recursion, all internal state variables of the pipeline can be directly analyzed. With historical status and current boundary input The explicit linear expression between them forms the following reconstruction equation:

[0141]

[0142] in, and This is the constant coefficient matrix that describes the linear mapping relationship.

[0143] Secondly, a dynamic evolution model of the system is established. The dynamic evolution process of the gas network port model is described by a first-order linear state-space equation:

[0144] ,

[0145] This equation describes the system's historical information vector. How it evolves over time. Among them, the state transition matrix... The structure is based on historical information vectors The definition, and the parameter matrix to be identified. The only certainty.

[0146] Finally, to identify the parameters in the linear state-space equations and The optimization problem is constructed to solve for the parameters to be identified. The mathematical model of its objective function and constraints is as follows:

[0147]

[0148] Wherein, objective function Defined as minimizing the model prediction error; constraint function Defined as the long-term dynamic stability guarantee of the system; It is a constant that is slightly greater than 0.

[0149] S22. Machine learning methods are used to solve the parameter identification and optimization problem of the gas network port model, resulting in the final globally linearized gas network port model:

[0150] First, the augmented Lagrangian function is constructed. This is because the optimization problem established in step S21 involves complex nonlinear spectral norm constraints. This step employs the augmented Lagrange method for efficient solution. The core idea of ​​this method is to transform the original, difficult-to-handle constrained optimization problem into a series of more easily solvable unconstrained optimization subproblems by introducing Lagrange multipliers and penalty function terms. Specifically, this method constructs the following augmented Lagrange function. :

[0151]

[0152] in, It is the augmented Lagrange objective function that needs to be minimized in each iteration; It is the objective function of the original optimization problem, i.e., the prediction error of the model; It is the stability constraint function of the original optimization problem; These are Lagrange multipliers associated with stability constraints; It is a positive penalty parameter.

[0153] S23. Solving the parameter optimization problem of the gas network port model:

[0154] Step 1: Initialization settings , , , ;in, These are the initial values ​​for the Lagrange multipliers; This is the initial value for the penalty parameter; and These are the initial values ​​for the parameter matrix;

[0155] Step 2: Inner minimization, fixing the current Lagrange multipliers. and penalty parameters A gradient-based optimization algorithm is used to optimize the augmented Lagrangian function. Minimize the parameters to obtain a set of currently optimal model parameter matrices. and The mathematical model is:

[0156]

[0157] Step 3: After the inner solution converges, update the Lagrange multipliers based on the current solution's satisfaction of the constraints. and penalty parameters The value of is used to guide the solution direction of the next inner iteration to get closer to the optimal solution that satisfies the constraints. Lagrange multiplier update rule:

[0158]

[0159] Penalty parameter update rules:

[0160]

[0161] in, To penalize growth factors.

[0162] Step 4: Determine the termination condition, iterate in the outer layer until the constraints of the original problem are satisfied. And the objective function convergence( If the maximum number of outer iterations is reached, the iteration stops, and the final parameters are obtained. .

[0163] Step S3: Achieve efficient electro-gas energy flow analysis based on the gas network port model:

[0164] S31. Establish an electrical-gas flow analysis model:

[0165] The unified energy flow model is a large system of nonlinear algebraic equations, which can be expressed as follows: ,in Is the system at any time The full-state vector can be defined as:

[0166]

[0167] Unified system of equations Its mathematical model consists of the following three coupled sub-equations:

[0168]

[0169] in, , and These are the AC power flow equations for the power grid, the global linearized port model equations for the gas grid, and the constraint equations for the electro-gas coupling elements, respectively. and These are the voltage magnitude and phase angle vectors of all nodes in the power grid, respectively. and These are the active and reactive power output vectors of the generator nodes in the power grid, respectively. It is the pressure vector of all boundary nodes of the gas network; It is the mass flow rate vector of all boundary nodes of the gas network; It is the electrical power consumed by the power-to-gas (P2G) equipment; It is the electrical power generated by the gas turbine (GT); It is the net injection / outflow mass flow rate of the gas network node where the coupling device is located. It represents the amount of natural gas produced by the P2G device or the amount of natural gas consumed by the gas turbine.

[0170] Treating this unified interface system as a whole, numerical methods such as the Newton-Raphson method are used for synchronous and integrated solution. The solution result of this step includes the solution at that moment. The complete state of the power grid, and the crucial, previously unknown gas grid boundary condition vector. The values ​​of the coupling variables in the data.

[0171] S32. Unified energy flow solution algorithm based on Newton-Raphson method:

[0172] First, regarding the model Before starting the iterative solution, perform the following initialization:

[0173] Set convergence precision A preset, extremely small positive number used to determine whether the iteration has converged;

[0174] Construct the initial state vector : for the current moment The state vector is set with an initial guess value. Typically, to improve convergence speed, the value from the previous time step is used. The convergent solution is used as the initial value:

[0175]

[0176] in, yes The final convergent solution at time t. For the initial time t. The nominal or estimated state of the system can be used.

[0177] Secondly, the algorithm continuously corrects the state vector through an iterative process using the Newton-Raphson method until convergence. For the ... Next iteration:

[0178] Step 1: Calculate the unbalance vector. (The text abruptly ends here.) The state vector of the next iteration Substitute into the unified energy flow equations Calculate the system imbalance under the current state:

[0179]

[0180] The vector Each element represents the degree of power imbalance, flow imbalance, or lack of coupling relationship among the nodes in the system.

[0181] Step 2: Form the Jacobian matrix. Calculate the energy flow equations. Regarding the state vector Jacobian matrix and at the current state point Perform the evaluation:

[0182]

[0183] Elements of the Jacobian matrix This reflects the sensitivity of the system's imbalance to changes in state variables.

[0184] Step 3: Solve the system of linear corrected equations.

[0185] Construct and solve the following system of linear equations to obtain the correction amount of the state vector. :

[0186]

[0187] Step 4: Update the state vector.

[0188] The calculated correction is applied to the current state vector to obtain the update value for the next iteration:

[0189]

[0190] After each iteration, check whether the convergence condition is met. A common criterion is that the maximum norm of the system's imbalance vector is less than the preset convergence accuracy. :

[0191]

[0192] If this condition is met, the iteration terminates, and the current state vector is the optimal solution. If not, then let... Return to step 1 and continue iterating.

[0193] Test case

[0194] The integrated electric-gas energy system in this embodiment consists of an IEEE 9-node power system and an 11-node natural gas network, and its specific system structure is as follows: Figure 1As shown. In the natural gas network, the boundary conditions include a gas source node with a specified pressure, a gas source node with a specified flow rate, and two conventional load nodes with specified flow rates. The system includes a gas turbine and an electric-to-gas (EPG) unit as coupling elements: the gas turbine acts as a balancing node for the power system and a load for the natural gas network; the EPG unit acts as a load for the power system while simultaneously producing and injecting natural gas into the natural gas network. All energy flow calculations in this embodiment are performed within a 24-hour operating cycle.

[0195] According to the present invention Figure 2 The process shown describes the energy flow analysis of the aforementioned integrated electric-gas energy system. The specific process and results are as follows: First, the 11-node natural gas network is modeled and its parameters are identified to establish its globally linearized port model. Step S3 of this invention is used to identify the model parameter matrix through a data-driven approach. Figure 3 The error in fitting the gas network port model parameters in this embodiment is illustrated. As shown in the figure, the model predictions closely match the actual values, verifying the high accuracy of the parameter identification method. Subsequently, the trained gas network port model is embedded into the electro-gas energy flow analysis framework to calculate the system dynamic energy flow under 20 different operating scenarios. Figure 4 The results show the comparison error between the method of this invention and the traditional high-precision energy flow calculation results in these 20 scenarios. Figure 5 This provides a more intuitive comparison of the error magnitudes of various methods. From Figure 4 and Figure 5 As can be seen, the method of the present invention maintains high computational accuracy in all scenarios, and the relative error is always kept at an extremely low level.

[0196] To verify the computational efficiency advantage of this invention, the following table compares the solution time of the method of this invention with that of traditional high-precision energy flow calculation numerical methods:

[0197] Table 1

[0198]

[0199] As can be seen from the data in Table 1 above, the computation speed of the method of the present invention is far superior to that of the traditional method, and the computational efficiency is significantly improved.

[0200] Therefore, this method can accurately establish a global linearized port model of complex natural gas pipeline networks through a data-driven approach, effectively solving the problem of traditional models' strong dependence on complete internal information. Furthermore, it can significantly shorten energy flow calculation time while maintaining extremely high computational accuracy, successfully resolving the core contradiction between computational accuracy and efficiency. This method can provide a practical tool that combines speed and accuracy for energy flow analysis of integrated electric-gas energy systems.

[0201] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0202] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.

Claims

1. A rapid analysis method for electro-gas energy flow based on a globally linearized port model of a gas network, characterized in that, Includes the following steps: S1: Establish a global linearized port model for the natural gas network. This model is based on the fundamental model of the gas network pipeline, elevating the state space to a higher dimension and introducing time-delay embedding. Under constraints at the natural gas network nodes, a unified matrix expression for the linearized gas network is established. After eliminating gas network pipeline variables, internal node variables, and known boundary node variables, the gas network port model is obtained, specifically: ; in, and It is the port model coefficient matrix. for A column vector consisting of all boundary unknowns in the natural gas network at any given time. This is a vector representing the historical information of the pipeline. for The known quantities of the boundary of the natural gas network at any given time; S2: Establish a parameter identification and optimization model for the gas network port model and a dynamic evolution model for the system, and use machine learning methods to identify key parameters of the port model; S3. Establish an electrical-gas energy flow analysis model, and solve the model based on the unified energy flow solution algorithm of the Newton-Raphson method to realize the analysis of electrical-gas energy flow.

2. The method for rapid analysis of electro-gas energy flow based on a globally linearized port model of a gas network according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11. Based on Koopman operator theory, global linearization of a single pipeline in a gas network is achieved: the state variables of the original nonlinear dynamic system of the pipeline are mapped to a high-dimensional linear space through a nonlinear observation function, a linear dynamic evolution equation is constructed, and time delay embedding is introduced; the linear model after the introduction is extended into an extended Koopman equation containing historical information. ; in, yes The observation vector at time t, It is a column vector consisting of all pipe state variables in the original space. It is a pipe The A Koopman operator for a number of historical embedded states. It is a pipe The A linear operator that embeds historical input quantities. It is the number of embeddings of state variables. It is the number of embeddings of the input. yes Time Pipeline Input quantity; S12. Establish constraints at natural gas network nodes: The constraints include at least node pressure continuity, node flow balance and boundary conditions. Specifically, the boundary conditions are: the net external injection / extraction flow of internal transmission nodes is zero. S13. Establish a unified matrix expression for the linearized gas network: ; in, In the pipeline equation linear coefficients, A 0-1 binary selection matrix is ​​used for the nodal pressure balance in the second equation. A 0-1 binary selection matrix is ​​used for flow conservation in third-party processes. This is a 0-1 binary selection matrix used to independently constrain the fourth set of boundary condition equations. To improve the state vector of the entire network pipeline, This is the control input vector for the entire network pipeline. This is the state vector of all nodes in the network. It is a column vector composed of historical data of the pipeline. It is the vector of boundary condition parameters known at the current moment; S14. Eliminating Gas Network Pipeline Variables: By eliminating state variables that are dynamically related to the pipeline, a reduced-order model described only by nodal variables is obtained, specifically: ; in, It is a node state vector. It is the complement of the original system matrix with respect to Schur. It is the constant vector on the right side after dimensionality reduction; S15. Eliminating internal node variables and known boundary node variables of the gas network: The node variables are classified and rearranged, and the internal node variables are eliminated using Schur's complement theory to obtain the boundary port model, specifically: ; in, It is the vector of unknown boundary variables to be solved. and This is a constant coefficient matrix characterizing the port properties, derived through the Schur complement process. S16. Construct the expression for the final gas network port model: Construct historical information vectors. Its structure is defined as follows: ; The term representing historical influence in the boundary port model is rewritten as a more compact matrix-vector product to obtain the final gas network port model.

3. The method for rapid analysis of electro-gas energy flow based on a globally linearized port model of a gas network according to claim 1, characterized in that: Step S2 specifically includes the following steps: S21. Establish the parameter identification and optimization model of the gas network port model: By analyzing the explicit linear expression between all internal state variables of the pipeline and the historical state and the current boundary input, a reconstruction equation is formed to reconstruct the internal state of the pipeline and establish a dynamic evolution model of the system. S22. Construct an augmented Lagrangian function and use machine learning methods to solve the parameter identification problem of the gas network port model, so as to obtain the final global linearized gas network port model. S23. Solving the optimization problem: The augmented Lagrange method is used to iteratively solve the optimization problem established in step S21. The parameter matrix to be identified, as well as the Lagrange multipliers and penalty parameters, are initialized. The augmented Lagrange function is minimized and the parameters are updated using inner and outer loops. The solution is iteratively solved until the constraints are satisfied and the objective function converges, and the identified key parameters are obtained.

4. The method for rapid analysis of electro-gas energy flow based on a globally linearized port model of a gas network according to claim 3, characterized in that: The objective function and constraints for constructing the optimization problem in step S21 are as follows: ; in, These are all parameters to be optimized in the gas network port model. Total number of time points For the internal state variables of the pipeline, the objective function is... To minimize the model's prediction error; Here is the stability constraint function. It is a constant greater than 0. The spectral radius of the matrix is... For the reason The calculated system matrix; The augmented Lagrangian function constructed in step S22 Specifically: ; in, It is the augmented Lagrange objective function that needs to be minimized in each iteration; These are Lagrange multipliers associated with stability constraints; It is a positive penalty parameter.

5. The method for rapid analysis of electro-gas energy flow based on a globally linearized port model of a gas network according to claim 4, characterized in that: Step S23 specifically includes the following steps: S231: Initialization settings , , , ;in, These are the initial values ​​for the Lagrange multipliers; This is the initial value for the penalty parameter; and These are the initial values ​​for the parameter matrix; S232: Inner minimization, fixing the current Lagrange multipliers. and penalty parameters A gradient-based optimization algorithm is used to optimize the augmented Lagrangian function. Minimize the parameters to obtain a set of currently optimal model parameter matrices. and The inner optimization mathematical model is: ; S233: After the inner solution converges, update the Lagrange multipliers based on the current solution's satisfaction of the constraints. and penalty parameters The value of the Lagrange multiplier update rule is as follows: ; Penalty parameter update rules: ; in, To penalize growth factors; S234: Determine the termination condition; iterate in the outer layer until the constraints of the original problem are satisfied. And the objective function convergence If the maximum number of outer iterations is reached, the iteration will stop.

6. The method for rapid analysis of electro-gas energy flow based on a globally linearized port model of a gas network according to claim 1, characterized in that: The electrical-gas flow analysis model in step S3 is expressed as follows: ,in Is the system at any time The full-state vector is defined as: ; Unified system of equations It consists of the following three coupled sub-equations, and its mathematical model is as follows: ; in, , and These are the AC power flow equations for the power grid, the global linearized port model equations for the gas grid, and the constraint equations for the electro-gas coupling elements, respectively. and These are the voltage magnitude and phase angle vectors of all nodes in the power grid, respectively. and These are the active and reactive power output vectors of the generator nodes in the power grid, respectively. It is the pressure vector of all boundary nodes of the gas network; It is the mass flow rate vector of all boundary nodes of the gas network; It is the electrical power consumed by the electro-gas conversion equipment; It is the electrical power generated by the gas turbine; It is the net injection / outflow mass flow rate of the gas network node where the coupling device is located; For the model Before the iterative solution begins, an initial state vector is constructed, and the state vector is continuously corrected until convergence through the iterative process of the Newton-Raphson method.

7. The method for rapid analysis of electro-gas energy flow based on a globally linearized port model of a gas network according to claim 6, characterized in that: In step S3, the iterative solution of the electro-electric energy flow analysis model specifically includes the following steps: S31: Calculate the unbalance vector, and then... The state vector of the next iteration Substitute into the unified energy flow equations Calculate the system imbalance under the current state: ; S32: Calculate the energy flow equations Regarding the state vector Jacobian matrix and at the current state point Evaluate: ; S33: Construct and solve the following system of linear equations to obtain the correction amount of the state vector. : ; S34: Apply the calculated correction to the current state vector to obtain the update value for the next iteration: ; After each iteration, it is checked whether the convergence condition is met. The convergence condition is specifically: the maximum norm of the system's imbalance vector is less than the preset convergence accuracy. : If this condition is met, the iteration terminates, and the current state vector is the optimal solution; if not, then let... Then return to step S31 to continue iteratively solving.