Improved newton method based power flow calculation method for electro-gas-hydrogen integrated energy system
By constructing an extended model for unified energy flow calculation of electricity, gas, and hydrogen, and using an improved Newton's method and PSO algorithm to optimize the coupled equipment, the problem of real-time collaborative optimization of energy flow calculation in the integrated electricity-gas energy system was solved. This enabled rapid response and efficient power balance for distributed new energy sources, and improved the numerical stability and computational efficiency of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENYANG UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2026-04-02
- Publication Date
- 2026-06-19
AI Technical Summary
Existing energy flow calculation methods for integrated electric-gas energy systems lack a real-time collaborative optimization mechanism for participating factors, making it difficult to respond quickly to fluctuations. They also ignore the dynamic characteristics brought about by the mixing of multiple distributed gas sources on the gas grid side, resulting in large deviations in pipeline flow and node pressure calculations. They are unable to balance numerical stability and convergence efficiency, and thus cannot meet the EFC requirements of complex EGHIES.
An extended model for calculating the unified energy flow of electricity, gas, and hydrogen is constructed and solved using an improved Newton's method. The regulation capability of the coupled equipment is optimized by using a dynamic update strategy with multiple equilibrium nodes and participation factors, combined with the PSO algorithm. The volume fraction of H2/SNG is introduced as a gas network state variable, and the damping factor is adaptively adjusted to ensure convergence and stability.
It improves the system's adaptability to distributed renewable energy fluctuations and power balance capability, reduces network losses, enhances the accuracy and controllability of gas network EFC and safety status, and significantly improves convergence speed and robustness.
Smart Images

Figure CN122242262A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy analysis technology for electric-gas systems, and more specifically to a method for calculating the energy flow of an integrated electric-gas-hydrogen energy system based on an improved Newton's method. Background Technology
[0002] Energy flow calculation (EFC) of energy networks refers to determining the network's operating state given its structure, parameters, and boundary conditions. It forms the basis for energy network operation and planning. However, in the current context of the energy network's transformation towards a "distributed" model, the power grid has evolved from a traditional centralized large-scale grid to a distribution network with widespread access to distributed resources such as wind turbines (WT) and photovoltaics (PV). Gas networks have also formed a new pattern of distributed gas source injection, including natural gas (NG), hydrogen (H2), and synthetic natural gas (SNG). These two systems are coupled through power-to-hydrogen (P2H) units and hydrogen-blended power generators (HPG) to form an electricity-gas-hydrogen integrated energy system (EGHIES). These coupling devices can serve as flexible support units, providing the system with enormous flexibility and adjustment potential. However, the release of this potential is limited by the H2 volume fraction (Chinese standards stipulate that the H2 volume fraction in pipelines must not exceed 3%). This constraint significantly increases the modeling complexity of the unified energy flow model for electrical equipment, impacting the safe and stable operation of the system. Traditional EFC methods are mostly limited to electro-gas systems, failing to utilize coupling devices to mitigate grid-side fluctuations or track distributed H2 injection on the gas side. An effective algorithm should ensure both computational efficiency and numerical stability under these extended complexities.
[0003] As a core tool for analyzing the steady-state behavior of EGHIES, EFC has received widespread attention. Existing EFC research can be broadly divided into two categories: model research and algorithm research. The former can be further divided into power grid modeling and gas grid modeling. Regarding power grid modeling, some scholars have proposed a distributed sequential parallel EFC method to calculate the energy flow distribution in an electricity-gas-heat system. However, this method relies on a single balancing node model and does not fully utilize the regulation capabilities of coupled equipment. To address this issue, some scholars have proposed the MSB strategy. For example, by unifying the electrical steady-state energy flow model, multiple generators in a power system share unbalanced power according to participation factors, and multiple gas wells in a natural gas system share unbalanced gas volume. The concept of a distributed balancing node is introduced, and by setting participation factors, multiple gas turbine units collaboratively share the system's unbalanced power. The impact of wind power uncertainty on gas grid power flow is analyzed using interval algorithms. However, these MSB strategy studies mostly use statically preset proportions to allocate participation factors, making it difficult to adapt to the dynamic changes in new energy output and load demand. Therefore, some scholars use dynamic updates of power sensitivity to alleviate the pressure on gas pipeline networks. However, the aforementioned methods fail to fully utilize the regulation capabilities of coupled devices such as P2H and HPG, making it difficult to achieve optimal power imbalance distribution and effectively reduce network losses. For gas network modeling, some scholars have proposed simplified calculation methods for natural gas pipeline compressor models, but these only consider a single gas source. While this simplification reduces computational complexity, it fails to capture the dynamic characteristics of gas mixing under multi-source injection scenarios, leading to inaccurate EFC (Electronic Gas Flow Computation). Therefore, scholars have conducted modeling research for multi-source gas injection scenarios. For example, a compact matrix model of a gas network containing hydrogen mixing has been constructed, and the cumulant method and Nataf transformation have been applied to perform probabilistic EFC considering correlations. However, in distributed gas injection scenarios, these methods cannot intuitively monitor the mixing ratio of gas components at each node, especially for H2 with strict volume fraction limitations, making it difficult to ensure safe system operation.
[0004] The accuracy and efficiency of EFC (Electronic Power Flow) solutions rely heavily on high-performance algorithms. While the Newton-Raphson (NR) method is widely used, it has limitations in gas network modeling scenarios: gas network initialization often employs a "flat start" approach, causing the pressure difference across the pipes to approach zero, resulting in a singular extended Jacobian matrix and preventing convergence of the NR method. Therefore, its convergence heavily depends on the initial value selection. To overcome this problem, a fully embedded method is used and applied to optimal power flow solutions, obtaining an accurate solution without relying on initial values. However, this significantly increases the computational burden: while achieving the same accuracy as the NR method, its computation time is typically several times longer, making it unsuitable for rapid computation in large-scale systems. In contrast, the improved Newton method, by introducing an adaptive damping factor, combines the fast convergence of the NR method with the global search capability of gradient descent, significantly enhancing robustness. However, the traditional Newton method cannot adapt to ill-conditioned changes in the Jacobian matrix during iteration, resulting in a failure to balance numerical stability and convergence efficiency, limiting its effectiveness in complex systems. Summary of the Invention
[0005] To address the aforementioned shortcomings in existing technologies, the energy flow calculation method for an integrated electric-gas-hydrogen energy system based on an improved Newton's method provided by this invention solves the problems of existing energy flow calculation methods for integrated electric-gas energy systems, such as lack of a real-time collaborative optimization mechanism for participating factors, difficulty in quickly responding to fluctuations, limitation of power balance capability on both the electric and gas sides, neglect of the dynamic characteristics brought about by the mixing of multiple distributed gas sources on the gas network side, large deviation in pipeline flow and node pressure calculation, difficulty in grasping the real-time distribution characteristics of distributed gas sources, difficulty in balancing "numerical stability" and "convergence efficiency", and inability to adapt to the EFC requirements of complex EGHIES.
[0006] To achieve the aforementioned objectives, the technical solution adopted by this invention is: a method for calculating the energy flow of an integrated electric-gas-hydrogen energy system based on an improved Newton's method, comprising: Construct an extended model for unified energy flow calculation of electricity, gas, and hydrogen; An improved Newton algorithm is used to solve the energy flow of the integrated electric-gas energy system based on the extended model of unified energy flow calculation of electric-gas-hydrogen. The specific methods for constructing the extended model for unified electro-electric energy flow calculation include: Obtain power grid parameters, gas grid parameters, and coupling node parameters; The coupled nodes are considered as multiple balancing nodes, and an extended power grid state variable is constructed based on the multiple balancing nodes; The participation factor of the balancing node is dynamically updated based on the PSO algorithm. Considering the volume fraction of gas components, construct an extended gas network state variable; Construct the state variables of the coupled device; An extended model for calculating the unified energy flow of electricity, gas, and hydrogen is established based on extended grid state variables, extended gas grid state variables, and state variables of coupled devices. Among them, the improved Newton algorithm is used to solve the energy flow of the integrated electric-gas energy system, including: The extended Jacobian matrix is calculated based on the extended power grid state variables, extended gas grid state variables, and state variables of coupled devices. Adaptive update of damping factor based on matrix numerical state of extended Jacobian matrix; Based on the updated damping factor and the extended model of unified electro-gas energy flow calculation, the search step size of the current iteration is calculated and the state variables are updated until the convergence condition is met, and the electro-gas energy flow results are output.
[0007] The beneficial effects of this invention are as follows: 1. By incorporating P2H and HPG into the MSB (Power Supply Balancer), their regulation capabilities are utilized to actively participate in power imbalance allocation. An extended EFC (Electronic Energy Conversion Factor) model of the power grid, taking into account the MSB participation factor, is constructed. A dynamic update strategy is designed to iteratively adjust the participation factor, effectively alleviating the regulation pressure on a single balance node, reducing network losses, and improving the system's adaptability to distributed renewable energy fluctuations and its power balance capability.
[0008] 2. By incorporating the volume fractions of H2 and SNG as new state variables in the gas network, an extended EFC model for the gas network considering the volume fractions of H2 / SNG / NG was constructed. This model can intuitively monitor the concentration of each component, providing accurate state monitoring basis for the control of pipeline hydrogen concentration and improving the accuracy of gas network EFC and the controllability of safety status.
[0009] 3. An improved Newton's method is proposed, which exhibits excellent convergence performance in computational examples of different scales through an adaptive switching strategy of damping factors based on the condition number of the Jacobian matrix. Compared with the NR method and the traditional LM method, the convergence speed is significantly improved, the number of iterations is effectively reduced, and it has stronger robustness in terms of numerical stability. Attached Figure Description
[0010] Figure 1 A flowchart illustrating the specific method for solving the energy flow of an integrated electric-gas-hydrogen energy system provided in this embodiment; Figure 2 A flowchart illustrating the specific steps of dynamic updating of MSB participation factors based on PSO provided for this embodiment; Figure 3 A schematic diagram of the specific structure of the power grid provided for the embodiment; Figure 4 This is a schematic diagram of the specific structure of the air network provided in the embodiment. Detailed Implementation
[0011] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0012] In one embodiment of the present invention, a method for calculating the energy flow of an integrated electric-gas-hydrogen energy system based on an improved Newton's method includes: Construct an extended model for unified energy flow calculation of electricity, gas, and hydrogen; An improved Newton algorithm is used to solve the energy flow of the integrated electric-gas energy system based on the extended model of unified energy flow calculation of electric-gas-hydrogen.
[0013] like Figure 1 As shown, the specific methods for calculating the energy flow of an integrated electric-gas-hydrogen energy system based on the improved Newton's method include: S1. Obtain power grid parameters, gas grid parameters, and coupling node parameters.
[0014] S2. Consider the coupled nodes as multiple balancing nodes, and construct extended power grid state variables based on the multiple balancing nodes.
[0015] In the integrated electricity-gas-hydrogen energy system, P2H (electricity-to-hydrogen unit) and HPG (hydrogen-gas generator) serve as coupling devices connecting the electricity-gas network (the coupling nodes mentioned in this embodiment are all P2H nodes and HPG nodes), possessing bidirectional regulation capabilities and providing a new solution for multi-node collaborative balancing. To achieve a reasonable distribution of power imbalance among MSBs, participation factors are introduced to quantify the power sharing ratio of each MSB, and an optimization model is constructed to dynamically update the participation factors of P2H and HPG, thereby achieving multi-node collaborative regulation.
[0016] ①P2H (electro-hydrogen conversion unit) P2H converts electrical energy into hydrogen, thus serving as both a "source" for natural gas networks and a "load" for electricity networks. The gas flow rate and output of P2H... Its power consumption The relationship between them can be approximated by the following linear function:
[0017] In the formula: For electro-gas conversion efficiency; It is a node gas Volume fraction; For nodes The calorific value of the mixed gas Represents a node Those who have made contributions.
[0018] ②HPG (Hydrogen-Gas Mixed Generator) HPG generates electricity by burning a mixture of natural gas and H2, thus serving as both the "load" in a natural gas network and the "source" in an electricity network. Gas flow consumption. Rather than contributing effort :
[0019] In the formula: This refers to the electro-gas conversion efficiency.
[0020] Traditional power grids are described using classic AC power flow models, which are nonlinear equations concerning voltage magnitude and phase angle, and nodes. Unbalanced active power reactive power for:
[0021] In the formula: , They are nodes The injected active and reactive power of the generator; , They are nodes Active and reactive loads; This represents the number of nodes in the power grid. , They are nodes , The voltage amplitude; , Branch roads The conductivity and susceptance of the surface; For nodes and The phase angle difference.
[0022] To fully utilize the regulation capabilities of the coupled devices and enable them to actively participate in system power balancing, a MSB strategy is introduced. These MSBs include traditional generator (TG) nodes and nodes connected to the coupled devices (P2H nodes and HPG nodes).
[0023] Total power imbalance The formula for calculation is:
[0024] In the formula: This represents the total active power loss of the power grid.
[0025] In order for MSBs to share this total power imbalance, this invention introduces a node participation factor. (Only MSB is non-zero), satisfying Then the unbalanced power borne by each MSB is That is, the active power of the generator from Adjusted to HPG's active power is adjusted to The active power of P2H is adjusted to Therefore, the original node active power imbalance equation needs to be corrected. Then we have: .
[0026] The state variables after the power grid expansion are ,in, This represents the column vector of node voltage phase angles. Represents the column vector of node voltage magnitudes. This represents the column vector of MSB participation factors.
[0027] S3. Dynamically update the participation factor of the balancing node based on the PSO algorithm.
[0028] The PSO algorithm finds the optimal solution to the objective function by simulating a cooperative search in a particle swarm, making it suitable for constrained optimization problems with continuous variables. The specific steps for dynamic updating of the MSB participation factor based on PSO are as follows: Figure 2 As shown, it includes: The preset generator node participation factor is The preset total participation factor of the coupling nodes is ; Set the particle swarm size and maximum number of iterations, and randomly generate a number of particles, each particle corresponding to a set of participation factors of coupled nodes.
[0029] Calculate the total power imbalance of the power grid. The formula for calculation is:
[0030] In the formula: This represents the total active power loss of the power grid.
[0031] An optimization problem is established based on the total power imbalance of the power grid, with the objective of minimizing grid losses. This problem includes the objective function and constraints. The objective function is:
[0032] In the formula, Describe the objective function. Indicates the total power grid loss. Represents the set of all branches. Indicates a branch active power, Indicates a branch The active power; The constraints include: Non-negativity constraint of participation factor: ; In the formula, Represents a node The corresponding participation factors, This represents a set including TG nodes, P2H nodes, and HPG nodes; Sum of Participating Factors Constraint: ; In the formula, Represents the set of TG nodes. Indicates the TG node index. Represents a node Corresponding participation factors; Represents the set of nodes P2H. Indicates the P2H node index. Represents a node Corresponding participation factors; Represents the set of HPG nodes. Indicates the HPG node index. Represents a node The corresponding participation factors.
[0033] Each randomly generated particle must satisfy the above constraints.
[0034] The fitness value of each particle is calculated using the objective function as the fitness function, and the individual optimal solution and the global optimal solution are updated based on the fitness value. Specifically, for each particle, if the current position is better than the previous best position, its individual optimal solution is updated. At the same time, the position with the best fitness is found from all particles and updated as the global optimal solution.
[0035] Update the velocity and position of each particle and perform constraint corrections based on the constraints. If a constraint is not satisfied (e.g., the participation factor of a node is negative, i.e., the non-negativity constraint of the participation factor is not satisfied, then the boundary value is 0), then boundary value correction is applied based on the constraints until the maximum number of iterations is reached, and the optimal participation factor of the coupled node is output. and Otherwise, the fitness value of each particle will be recalculated.
[0036] The optimal participation factor is normalized. If the normalized optimal participation factor meets the preset update conditions, the final MSB participation factor is output; otherwise, the fitness value of each particle is recalculated.
[0037] The preset update conditions are as follows:
[0038] In the formula, Indicates the first Node at the next iteration The corresponding participation factors, Indicates the first Node at the next iteration The corresponding participation factors, For the convergence accuracy of the participation factor.
[0039] S4. Considering the volume fraction of gas components, construct an extended gas network state variable.
[0040] Specifically, in a distributed gas injection network, the pipeline flow rate is dynamically determined by the pressure difference between the nodes, a characteristic that can be described by the Weymouth equation:
[0041] In the formula: For pipelines Traffic on the internet; This is the pipeline constant; Let the sign function of pressure be... When, its value is 1, when At that time, its value is -1; , They are nodes , The pressure; These are empirical constants; , These are standard pressure and temperature, respectively. , These are the pipe's inner diameter and length, respectively. The gas temperature; The gas compressibility coefficient; The coefficient of frictional resistance; For pipelines Internal gas density.
[0042] In a gas network with multiple gas injection distributions, the pipeline The gas density within the pipe is determined by the composition of the gas flowing into it. Assume the gas flow direction is known (from node...). To the node The density of the gas in the pipeline can be used as the density of the upstream node:
[0043] In the formula: For nodes The density of the gas mixture; The number of different types of gases; For the first The density of a gas.
[0044] Similarly, nodes Calorific value of mixed gas for:
[0045] In the formula: For the first The calorific value of the gas.
[0046] Volume fraction The ability to quantify the proportions of each component in a gas mixture is crucial for scenarios requiring strict control of the volume fraction of specific components. This invention considers the gas components NG, H2, and SNG: while H2 has strict volume fraction limits, NG and SNG, although not subject to such restrictions, directly alter the density and calorific value of the gas mixture, thus affecting the accuracy of EFC (Energy Function Concentration Control) in the gas network. Therefore, to achieve accurate description of the gas mixture characteristics and real-time monitoring of key component concentrations, the volume fractions of these three components need to be introduced as new state variables into the gas network model, providing an intuitive and reliable quantitative basis for operational control. For any node in the gas network... The volume fraction of each component must meet the following constraints:
[0047] In the formula: , , They are nodes Volume fractions of NG, H2, and SNG.
[0048] Based on this constraint, it is not necessary to include the volume fractions of all three gases as new state variables; only two need to be selected (this invention selects H2 and SNG). Therefore, the expanded gas network state variables become: .
[0049] Assuming the conventional gas source only provides NG, based on the balance relationship of component volumetric flow rates in the gas mixture, the node... The volume fractions of components H2 and SNG must satisfy the following equation:
[0050] In the formula: For nodes The load flow.
[0051] The above equation can be written in matrix form:
[0052] In the formula: It is a coefficient matrix; , These are the volume fraction matrices for H2 and SNG, respectively; , These are column vectors containing the volume fractions of H2 and SNG, respectively.
[0053] Similar to power grids, gas networks also need to satisfy Kirchhoff's laws, meaning the flow rate injected into a node equals the flow rate out of the node. Therefore, the flow rate deviation at each node is:
[0054] In the formula: This represents the number of nodes in the gas network. This is the flow sign function; a value of 1 indicates the flow direction is... A value of -1 indicates that the flow direction is... .
[0055] S5. Construct the state variables of the coupled device.
[0056] Specifically, the state variables of the coupling device are .in, This is a column vector representing the power consumption of all P2H devices. This is a column vector representing the gas consumption power of all HPG devices. For each node... P2H and nodes The coupling equations for HPG are as follows:
[0057] In the formula: and These are nodes P2H and nodes The energy conversion imbalance of HPG.
[0058] S6. Based on the extended grid state variables, extended gas grid state variables, and state variables of coupled equipment, establish an extended model for unified energy flow calculation of electricity-gas-hydrogen, with the specific expression as follows:
[0059] In the formula, This represents the unbalanced column vector of the integrated electric-gas energy system. Indicates unbalanced active power. A column vector representing unbalanced reactive power. A column vector representing the imbalance of participating factors. A column vector representing the amount of flow imbalance. A column vector representing the unbalanced integral of hydrogen gas at the nodes. A column vector representing the unbalanced volume fraction of the node SNG. This represents the energy conversion imbalance in the electro-hydrogen conversion unit. This indicates the energy conversion imbalance in a hydrogen-gas hybrid generator. , Indicates active load power. This represents the active power injected by the node. This represents the reactive power generated by a traditional generator. Indicates reactive load power. This represents the reactive power injected by the node. For the number of power grid nodes, Indicates node participation factor, , The gas flow rate injected into a traditional gas source Indicates the flow rate in the pipeline. Indicates load flow; Represents the hydrogen coefficient matrix; Represents a column vector containing the integral of hydrogen gas; Represents the integral matrix of hydrogen gas; Represents a column vector containing the volume fraction of synthetic natural gas; Represents the volume fraction matrix of synthetic natural gas; For the electro-gas conversion efficiency of the electro-hydrogen conversion unit, Indicates the active power output of the electro-hydrogen conversion unit, Indicates the gas flow rate and output of the electro-hydrogen conversion unit. Indicates the calorific value of the mixed gas, Indicates the gas flow rate and output of the hydrogen-mixed gas generator. Indicates the electro-gas conversion efficiency of a hydrogen-to-gas hybrid generator. This indicates the active power output of the hydrogen-gas hybrid generator.
[0060] S7. Calculate the extended Jacobian matrix based on the extended power grid state variables, extended gas grid state variables, and state variables of coupled equipment.
[0061] Specifically, let the power grid imbalance amount Gas network imbalance and the imbalance of coupling equipment Construct the block structure of the extended Jacobian matrix, its expression is:
[0062] In the formula, This represents the extended Jacobian matrix. The Jacobian matrix of the power grid is represented. The Jacobian matrix of the air network is represented. Let Jacobian matrix be the coupling device. The submatrix representing the partial derivatives of the power grid imbalance with respect to the gas grid state variables. This represents the partial derivative submatrix of the gas grid imbalance with respect to the grid state variables. The submatrix representing the partial derivatives of the grid imbalance with respect to the state variables of the coupled equipment. The submatrix representing the partial derivatives of the unbalance of the coupled equipment with respect to the grid state variables. The submatrix representing the partial derivatives of the gas network imbalance with respect to the state variables of the coupled equipment. The submatrix representing the partial derivatives of the unbalance of the coupled equipment with respect to the gas network state variables. Represents extended power grid state variables. Represents the extended gas network state variables. Indicates the state variables of the coupled device, superscript Represents the transpose of a matrix; Indicates the imbalance of the power grid. This indicates the amount of gas network imbalance. This indicates the imbalance of the coupling device. Represents the extended power grid state variables. This represents the extended gas network state variables. Represents the state variables of the coupled device; Find the diagonal and off-diagonal elements of the Jacobian matrix.
[0063] First, solve for the diagonal elements. The Jacobian matrix of the power grid. for: ; In the formula: This indicates that only the element corresponding to the MSB node is... The remaining elements are 0.
[0064] Jacobian matrix of the air network for: ; The Jacobian matrix of a traditional gas network becomes a 3x3 matrix after the state variables are expanded, as shown in the equation above. Based on the formulas for calculating gas density and gas calorific value, we have:
[0065] In the formula: , and The densities of gases NG, H2, and SNG are respectively. , and The values are the calorific values of gases NG, H2, and SNG, respectively.
[0066] That is to Differentiating H2 with respect to its volume fraction, we get:
[0067] The following is a breakdown of the derivatives:
[0068]
[0069] ; but The calculation formula is: ; Similarly, we can obtain Calculation formula: ; Jacobian matrix of coupling device for:
[0070] In the formula: This indicates that only the element corresponding to the P2H node is... The remaining elements are 0. This indicates that only the element corresponding to the HPG node is... The remaining elements are 0. Secondly, solve for the off-diagonal block elements. In a gas grid, since the saturation node is connected to the gas source, when its internal state changes, the fluctuations in supply and demand will be borne by the changes in the gas supply of the saturation node, and will not affect the power system. Therefore, there is .
[0071] The format is: ; The format is: ; The format is: ; The format is: ; definition and ,but The format is: .
[0072] S8. Adaptive update of damping factor for matrix numerical state based on extended Jacobian matrix.
[0073] In this embodiment, the specific structure of the power grid is as follows: Figure 3 As shown, the specific structure of the air network is as follows: Figure 4 As shown. This invention employs an improved Newton's method as the EFC solution method. This algorithm continuously adjusts the direction and size of the iteration step by introducing a damping factor and a cost function. Even if the initial point is far from the optimum, it can still reach the optimum, thus exhibiting better robustness. However, the extended Jacobian matrix in the EGHIES unified energy flow model constructed in this invention has high dimensionality and strong coupling characteristics. Furthermore, due to the inconsistency in the dimensions and significant numerical differences among the state variables, the extended Jacobian matrix... It exhibits pathological characteristics. More importantly, during the iterative solution process, with fluctuations in distributed power sources and changes in the mixing ratio of multiple gas sources, The degree of ill-conditioning of the Jacobian matrix also changes accordingly. Traditional Newton's method cannot accurately handle this dynamically changing numerical characteristic. Therefore, this invention proposes an adaptive switching strategy for the damping factor based on the degree of ill-conditioning of the Jacobian matrix. By sensing the numerical state of the matrix, it dynamically selects either the LM method or the Newton method, achieving a synergy between "numerical stability" and "convergence efficiency."
[0074] Specifically: The condition number of the Jacobian matrix is calculated; a larger value indicates a more ill-conditioned matrix, and a more sensitive solution to numerical errors in the system of equations. Its expression is:
[0075] In the formula, Representing the Jacobian matrix The condition number of Jacobian matrix The maximum singular value, Jacobian matrix The minimum singular value; The damping factor is updated based on the relationship between the condition number of the Jacobian matrix and the condition number threshold, expressed as follows:
[0076] In the formula, Indicates the first The damping factor updated in the next iteration. Indicates the first The damping factor before the next iteration is updated. Indicates the condition number threshold. This is the ill-conditioned coefficient.
[0077] S9. Based on the updated damping factor and the extended model of the unified electro-gas energy flow calculation, calculate the search step size of the current iteration and update the state variables until the convergence condition is met, and output the electro-gas energy flow results.
[0078] The extended model, based on the updated damping factor and unified electro-gas energy flow calculation, calculates the search step size for the current iteration and updates the state variables. Its expression is:
[0079] In the formula, For the first The updated state variables in the next iteration This represents the number of iterations. For the first The search step size for each iteration; For the first Jacobian matrix at the next iteration; For the first The state variables before the next iteration are updated. Represents the identity matrix. Indicates the first The column vector of EGHIES imbalance quantities corresponding to the state variables before the update in the next iteration. As the damping factor, when When, it is equivalent to gradient descent, when At that time, it was equivalent to the Gauss-Newton method.
[0080] The convergence conditions are as follows:
[0081] In the formula, Indicates the convergence accuracy.
[0082] To verify the effectiveness and beneficial effects of the present invention, a comparative experiment was conducted between the traditional single-balance node power grid model (Scheme a) and the method proposed in this invention (Scheme b) for energy flow calculation. The comparison results are shown in Table 1.
[0083] Table 1
[0084] The comparison results show that the network loss of scheme b is 67.72% lower than that of scheme a, which verifies the effectiveness of the power grid expansion model.
[0085] Then, a comparative experiment was conducted between the traditional single-type gas source model (Scheme a) and the method proposed in this invention (Scheme b) for energy flow calculation. The comparison results are shown in Table 2.
[0086] Table 2
[0087] The comparison results show that: Scheme a, as a traditional single-type gas source model, can only present the total injection flow rate of each node, and cannot distinguish the specific injection situation of different components, making it difficult to reflect the actual scenario of multi-source distributed injection. Scheme b, on the other hand, not only clearly quantifies the injection flow rate of each gas component, but also accurately matches the actual operating state of multi-component mixing in the gas pipeline network, highlighting the advantages of the extended gas pipeline network EFC model constructed in this paper.
[0088] This invention constructs a grid-extended EFC model considering participation factors. Through dynamic collaborative optimization based on particle swarm optimization, it fully utilizes the regulation capabilities of coupled devices such as P2H and HPG, improving the system's adaptability to distributed renewable energy fluctuations and power balance capabilities while reducing total grid losses. A gas-grid extended EFC model considering H2 / SNG / NG volume fractions is also constructed, allowing for intuitive observation of component concentrations and providing accurate state monitoring data for pipeline hydrogen concentration control, thus improving the accuracy and controllability of gas-grid EFC. An improved Newton's method is proposed, employing an adaptive switching strategy for damping factors based on the condition number of the Jacobian matrix, demonstrating excellent convergence performance in various scale examples. Compared to the traditional NR method, this algorithm significantly improves convergence speed, effectively reduces the number of iterations, and exhibits stronger robustness in numerical stability.
Claims
1. A method for calculating the energy flow of an integrated electric-gas-hydrogen energy system based on an improved Newton's method, characterized in that, include: Construct an extended model for unified energy flow calculation of electricity, gas, and hydrogen; An improved Newton algorithm is used to solve the energy flow of the integrated electric-gas energy system based on the extended model of unified energy flow calculation of electric-gas-hydrogen. The specific methods for constructing the extended model for unified electro-electric energy flow calculation include: Obtain power grid parameters, gas grid parameters, and coupling node parameters; The coupled nodes are considered as multiple balancing nodes, and an extended power grid state variable is constructed based on the multiple balancing nodes; The participation factor of the balancing node is dynamically updated based on the PSO algorithm. Considering the volume fraction of gas components, construct an extended gas network state variable; Construct the state variables of the coupled device; An extended model for calculating the unified energy flow of electricity, gas, and hydrogen is established based on extended grid state variables, extended gas grid state variables, and state variables of coupled devices. Among them, the improved Newton algorithm is used to solve the energy flow of the integrated electric-gas energy system, including: The extended Jacobian matrix is calculated based on the extended power grid state variables, extended gas grid state variables, and state variables of coupled devices. Adaptive update of damping factor based on matrix numerical state of extended Jacobian matrix; Based on the updated damping factor and the extended model of unified electro-gas energy flow calculation, the search step size of the current iteration is calculated and the state variables are updated until the convergence condition is met, and the electro-gas energy flow results are output.
2. The method according to claim 1, characterized in that, The specific expression for the extended model of the unified energy flow calculation of electricity, gas, and hydrogen is as follows: In the formula, This represents the unbalanced column vector of the integrated electric-gas energy system. Indicates unbalanced active power. A column vector representing unbalanced reactive power. A column vector representing the imbalance of participating factors. A column vector representing the amount of flow imbalance. A column vector representing the unbalanced integral of hydrogen gas at the nodes. A column vector representing the unbalanced volume fraction of the node SNG. This represents the energy conversion imbalance in the electro-hydrogen conversion unit. This indicates the energy conversion imbalance in a hydrogen-gas hybrid generator. , Indicates active load power. This represents the active power injected by the node. The reactive power generated by a traditional generator. Indicates reactive load power. This represents the reactive power injected by the node. For the number of power grid nodes, Indicates node participation factor, , The gas flow rate injected into a traditional gas source Indicates the flow rate in the pipeline. Indicates load flow; Represents the hydrogen coefficient matrix; Represents a column vector containing the integral of hydrogen gas; Represents the integral matrix of hydrogen gas; Represents a column vector containing the volume fraction of synthetic natural gas; Represents the volume fraction matrix of synthetic natural gas; For the electro-gas conversion efficiency of the electro-hydrogen conversion unit, Indicates the active power output of the electro-hydrogen conversion unit, Indicates the gas flow rate and output of the electro-hydrogen conversion unit. Indicates the calorific value of the mixed gas, Indicates the gas flow rate and output of the hydrogen-mixed gas generator. Indicates the electro-gas conversion efficiency of a hydrogen-to-gas hybrid generator. This indicates the active power output of the hydrogen-gas hybrid generator.
3. The method according to claim 2, characterized in that, The participation factors of the balancing nodes are dynamically updated based on the PSO algorithm, including: The preset generator node participation factor is The preset total participation factor of the coupled nodes is ; Set the particle swarm size and maximum number of iterations, and randomly generate a number of particles; Calculate the total power imbalance of the power grid; An optimization problem is established based on the total power imbalance of the power grid, with the objective of minimizing grid losses. This problem includes the objective function and constraints. The objective function is: In the formula, Describe the objective function. Indicates the total power grid loss. Represents the set of all branches. Indicates a branch active power, Indicates a branch The active power; , They are nodes , The voltage amplitude; , Branch roads The conductivity and susceptance of the surface; For nodes and The phase angle difference between them; The constraints include: Non-negativity constraint of participation factor: ; In the formula, Represents a node The corresponding participation factors, This represents a set including TG nodes, P2H nodes, and HPG nodes; Sum of Participating Factors Constraint: ; In the formula, Represents the set of TG nodes. Indicates the TG node index. Represents a node Corresponding participation factors; Represents the set of nodes P2H. Indicates the P2H node index. Represents a node Corresponding participation factors; Represents the set of HPG nodes. Indicates the HPG node index. Represents a node Corresponding participation factors; The fitness value of each particle is calculated using the objective function as the fitness function, and the individual optimal solution is updated to the global optimal solution based on the fitness value. Update the velocity and position of each particle and make constraint corrections based on the constraints until the maximum number of iterations is reached. Output the optimal participation factor of the coupled node; otherwise, recalculate the fitness value of each particle. The optimal participation factor is normalized. If the normalized optimal participation factor meets the preset update conditions, the final MSB participation factor is output; otherwise, the fitness value of each particle is recalculated.
4. The method according to claim 3, characterized in that, The preset update conditions are as follows: In the formula, Indicates the first Node at the next iteration The corresponding participation factors, Indicates the first Node at the next iteration The corresponding participation factors, For the convergence accuracy of the participation factor.
5. The method according to claim 4, characterized in that, The extended Jacobian matrix is calculated based on extended grid state variables, extended gas grid state variables, and state variables of coupled equipment, including: The block structure for constructing the extended Jacobian matrix is expressed as follows: In the formula, This represents the extended Jacobian matrix. The Jacobian matrix represents the power grid. The Jacobian matrix of the air network is represented. Let Jacobian matrix be the coupling device. The submatrix representing the partial derivatives of the power grid imbalance with respect to the gas grid state variables. This represents the partial derivative submatrix of the gas grid imbalance with respect to the grid state variables. The submatrix representing the partial derivatives of the grid imbalance with respect to the state variables of the coupled equipment. The submatrix representing the partial derivatives of the unbalance of the coupled equipment with respect to the grid state variables. The submatrix representing the partial derivatives of the gas network imbalance with respect to the state variables of the coupled equipment. The submatrix representing the partial derivatives of the unbalance of the coupled equipment with respect to the gas network state variables. Represents extended power grid state variables. Represents the extended gas network state variables. Indicates the state variables of the coupled device, superscript Represents the transpose of a matrix; Indicates the imbalance of the power grid. This indicates the amount of gas network imbalance. This indicates the imbalance of the coupling device. Represents the extended power grid state variables. This represents the extended gas network state variables. Represents the state variables of the coupled device; Find the diagonal and off-diagonal elements of the Jacobian matrix.
6. The method according to claim 5, characterized in that, The damping factor is adaptively updated based on the extended Jacobian matrix in the numerical state of the matrix, specifically as follows: The condition number of the Jacobian matrix is calculated using the following expression: In the formula, Representing the Jacobian matrix The condition number of Jacobian matrix The maximum singular value, Jacobian matrix The minimum singular value; The damping factor is updated based on the relationship between the condition number of the Jacobian matrix and the condition number threshold, expressed as follows: In the formula, Indicates the first The damping factor updated in the next iteration. Indicates the first The damping factor before the next iteration is updated. Indicates the condition number threshold. This is the ill-conditioned coefficient.
7. The method according to claim 6, characterized in that, The extended model, based on the updated damping factor and unified electro-gas energy flow calculation, calculates the search step size for the current iteration and updates the state variables. Its expression is: In the formula, For the first The updated state variables in the next iteration This represents the number of iterations. For the first The search step size for each iteration; For the first The Jacobian matrix at the next iteration; For the first The state variables before the next iteration are updated. Represents the identity matrix. Indicates the first The unbalanced column vector of the integrated electric-gas energy system corresponding to the state variables before the update in the next iteration.
8. The method according to claim 7, characterized in that, The convergence conditions are as follows: In the formula, Indicates the convergence accuracy.