A method and system for calculating optimized energy flow in a power and natural gas combined system

By setting up safety indicators in the power and natural gas combination system and building an optimized energy flow model, the mixed integer second -order cone planning technology is used to solve the impact of alternative gas injection of the lower gas composition on the system safety and operation, realizing the system safety of the system, and realizing the system safety of the system. Increased sex and operating efficiency.

CN118863690BActive Publication Date: 2025-01-24STATE GRID (SUZHOU) URBAN ENERGY RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411368456.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-24
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

When optimizing the energy flow calculation of the power natural gas joint system, the impact of gas composition changes on the safety and operation of the system has not been completely solved, especially in the case of alternative gas injection, it is difficult to accurately control the gas composition and optimize the energy flow.

Method used

The optimization energy flow calculation method of the power natural gas combination system is proposed. By setting up safety indicators such as the Voly Index, the Weaver flame speed factor and combustion potential, the fluctuation of the gas component is restricted Using a mixed integer two -order cone planning technology for solution.

Benefits of technology

The energy flow optimization of the power and natural gas combined system under the condition of alternative gas injection is realized, ensuring the safety and operating efficiency of the system. By accurately controlling the gas composition and optimizing the energy flow, the overall performance of the system is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118863690B_ABST
    Figure CN118863690B_ABST
Patent Text Reader

Abstract

The present invention relates to an optimized energy flow calculation method and system for an electric power and natural gas combined system, wherein the method comprises: step S1: setting the safety index of the electric power and natural gas combined system under the premise of considering the injection of alternative gas, and constraining the fluctuation of gas composition by the safety index; step S2: constructing an optimized energy flow model of the electric power and natural gas combined system under the condition of the safety index; step S3: converting the optimized energy flow model to obtain the converted optimized energy flow model; step S4: solving the converted optimized energy flow model. The present invention proposes an optimized energy flow model in the electric power and natural gas combined system considering the injection of alternative gas, and by solving the model, the electric power and natural gas systems can be fully coordinated to achieve the optimal operating state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of comprehensive energy system optimization, and in particular to an optimized energy flow calculation method and system for an electric power and natural gas combined system. Background Art

[0002] The utilization of gas-fired power plants (GPP) and power-to-gas (PTG) facilities strengthens the two-way interaction between electricity and gas systems. PTG facilities typically consume excess renewable electricity generation to produce green hydrogen and methane, which can be injected into natural gas transmission pipelines for further use. Together with biogas, they are often seen as renewable alternative gases for decarbonizing the integrated electricity and gas system (IEGS).

[0003] In recent years, many hydrogen production demonstration projects are being built around the world. For example, in 2019, the first green hydrogen mixed natural gas demonstration project was put into operation in Chaoyang, China, where the natural gas network was operated with 10% hydrogen for one year. The UK launched its first project, HyDeploy, in 2019. The first phase was implemented in Keele University's private natural gas network, which supported the natural gas needs of 100 households and 30 university buildings.

[0004] However, injecting alternative gases into the existing natural gas transmission system may bring potential risks. First, compared with natural gas, hydrogen has a lower ignition point and a higher combustion rate, which is more likely to cause fire. Second, gas appliances are usually designed and tested using a specific type of gas at a given pressure. If the gas composition changes, their combustion performance may not be satisfactory. Third, components in the gas network, such as pipelines, compressors, valves, etc., are also designed for pre-specified gas compositions. Different gas compositions may cause technical problems such as hydrogen embrittlement. Fourth, changes in gas composition will change the physical properties of the gas mixture (such as relative density), which may further lead to changes in node gas pressure and pipe storage oscillation modes, etc. Nevertheless, these safety issues can be well controlled if the gas composition can be strictly controlled.

[0005] Most previous studies have focused on simulating the impact of alternative gas injection on natural gas systems or power-gas combined systems. In these studies, although the gas composition of the entire gas network is evaluated, it cannot be controlled or optimized if safety constraints are violated. For example, if the hydrogen mole fraction in some parts of the gas network exceeds an upper limit, these studies do not help to provide quantitative recommendations for IEGS to mitigate safety issues.

[0006] Recently, several studies have focused on the optimal operation of IEGS with alternative gas injection. Compared with simulation-oriented studies that mainly focus on impact analysis, optimization-oriented studies focus on the decision making of IEGS system operators to improve the operating conditions under alternative gas injection. From the above studies, it is concluded that the optimal energy flow problem of the power-gas combined system has not been fully modeled to control the gas composition through alternative gas injection. The main research barriers exist in the coordinated optimization of power and gas systems, the modeling of safety constraints, and the over-simplification of physical models. The lack of consideration in these aspects will lead to inaccurate OEF calculations. In addition, the OEF model considering these aspects is a highly nonlinear optimization problem. The nonlinearities are mainly inherited from the Weymouth equations for gas mixtures, the uncertain gas flow direction, and the calculation of safety indicators, gas composition, specific gravity, compressibility factors, etc. These nonlinearities have a great impact on the convergence, accuracy, and computational time of the optimal energy flow calculation, which has not been properly handled in previous studies. Summary of the invention

[0007] Therefore, the technical problem to be solved by the present invention is to overcome the problem that the research on the optimization energy flow of the natural gas combined system in the prior art is still imperfect.

[0008] In order to solve the above technical problems, the present invention provides an optimized energy flow calculation method for an electric power and natural gas combined system, comprising:

[0009] Step S1: Under the premise of considering the power-gas combined system under alternative gas injection, setting the safety index of the power-gas combined system, and constraining the fluctuation of gas composition by the safety index;

[0010] The method for setting the safety index of the power and natural gas combined system in step S1 is:

[0011] Set the Wobbe index, the formula is:

[0012] ;

[0013] ;

[0014] in, is the calorific value of natural gas at node i; is the calorific value of gas component r; is the collection of gas components; is the mole fraction of gas component r at node i; is the Wobbe index of node i; is the relative density of the gas at node i;

[0015] Set the Weaver flame speed factor, the formula is:

[0016] ;

[0017] in, is the Weaver flame speed factor of node i; is the combustion velocity of the gas component r in the stoichiometric air mixture; is the air-fuel ratio; and are the mole fraction of inert gas and the mole fraction of oxygen at node i, respectively;

[0018] Set the combustion potential, the formula is:

[0019] ;

[0020] ;

[0021] ;

[0022] ;

[0023] in, is the combustion potential of node i; is the node i Correction value of for Correction value of is the combustion potential of gas component r at node i; is the molecular density of gas component r; is the combustion potential coefficient of gas component r; is the oxidation coefficient;

[0024] Safety index =[ ] is constrained within a certain threshold:

[0025] ;

[0026] in, For hydrogen, Safety index calculated for the original natural gas; is the threshold value of the safety indicator;

[0027] Step S2: Under the condition of the safety index, construct an optimized energy flow model of the power-gas combined system considering the injection of alternative gas;

[0028] Step S3: converting the optimized energy flow model to obtain a converted optimized energy flow model;

[0029] Step S4: solving the converted optimized energy flow model.

[0030] In one embodiment of the present invention, the method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 comprises: modeling the natural gas system by:

[0031] To model the natural gas load, the formula is:

[0032] ;

[0033] ;

[0034] in, GCV is raw natural gas without any other gas components; is the original natural gas load; is the natural gas load of gas component r at node i;

[0035] Modeling the natural gas source, the formula is:

[0036] ;

[0037] ;

[0038] in, is the natural gas supply vector of natural gas source l at node i; R is the number of gas components; The supply of gas component r from the natural gas source at node i; is the mole fraction of gas component r of natural gas source l at node i;

[0039] The gas production of the natural gas source meets the upper and lower limit constraints:

[0040] ;

[0041] in, and are the upper and lower limits of natural gas supply from natural gas source l at node i, respectively;

[0042] The natural gas flow in the pipeline is modeled using the Weymouth equation to describe the relationship between gas flow and node gas pressure. The formula is:

[0043] ;

[0044] ;

[0045] ;

[0046] ;

[0047] ;

[0048] in, is the natural gas flow rate between node i and node j; and is the nodal air pressure at nodes i and j; is the characteristic parameter of pipeline ij between gas node i and gas node j; is the gas constant of air; and is the temperature and pressure under standard conditions; , and is the diameter, length and friction coefficient of the pipe ij; and is the relative density and compressibility of the gas mixture in the pipe ij; is the temperature of the gas in the pipeline; is the flow rate of gas component r in pipe ij; is the capacity of pipeline ij; and is the upper and lower limits of the air pressure at node i;

[0049] Construct a natural gas flow node balance model: According to Kirchhoff's law, for each gas component r, the gas flowing into the node is equal to the gas flowing out of the node, so:

[0050] ;

[0051] in, , and is the set of natural gas source, PTG and GPP of node i; is the set of all nodes connected to node i; is the gas composition r produced by PTG l at node i; is the amount of gas component r consumed by GPP l at node i; where PTG is power-to-gas and GPP is gas-fired unit;

[0052] Modeling the natural gas mixing process: To describe the gas mixing process, the inflow of gas component r flowing into node i is , and the sum of all gas components flowing into node i is and ; The actual direction of the gas flow is represented by the integer variable Indicates that Indicates that the actual flow direction of the natural gas flow is from i to j, On the contrary, the calculation formula for the inflow of gas component r at node i is:

[0053] ;

[0054] The gas composition calculation formula of node i is:

[0055] ;

[0056] In formula (14), the relative density and compression factor is a variable, determined by the gas composition, and the calculation formula is:

[0057] ;

[0058] ;

[0059] ;

[0060] in, is the molecular mass of air; is a function of the compressibility factor, which is related to the air pressure and gas composition, specifically:

[0061] ;

[0062] ;

[0063] ;

[0064] ;

[0065] in, and Two parameters needed to calculate the compression factor; is the average pressure of the gas in pipe ij; and are the critical temperature and critical pressure of gas component r.

[0066] In one embodiment of the present invention, the method for constructing the optimized energy flow model of the power-gas combined system considering alternative gas injection in step S2 includes: modeling the coupling element by:

[0067] The power-to-gas model is:

[0068] ;

[0069] ;

[0070] in, is the power consumption of PTG l at node i; and for the efficiency of the electrolysis and methanation processes; and GCV for methane and hydrogen; and is the hydrogen and methane production of PTG l at node i;

[0071] The power consumption of power-to-gas meets the following constraints:

[0072] ;

[0073] in, is the maximum power consumption of PTG l of node i;

[0074] The formula for modeling the gas unit is:

[0075] ;

[0076] ;

[0077] in, is the power generation power of gas unit l at node i; is the efficiency of gas unit l at node i; is the consumption of gas component r of gas generator set l at node i.

[0078] In one embodiment of the present invention, the method for constructing an optimized energy flow model of a power-gas combined system considering alternative gas injection in step S2 comprises: modeling the power system by:

[0079] The AC power flow model is used to model the power system, and the second-order cone relaxation technique is used to convexify the AC power flow model. The formula is:

[0080] ;

[0081] ;

[0082] ;

[0083] ;

[0084] ;

[0085] ;

[0086] ;

[0087] ;

[0088] ;

[0089] ;

[0090] in, and is the set of traditional units and renewable energy units at node i; , , and is the active power generation of the gas-fired unit, traditional unit, renewable energy unit and the active power consumption of power-to-gas conversion at node i; is the active power of the power load at power node i; is the active power of the power flow of power line ij; , , and is the reactive power generation of the gas-fired unit, conventional generator unit, renewable energy unit i at node i, and the reactive power consumption of the power-to-gas unit i; is the reactive power of the power load at node i; is the reactive power of the power flow of power line ij; is the square of the voltage amplitude at node i; is the square of the current amplitude of the power line ij; and is the resistance and reactance of the power line ij; is the apparent power capacity of power line ij; , , , , and The lower and upper limits of active power for traditional generator sets, gas generator sets, and renewable energy generation; , , , , and The lower and upper limits of reactive power for traditional generator sets, gas generator sets, and renewable energy generation; is the power factor of the renewable energy unit at node i.

[0091] In one embodiment of the present invention, the method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 includes: constructing an objective function by:

[0092] The goal of constructing an optimized energy flow is to minimize the total operating cost. , the formula is,

[0093] ;

[0094] in, is a collection of nodes; is the cost function of the traditional generator set l at node i; is the node gas production price of natural gas source j at node i; The subsidized price for green hydrogen.

[0095] In one embodiment of the present invention, the method for converting the optimized energy flow model in step S3 is:

[0096] Mixed integer second-order cone relaxation of the natural gas flow equation: The Weymouth equation with respect to equation (14) is transformed into a mixed integer second-order cone form:

[0097] ;

[0098] ;

[0099] ;

[0100] ;

[0101] ;

[0102] in, ); is the redundant variable of pipeline ij; is the square of the node pressure; ; ;

[0103] Formula (17) and Formula (18) are replaced by Formula (46) and Formula (47), respectively:

[0104] ;

[0105] ;

[0106] The penalty function and sequence programming techniques are used to reduce the computational complexity of formulas (41)-(47), where:

[0107] In the penalty function, in order to drive the relaxation of formula (41) to be tighter, a penalty term is added to formula (40);

[0108] In the sequence planning technique, additional constraints are added and the formula is:

[0109] ;

[0110] Where v is the ordinal number of the iteration; express The value at iteration v; is a slack variable, representing The error of the Taylor expansion of ;

[0111] Reconstruction of bilinear terms based on McCormick Envelopes: Based on the relative density calculation, formulas (20)-(21) are equivalent to Taylor expansion:

[0112] ;

[0113] ;

[0114] in, In the vth iteration The increment of is the slack variable, which represents the Taylor residue of the gas component r at node i during the vth iteration; for The upper limit of is used to drive formula (49) to become tighter; it is worth noting that in the Taylor expansion The reference value of is determined by its value in the previous iteration v-1;

[0115] make , formula (23) is replaced by McCormick envelopes:

[0116] ;

[0117] ;

[0118] ;

[0119] ;

[0120] Linearize the safety index: For the Wobbe index in formula (2), the nonlinear term exists in the form of , the relative density of the original natural gas As a reference point, linearize it based on the Taylor expansion:

[0121] ;

[0122] Substitute formula (55) into formula (2) to obtain its linearized form.

[0123] In one embodiment of the present invention, the method for solving the converted optimized energy flow model in step S4 is:

[0124] Step 41: Initialize physical parameters, security index constraints, and other used parameters of the power and gas combined system;

[0125] Step 42: solving the optimal energy flow problem of the power-gas combined system without considering the injection of alternative gas, and setting the solution as a reference point;

[0126] Step 43: Initialize the iteration number v = 0, and initialize the initial reference point of the sequence planning according to the reference point obtained in step 42, including , , , , , , , and , initialize the penalty coefficient for sequence planning , , and their upper limits , , set the remainder threshold , , , and ;

[0127] Step 44: In the vth iteration, solve the mixed integer second-order cone programming problem, the formula is:

[0128] ;

[0129] And subject to the constraints: Formula (9)-(13), Formula (19), Formula (25)-(39), Formula (1)-(8), Formula (41)-(54);

[0130] in, is the set of pipelines, the security constraints is replaced by formula (55);

[0131] The optimization variable is: square of the node pressure ; Gas production rate of natural gas source; Natural gas load of each gas component ; Hydrogen and methane production rates from power-to-gas and ; Power consumption of power-to-gas ; Power generation capacity of traditional generator sets, gas generator sets and renewable energy generator sets , , ; Consumption of gas component r by gas generator set ; Voltage phase angle ; Direction of natural gas flow ; Gas composition ; Natural gas flow of various gas components in natural gas pipelines ; Slack variables , , , and ;

[0132] By solving the mixed integer second-order cone programming problem in step 44, a solution for the vth iteration is obtained;

[0133] Step 45: Update the vth iteration according to formula (20), formula (23), and formula (24). , and ;

[0134] Step 46: Check whether the remainder of the sequence planning satisfies the condition of formula (57):

[0135] ;

[0136] If formula (57) holds, the sequence planning ends and the final solution is output; otherwise, the penalty coefficient is updated according to formulas (58) and (59), and the process returns to step 44;

[0137] ;

[0138] ;

[0139] in, is the multiplier of the penalty coefficient.

[0140] In order to solve the above technical problems, the present invention provides an optimized energy flow calculation system for an electric power and natural gas combined system, comprising:

[0141] Index setting module: used to set the safety index of the power-gas combined system under the premise of considering the injection of alternative gas, and to constrain the fluctuation of gas composition through the safety index;

[0142] The safety indicators of the electric power and natural gas combined system are set in the indicator setting module, specifically:

[0143] Set the Wobbe index, the formula is:

[0144] ;

[0145] ;

[0146] in, is the calorific value of natural gas at node i; is the calorific value of gas component r; is the collection of gas components; is the mole fraction of gas component r at node i; is the Wobbe index of node i; is the relative density of the gas at node i;

[0147] Set the Weaver flame speed factor, the formula is:

[0148] ;

[0149] in, is the Weaver flame speed factor of node i; is the combustion velocity of the gas component r in the stoichiometric air mixture; is the air-fuel ratio; and are the mole fraction of inert gas and the mole fraction of oxygen at node i, respectively;

[0150] Set the combustion potential, the formula is:

[0151] ;

[0152] ;

[0153] ;

[0154] ;

[0155] in, is the combustion potential of node i; is the node i Correction value of for Correction value of is the combustion potential of gas component r at node i; is the molecular density of gas component r; is the combustion potential coefficient of gas component r; is the oxidation coefficient;

[0156] Safety index =[ ] is constrained within a certain threshold:

[0157] ;

[0158] in, For hydrogen, Safety index calculated for the original natural gas; is the threshold value of the safety indicator;

[0159] Model building module: used for building an optimized energy flow model of the power-gas combined system considering alternative gas injection under the condition of the safety index;

[0160] Optimization module: used for converting the optimized energy flow model to obtain a converted optimized energy flow model;

[0161] Calculation module: used to solve the converted optimized energy flow model.

[0162] The above technical solution of the present invention has the following advantages compared with the prior art:

[0163] The present invention proposes an optimized energy flow model considering distributed injection of alternative gases in the power-gas combined system, which can fully coordinate the power and gas systems to achieve the best operating state; The present invention models the physical properties of the gas mixture (including gas composition, specific gravity, compressibility factor, etc.) as variables, and comprehensively reveals and controls the influence of alternative gases on these properties at the node scale; The present invention constructs safety indicators of the gas mixture in the IEGS, such as the Wobbe index, the Weaver flame speed factor, the combustion potential, etc., which can be evaluated and controlled under different gas compositions;

[0164] The present invention designs targeted reconstruction technology and sequence planning methods to solve non-convex optimization energy flow models. This method reconstructs the original mixed integer nonlinear programming problem into a more tractable form (mixed integer second-order cone (MISOC) programming), which effectively improves computational efficiency and robustness. The present invention uses an adaptive penalty factor in sequence planning to balance the feasibility and convergence of gas composition constraints, variable parameter Weymouth equations, etc. The present invention sets a safety index as a convergence criterion to better ensure the safety of the natural gas system. BRIEF DESCRIPTION OF THE DRAWINGS

[0165] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.

[0166] Figure 1 is a flow chart of the method of the present invention;

[0167] Figure 2 It is a schematic diagram of the structure of the electric power and natural gas combined system in an embodiment of the present invention. DETAILED DESCRIPTION

[0168] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention. Embodiment 1

[0169] Reference Figure 1 The present invention relates to an optimized energy flow calculation method for an electric power and natural gas combined system, comprising:

[0170] Step S1: Under the premise of considering the power-gas combined system under alternative gas injection, setting the safety index of the power-gas combined system, and constraining the fluctuation of gas composition by the safety index;

[0171] Step S2: Under the condition of the safety index, construct an optimized energy flow model of the power-gas combined system considering the injection of alternative gas;

[0172] The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 comprises: modeling the natural gas system, modeling the coupling element, modeling the power system, and constructing an objective function, wherein the power-gas combined system includes the natural gas system and the power system;

[0173] Step S3: converting the optimized energy flow model to obtain a converted optimized energy flow model;

[0174] Step S4: solving the converted optimized energy flow model.

[0175] The following is a detailed introduction to this embodiment:

[0176] Step S1: A series of safety indicators of the power-gas combined system (mainly for the natural gas system in the power-gas combined system) are proposed to constrain the fluctuation of gas composition.

[0177] Step S2: an optimized energy flow model for the power-gas combined system considering alternative gas injection is proposed, in which the physical properties of the gas mixture (including relative density, etc.) are modeled as variables, which can more accurately reflect the impact of alternative gas injection.

[0178] Step S3: A customized convex optimization technique is proposed to transform the originally highly nonlinear and non-convex optimization energy flow model into a more tractable form.

[0179] Step S4: Propose a sequential programming algorithm, using an adaptive convergence criterion to better balance and improve feasibility and convergence in the process of solving the optimized energy flow model.

[0180] This embodiment considers the structure of the integrated electricity and gas system (IEGS) under alternative gas injection. Figure 2As shown in Figure 1, it consists of an electricity system (i.e., electricity network) and a natural gas system (i.e., natural gas network). In the electricity system, electricity is provided by traditional power generation units (TPPs), gas-fired power generation units (GPPs), and renewable energy units to meet the electricity load demand at different locations. In the natural gas system, a variety of gases, including natural gas, biomass gas, etc., can be injected into the natural gas pipeline network at different locations to meet the gas demand of the natural gas load. The electricity and natural gas networks are tightly coupled through GPPs and power-to-gas (PTG). GPPs consume natural gas from the natural gas network to generate electricity. PTGs consume electricity and water to produce hydrogen and methane. The gas products of PTG need to be purified and compressed first. Then, for safety reasons, they can be injected into a private natural gas network separated from the main grid. Due to sufficient turbulent characteristics in the pipeline, the substitute gas can be fully mixed with the natural gas. After the substitute gas is injected into the natural gas transmission network, multi-point measurements will be carried out to ensure that the gas quality meets expectations. Then, the gas mixture can be transported to other locations in the natural gas system for further use by the natural gas load.

[0181] Step S1 specifically includes the following steps:

[0182] Although mixing natural gas with alternative gases may cause safety issues, safety issues can be minimized if the amount of mixed gas is strictly monitored and controlled. The main focus here is on the interchangeability of gases. Interchangeability is defined as the ability of consumers to use mixed gases without increasing potential risks or making any further adjustments to gas appliances. This embodiment proposes multiple safety indicators to ensure gas interchangeability:

[0183] 1.1) Wobbe Index

[0184] The Wobbe index characterizes the energy output of a mixture when it is burned at the same pressure. It is a widely used index in many countries such as the United Kingdom, Australia, France, etc. When hydrogen is injected, the Wobbe index of the mixture is likely to decrease. Therefore, it is very important to keep the Wobbe index within a certain range to ensure the best combustion of gas appliances. The formula is as follows:

[0185] ;

[0186] ;

[0187] in, is the calorific value of natural gas at node i (here refers to the natural gas node); is the calorific value of gas component r; is the collection of gas components; is the mole fraction of gas component r at node i; is the Wobbe index of node i; is the relative density of the gas at node i.

[0188] 1.2) Weaver flame speed factor

[0189] The Weaver flame speed factor describes the approximate maximum speed at which a flame can propagate in any gas-air mixture. It is also a commonly used metric that is plotted against the Wobbe Index by British Gas to characterize the interchangeability of gases. The injection of hydrogen can slightly increase the flame speed. Therefore, keeping the Weaver flame speed factor within a certain range is important to avoid flashback, overheating problems, potential corrosion of materials, etc. It is usually assumed that the maximum flame speed of a gas mixture is a linear function of each gas component. It can then be calculated according to the following empirical equation:

[0190] ;

[0191] in, is the Weaver flame speed factor of node i; is the combustion velocity of the gas component r in the stoichiometric air mixture; is the air-fuel ratio; and are the mole fraction of inert gas and the mole fraction of oxygen at node i, respectively.

[0192] 1.3) Combustion potential

[0193] The combustion potential is also a classic and empirical indicator for measuring the interchangeability of natural gas combustion rate and combustion stability. It is also used as the horizontal axis in the Delbourg method, with the Wobbe index as the vertical axis. Keeping the combustion potential within a certain range is also important to ensure optimal combustion of gas appliances. The combustion potential formula is as follows:

[0194] ;

[0195] ;

[0196] ;

[0197] ;

[0198] in, is the combustion potential of node i; is the node i Correction value of for Correction value of is the combustion potential of gas component r at node i; is the molecular density of gas component r; is the combustion potential coefficient of gas component r; is the oxidation coefficient.

[0199] In the proposed optimized energy flow model, the mole fraction, relative density, GCV and the above =[ ] should be constrained within certain thresholds:

[0200] ;

[0201] in, For hydrogen, A value in Safety index calculated for the original natural gas; is the threshold of the safety indicator.

[0202] With these indicators, the safety of IEGS is mainly regulated by two measures: 1) Regulating the operating conditions of PTG. If natural gas safety is allowed, PTG will produce more hydrogen and inject it into the pipeline. However, due to the lower Wobbe index and higher flame speed factor of hydrogen, excessive injection of hydrogen may cause safety problems. Therefore, if system safety does not allow, the hydrogen production of PTG will be reduced, or more hydrogen will be converted into methane and injected into the pipeline. 2) Use regulating gas. Commonly used regulating gases include nitrogen and liquefied petroleum gas (LPG). LPG has a similar gas composition to natural gas, so it is often used to offset the reduction in Wobbe index and GCV caused by hydrogen. Nitrogen is often used to adjust the flame speed. Regulating gas is relatively expensive, so cost-effectiveness usually needs to be considered comprehensively.

[0203] Step S2 specifically includes the following steps:

[0204] 2.1) Natural gas system modeling

[0205] 2.1.1) Natural Gas Load Modeling

[0206] In traditional gas system models, gas demand is usually measured as gas flow at standard temperature and pressure conditions. This representation is applicable and simplifies calculations when the gas composition is the same throughout the gas network. However, given the distributed injection of alternative gases, the gas composition varies at different locations in the network. Given that gas is essentially consumed by the combustion of gas appliances (such as cookers) to produce heat, gas demand can be expressed in terms of energy. The heat energy consumed by the consumed mixed gas should be equal to the energy embodied in the original gas demand:

[0207] ;

[0208] ;

[0209] in, GCV is raw natural gas without any other gas components; is the original natural gas load; is the natural gas load of gas component r at node i.

[0210] 2.1.2) Natural gas source modeling

[0211] The composition of natural gas from different gas sources may be different. Therefore, the natural gas source of node i can be expressed as a natural gas supply vector:

[0212] ;

[0213] ;

[0214] in, is the natural gas supply vector of natural gas source l at node i; R is the number of gas components; The supply of gas component r from the natural gas source at node i; is the mole fraction of gas component r of natural gas source l at node i.

[0215] The gas production of the natural gas source needs to meet its upper and lower limit constraints:

[0216] ;

[0217] in, and are the upper and lower limits of the natural gas supply of the natural gas source l at node i, respectively.

[0218] 2.1.3) Natural gas flow modeling in pipelines

[0219] In a pipeline with high gas pressure, the Weymouth equation can be used to describe the relationship between gas flow and node gas pressure:

[0220] ;

[0221] ;

[0222] ;

[0223] ;

[0224] ;

[0225] in, is the natural gas flow rate between node i and node j; and is the nodal air pressure at nodes i and j; is the characteristic parameter of pipeline ij; is the gas constant of air; and is the temperature and pressure under standard conditions; , and is the diameter, length and friction coefficient of the pipe ij; and are the relative density and compressibility of the gas mixture in the pipeline ij (note that these two parameters are independent variables that change with the gas composition in the pipeline, so they will change during operation); is the temperature of the gas in the pipeline; is the flow rate of gas component r in pipe ij; is the capacity of pipeline ij; and are the upper and lower limits of the air pressure at node i.

[0226] 2.1.4) Natural gas flow node balance

[0227] This example assumes that the mixing of gases does not cause any physical or chemical reactions, nor does it produce any phase changes in the gas components. There is no gas leakage or gas storage effect in the natural gas node. According to Kirchhoff's law, for each gas component r, the gas flowing into the node is equal to the gas flowing out of the node, as shown below:

[0228] ;

[0229] in, , and is the set of natural gas source, PTG and GPP of node i; is the set of all nodes connected to node i; is the gas composition r produced by PTG l at node i; is the amount of gas component r consumed by GPP j at node i.

[0230] 2.1.5) Natural gas mixing process modeling

[0231] Due to the turbulence in the natural gas flow, the injected hydrogen and natural gas can be mixed quickly and evenly without the aid of additional mixing equipment. Within the time frame studied in this embodiment, the mixing process can be considered to be completed instantly. A gas node can connect six system components. For a specific gas node, the gas may come from the gas source, PTG, and upstream pipelines. These gases are fully and evenly mixed at the gas node, and then the gas mixture is transported to the natural gas load, GPP, and downstream pipelines.

[0232] In order to describe the gas mixing process, the sum of the gas components r flowing into node i is , and the sum of all gas components flowing into node i is and Because the nodal gas injection is related to the direction of the gas flow, and this direction may be different under different conditions, the actual gas flow direction is represented by the integer variable Indicates that Indicates that the actual flow direction of the natural gas flow is from i to j, On the contrary, the calculation formula for the inflow of gas component r at node i is:

[0233] ;

[0234] The gas composition at node i can be calculated as:

[0235] ;

[0236] In (14), the relative density and compression factor are variables, determined by the gas composition. They can be calculated as:

[0237] ;

[0238] ;

[0239] ;

[0240] in, is the molecular mass of air; is a function of the compressibility factor, which is related to the air pressure and gas composition, as described below:

[0241] ;

[0242] ;

[0243] ;

[0244] ;

[0245] in, and Two parameters needed to calculate the compression factor; is the average pressure of the gas in pipe ij; and are the critical temperature and critical pressure of gas component r.

[0246] 2.2) Coupling element modeling

[0247] 2.2.1) PTG (Power-to-Gas Modeling)

[0248] PTG facilities usually consume excess renewable energy to produce natural gas. The process consists of two sub-processes, electrolysis and methanation, which produce hydrogen and methane respectively. The relationship between electricity consumption and gas production can be expressed as follows:

[0249] ;

[0250] ;

[0251] in, is the power consumption of PTG l at node i; and for the efficiency of the electrolysis and methanation processes; and GCV for methane and hydrogen; and is the hydrogen and methane production of PTG l at node i.

[0252] The electricity consumption of power-to-gas is also subject to the following constraints:

[0253] ;

[0254] in, is the maximum power consumption of PTG l of node i.

[0255] 2.2.2) Gas Generator Set

[0256] The gas unit consumes a gas mixture to generate electricity, which can be expressed by the following formula:

[0257] ;

[0258] ;

[0259] in, is the power generation power of the gas unit at node i; is the efficiency of gas unit l at node i; is the consumption of gas component r of gas generator set l at node i.

[0260] 2.3) Power system modeling

[0261] This embodiment uses an AC power flow model to model the power system. This embodiment also uses a second-order cone relaxation technique to convexify the AC power flow model:

[0262] ;

[0263] ;

[0264] ;

[0265] ;

[0266] ;

[0267] ;

[0268] ;

[0269] ;

[0270] ;

[0271] ;

[0272] Among them, formulas (30) and (31) are the active power and reactive power balance of node power; formula (32) represents the relationship between voltage drop and power flow on the power line; formula (33) is the second order cone (SOC) relaxation constraint; formula (34) is the upper limit constraint of apparent power on the power line; formulas (35)-(37) are the upper and lower limits of active power and reactive power of traditional generator sets, gas generator sets and renewable energy generator sets; formula (38) constrains the maximum reactive power of renewable energy generator sets; formula (39) is the voltage amplitude constraint.

[0273] and is the set of traditional units and renewable energy units at node i; , , and is the active power generation of the gas-fired unit, traditional unit, renewable energy unit and the active power consumption of power-to-gas conversion at node i; is the active power of the power load at power node i; is the active power of the power flow of power line ij; , , and is the reactive power generation of the gas-fired unit, conventional generator unit, renewable energy unit i at node i, and the reactive power consumption of the power-to-gas unit i; is the reactive power of the power load at node i; is the reactive power of the power flow of power line ij; is the square of the voltage amplitude at node i; is the square of the current amplitude of the power line ij; and is the resistance and reactance of the power line ij; is the apparent power capacity of power line ij; , , , , and The lower and upper limits of active power for traditional generator sets, gas generator sets, and renewable energy generation; , , , , and The lower and upper limits of reactive power for traditional generator sets, gas generator sets, and renewable energy generation; is the power factor of the renewable energy unit at node i.

[0274] 2.4) Objective Function

[0275] The goal of optimizing energy flow is to minimize total operating costs , by adjusting the operating status of IEGS components (conventional generators, gas generators, renewable energy generators, power-to-gas, and natural gas sources). The operating costs include: the power generation cost of traditional generators, the gas production cost of natural gas sources, and green hydrogen subsidies.

[0276] ;

[0277] in, is a collection of nodes; is the cost function of the traditional generator set l at node i; is the node gas production price of natural gas source j at node i; The subsidized price for green hydrogen.

[0278] Step S3 specifically includes the following steps:

[0279] 3.1) Mixed integer second-order cone relaxation of the natural gas flow equation

[0280] The above optimization energy flow model is highly nonlinear and non-convex, so it cannot be solved directly by mature solvers. This nonlinear form takes many different forms, so different reconstruction techniques are required.

[0281] The Weymouth equation in formula (14) can be transformed into a mixed integer second-order cone form:

[0282] ;

[0283] ;

[0284] ;

[0285] ;

[0286] ;

[0287] in, ); is the redundant variable of pipeline ij; is the square of the node pressure; ; ;

[0288] Formula (17) and Formula (18) are replaced by Formula (46) and Formula (47), respectively:

[0289] ;

[0290] ;

[0291] However, the relaxation of formulas (41)-(47) is not always accurate. In order to make the relaxation tighter, this embodiment adopts two techniques, penalty function and sequence planning technique.

[0292] In the penalty function method, in order to drive the relaxation of formula (41) to be tighter, a penalty term is added Added to the objective function (40), where is the penalty coefficient. The specific steps will be described in detail in step S4. This method can make the relaxation tighter without increasing the computational burden.

[0293] In sequence programming technology, the idea is to update the feasible domain of the optimization problem in each iteration, so that the optimization problem can be solved under the condition that the constraints can be violated to a certain extent at the beginning. During the iteration process, the feasible domain gradually approaches the real feasible domain, thereby obtaining a real feasible solution. Although this method may slightly increase the calculation time, its solution will be more robust and easier to converge. Accordingly, this embodiment adds additional constraints based on Taylor expansion:

[0294] ;

[0295] Where v is the ordinal number of the iteration; express The value at iteration v; is a slack variable, representing The error of the Taylor expansion of . Formula (41) can be processed in a similar way. The detailed sequence planning process is introduced in detail in step S4.

[0296] 3.2) Bilinear reconstruction based on McCormick Envelopes

[0297] Bilinear terms exist in the gas mixing equation and the relative density calculation equations (20)-(23). In this embodiment, it is observed that the bilinear terms in these equations consist of an integer variable and a continuous variable. Therefore, the relaxation based on the McCormickenvelope method is accurate. Taking the calculation of relative density as an example, formulas (20)-(21) can first be equivalent to the following formula based on Taylor expansion:

[0298] ;

[0299] ;

[0300] in, In the vth iteration The increment of is the slack variable, which represents the Taylor residue of the gas component r at node i during the vth iteration; for The upper limit of is used to drive formula (49) to become tighter; it is worth noting that in the Taylor expansion The reference value of is determined by its value in the previous iteration v-1. Therefore, it can be processed by the sequence planning technique at the same time.

[0301] Then, let , formula (23) can be replaced by McCormick envelopes:

[0302] ;

[0303] ;

[0304] ;

[0305] ;

[0306] 3.3) Linearization of safety indicators

[0307] For the Wobbe index in formula (2), the nonlinear term exists in the form of , the relative density of the original natural gas As a reference point, it can be linearized based on the Taylor expansion:

[0308] ;

[0309] Substituting formula (55) into formula (2), its linearized form can be obtained.

[0310] Step S4 specifically includes the following steps:

[0311] After the reconstruction and relaxation techniques in the previous step, the original highly nonlinear optimization model is now converted into a mixed integer second-order cone programming model. However, some relaxations are still inaccurate. Therefore, this embodiment designs a sequence programming algorithm, combined with an adaptive penalty coefficient, to improve convergence and computational efficiency. The solution process is detailed as follows:

[0312] Step 41: Initialize the physical parameters of the IEGS (including but not limited to the connection topology of nodes and lines, generator capacity, line impedance, etc.), safety constraints, and other used parameters (such as generator power generation cost parameters, etc.).

[0313] Step 42: Solve the optimized energy flow problem of IEGS without considering the injection of alternative gas, and set its solution as the reference point.

[0314] Step 43: Initialize the iteration number v = 0, and initialize the initial reference point of the sequence planning according to the reference point obtained in step 42, including , , , , , , , and , initialize the penalty coefficient for sequence planning , , and their upper limits , , set the remainder threshold , , , and .

[0315] Step 44: In the vth iteration, solve the following mixed integer second-order cone programming problem:

[0316] ;

[0317] And subject to the constraints: Formula (9)-(13), Formula (19), Formula (25)-(39), Formula (1)-(8), Formula (41)-(54);

[0318] in, is the set of pipelines, the security constraints is replaced by formula (55);

[0319] The optimization variables are: 1) Square of the node pressure ; 2) Gas production rate of natural gas source; 3) Natural gas load of each gas component ; 4) Hydrogen and methane production rates from power-to-gas conversion and ; 5) Power consumption of power-to-gas ; 6) Power generation of traditional generator sets, gas generator sets and renewable energy generator sets , , ; 7) Consumption of gas component r by gas generator set ;8) Voltage phase angle ; 9) Direction of natural gas flow ; 10) Gas composition ; 11) Natural gas flow of various gas components in natural gas pipelines ; 12) Slack variables , , , and ;

[0320] Solve the above optimization problem and get the solution of the vth iteration;

[0321] Step 45: Update the current iteration according to formula (20), formula (23), and formula (24). , and ;

[0322] Step 46: Check whether the remainder of the sequence plan satisfies the following conditions:

[0323] ;

[0324] If formula (57) holds, the sequence planning ends and the final solution is output; otherwise, the penalty coefficient is updated according to formulas (58) and (59), and the process returns to step 44;

[0325] ;

[0326] ;

[0327] in, is the multiplier of the penalty coefficient.

[0328] This embodiment can obtain the operating status of each device in the natural gas joint system by solving the optimized energy flow model, including but not limited to the power generation power of the generator set, the gas production rate of the natural gas source, the node gas pressure, the natural gas flow in the pipeline, etc., and then coordinate the coordinated operation of the power and natural gas systems according to the operating status to achieve the optimal operating state. Embodiment 2

[0329] This embodiment provides an optimized energy flow calculation system for an electric power and natural gas combined system, including:

[0330] Index setting module: used to set the safety index of the power-gas combined system under the premise of considering the injection of alternative gas, and to constrain the fluctuation of gas composition through the safety index;

[0331] The safety indicators of the electric power and natural gas combined system are set in the indicator setting module, specifically:

[0332] Set the Wobbe index, the formula is:

[0333] ;

[0334] ;

[0335] in, is the calorific value of natural gas at node i; is the calorific value of gas component r; is the collection of gas components; is the mole fraction of gas component r at node i; is the Wobbe index of node i; is the relative density of the gas at node i;

[0336] Set the Weaver flame speed factor, the formula is:

[0337] ;

[0338] in, is the Weaver flame speed factor of node i; is the combustion velocity of the gas component r in the stoichiometric air mixture; is the air-fuel ratio; and are the mole fraction of inert gas and the mole fraction of oxygen at node i, respectively;

[0339] Set the combustion potential, the formula is:

[0340] ;

[0341] ;

[0342] ;

[0343] ;

[0344] in, is the combustion potential of node i; is the node i Correction value of for Correction value of is the combustion potential of gas component r at node i; is the molecular density of gas component r; is the combustion potential coefficient of gas component r; is the oxidation coefficient;

[0345] Safety index =[ ] is constrained within a certain threshold:

[0346] ;

[0347] in, For hydrogen, Safety index calculated for the original natural gas; is the threshold value of the safety indicator;

[0348] Model building module: used for building an optimized energy flow model of the power-gas combined system considering alternative gas injection under the condition of the safety index;

[0349] Optimization module: used for converting the optimized energy flow model to obtain a converted optimized energy flow model;

[0350] Calculation module: used to solve the converted optimized energy flow model. Embodiment 3

[0351] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for calculating the optimized energy flow of the electric power and natural gas combined system described in the first embodiment are implemented. Embodiment 4

[0352] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for calculating the optimized energy flow of the electric power and natural gas combined system described in the first embodiment are implemented.

[0353] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present application may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0354] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0355] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0356] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0357] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0358] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A method for calculating the optimal energy flow of a power and natural gas combined system, characterized in that: include: Step S1: Under the premise of considering the power-gas combined system under alternative gas injection, setting the safety index of the power-gas combined system, and constraining the fluctuation of gas composition by the safety index; The method for setting the safety index of the power and natural gas combined system in step S1 is: Set the Wobbe index, the formula is: ; ; in, is the calorific value of natural gas at node i; is the calorific value of gas component r; is the collection of gas components; is the mole fraction of gas component r at node i; is the Wobbe index of node i; is the relative density of the gas at node i; Set the Weaver flame speed factor, the formula is: ; in, is the Weaver flame speed factor of node i; is the combustion velocity of the gas component r in the stoichiometric air mixture; is the air-fuel ratio; and are the mole fraction of inert gas and the mole fraction of oxygen at node i, respectively; Set the combustion potential, the formula is: ; ; ; ; in, is the combustion potential of node i; is the node i Correction value of for Correction value of is the combustion potential of gas component r at node i; is the molecular mass of the gas component r; is the combustion potential coefficient of gas component r; is the oxidation coefficient; Safety index =[ ] is constrained within a certain threshold: ; in, For hydrogen, Safety index calculated for the original natural gas; is the threshold value of the safety indicator; Step S2: Under the condition of the safety index, construct an optimized energy flow model of the power-gas combined system considering the injection of alternative gas; Step S3: converting the optimized energy flow model to obtain a converted optimized energy flow model; Step S4: solving the converted optimized energy flow model; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 includes: modeling the natural gas system by: To model the natural gas load, the formula is: ; ; in, GCV is raw natural gas without any other gas components; is the original natural gas load; is the natural gas load of gas component r at node i; Modeling the natural gas source, the formula is: ; ; in, is the natural gas supply vector of natural gas source l at node i; R is the number of gas components; The supply of gas component r from the natural gas source at node i; is the mole fraction of gas component r of natural gas source l at node i; The gas production of the natural gas source meets the upper and lower limit constraints: ; in, and are the upper and lower limits of natural gas supply from natural gas source l at node i, respectively; The natural gas flow in the pipeline is modeled and the Weymouth equation is used to describe the relationship between the gas flow rate and the node gas pressure. The formula is: ; ; ; ; ; in, is the natural gas flow rate between node i and node j; and is the nodal air pressure at nodes i and j; is the characteristic parameter of pipeline ij between gas node i and gas node j; is the gas constant of air; and is the temperature and pressure under standard conditions; , and is the diameter, length and friction coefficient of the pipe ij; and is the relative density and compressibility of the gas mixture in the pipe ij; is the temperature of the gas in the pipeline; is the flow rate of gas component r in pipe ij; is the capacity of pipeline ij; and is the upper and lower limits of the air pressure at node i; Construct a natural gas flow node balance model: According to Kirchhoff's law, for each gas component r, the gas flowing into the node is equal to the gas flowing out of the node, so: ; in, , and is the set of natural gas source, PTG and GPP of node i; is the set of all nodes connected to node i; is the gas composition r produced by PTG l at node i; is the amount of gas component r consumed by GPP l at node i; where PTG is power-to-gas and GPP is gas-fired unit; Modeling the natural gas mixing process: To describe the gas mixing process, the inflow of gas component r flowing into node i is , and the sum of all gas components flowing into node i is and ; The actual direction of the gas flow is represented by the integer variable Indicates that Indicates that the actual flow direction of the natural gas flow is from i to j, On the contrary, the calculation formula for the inflow of gas component r at node i is: ; The mole fraction calculation formula of the gas component r at node i is: ; In formula (14), the relative density and compression factor is a variable, determined by the gas composition, and the calculation formula is: ; ; ; in, is the molecular mass of air; is a function of the compressibility factor, which is related to the air pressure and gas composition, specifically: ; ; ; ; in, and Two parameters needed to calculate the compression factor; is the average pressure of the gas in pipe ij; and is the critical temperature and critical pressure of gas component r; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 includes: modeling the coupling element by: The power-to-gas model is: ; ; in, is the power consumption of PTG l at node i; and for the efficiency of the electrolysis and methanation processes; and GCV for methane and hydrogen; and is the hydrogen and methane production of PTG l at node i; The power consumption of power-to-gas meets the following constraints: ; in, is the maximum power consumption of PTG l of node i; The formula for modeling the gas unit is: ; ; in, is the power generation power of gas unit l at node i; is the efficiency of gas unit l at node i; is the consumption of gas component r of gas generator set l at node i; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 includes: modeling the power system by: The AC power flow model is used to model the power system, and the second-order cone relaxation technique is used to convexify the AC power flow model. The formula is: ; ; ; ; ; ; ; ; ; ; in, and is the set of traditional units and renewable energy units at node i; , , and is the active power generation of the gas-fired unit, traditional unit, renewable energy unit and the active power consumption of power-to-gas conversion at node i; is the active power of the power load at power node i; is the active power of the power flow of power line ij; , , and is the reactive power generation of the gas-fired unit, conventional generator unit, renewable energy unit i at node i, and the reactive power consumption of the power-to-gas unit i; is the reactive power of the power load at node i; is the reactive power of the power flow of power line ij; is the square of the voltage amplitude at node i; is the square of the current amplitude of the power line ij; and is the resistance and reactance of the power line ij; is the apparent power capacity of power line ij; , , , , and The lower and upper limits of active power for traditional generator sets, gas generator sets, and renewable energy generation; , , , , and The lower and upper limits of reactive power for traditional generator sets, gas generator sets, and renewable energy generation; is the power factor of the renewable energy unit at node i; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in step S2 includes: constructing an objective function, the method is: The goal of constructing an optimized energy flow is to minimize the total operating cost. , the formula is, ; in, is a collection of nodes; is the cost function of the traditional generator set l at node i; is the node gas production price of natural gas source l at node i; Subsidized price for green hydrogen; The method for converting the optimized energy flow model in step S3 is: Mixed integer second-order cone relaxation of the natural gas flow equation: The Weymouth equation with respect to equation (14) is transformed into a mixed integer second-order cone form: ; ; ; ; ; in, ; is the redundant variable of pipeline ij; is the square of the node pressure; ; Formula (17) and Formula (18) are replaced by Formula (46) and Formula (47), respectively: ; ; The penalty function and sequence programming techniques are used to reduce the computational complexity of formulas (41)-(47), where: In the penalty function, in order to drive the relaxation of formula (41) to be tighter, a penalty term is added to formula (40); In the sequence planning technique, additional constraints are added and the formula is: ; Where v is the ordinal number of the iteration; express The value at iteration v; is a slack variable, representing The error of the Taylor expansion of ; Reconstruction of bilinear terms based on McCormick Envelopes: Based on the relative density calculation, formulas (20)-(21) are equivalent to Taylor expansion: ; ; in, In the vth iteration The increment of is the slack variable, which represents the Taylor residue of the gas component r at node i during the vth iteration; for The upper limit of is used to drive formula (49) to become tighter; it is worth noting that in the Taylor expansion The reference value of is determined by its value in the previous iteration v-1; make , formula (23) is replaced by McCormick envelopes: ; ; ; ; Linearize the safety index: For the Wobbe index in formula (2), the nonlinear term exists in the form of , the relative density of the original natural gas As a reference point, linearize it based on the Taylor expansion: ; Substitute formula (55) into formula (2) to obtain its linearized form; The method for solving the converted optimized energy flow model in step S4 is: Step 41: Initialize physical parameters, security index constraints, and other used parameters of the power and gas combined system; Step 42: solving the optimal energy flow problem of the power-gas combined system without considering the injection of alternative gas, and setting the solution as a reference point; Step 43: Initialize the iteration number v = 0, and initialize the initial reference point of the sequence planning according to the reference point obtained in step 42, including , , , , , , , and , initialize the penalty coefficient for sequence planning , , and their upper limits , , set the remainder threshold , , , and ; Step 44: In the vth iteration, solve the mixed integer second-order cone programming problem, the formula is: ; And subject to the constraints: Formula (9)-(13), Formula (19), Formula (25)-(39), Formula (1)-(8), Formula (41)-(54); in, is the set of pipelines, the security constraints is replaced by formula (55); The optimization variable is: square of node pressure ; Gas production rate of natural gas source; Natural gas load of each gas component ; Hydrogen and methane production of PTG l at node i and ; Power consumption of power-to-gas ; Power generation capacity of traditional generator sets, gas generator sets and renewable energy generator sets , , ; Consumption of gas component r by gas generator set ; Direction of natural gas flow ; Gas composition ; Flow rate of gas component r in pipe ij ; Slack variables , , , and ; By solving the mixed integer second-order cone programming problem in step 44, a solution for the vth iteration is obtained; Step 45: Update the vth iteration according to formula (20), formula (23), and formula (24). , and ; Step 46: Check whether the remainder of the sequence planning satisfies the condition of formula (57): ; If formula (57) holds, the sequence planning ends and the final solution is output; otherwise, the penalty coefficient is updated according to formulas (58) and (59), and the process returns to step 44; ; ; in, is the multiplier of the penalty coefficient.

2. An optimized energy flow calculation system for an electric power and natural gas combined system, characterized in that: include: Index setting module: used to set the safety index of the power-gas combined system under the premise of considering the injection of alternative gas, and to constrain the fluctuation of gas composition through the safety index; The safety indicators of the electric power and natural gas combined system are set in the indicator setting module, specifically: Set the Wobbe index, the formula is: ; ; in, is the calorific value of natural gas at node i; is the calorific value of gas component r; is the collection of gas components; is the mole fraction of gas component r at node i; is the Wobbe index of node i; is the relative density of the gas at node i; Set the Weaver flame speed factor, the formula is: ; in, is the Weaver flame speed factor of node i; is the combustion velocity of the gas component r in the stoichiometric air mixture; is the air-fuel ratio; and are the mole fraction of inert gas and the mole fraction of oxygen at node i, respectively; Set the combustion potential, the formula is: ; ; ; ; in, is the combustion potential of node i; is the node i Correction value of for Correction value of is the combustion potential of gas component r at node i; is the molecular mass of the gas component r; is the combustion potential coefficient of gas component r; is the oxidation coefficient; Safety index =[ ] is constrained within a certain threshold: ; in, For hydrogen, Safety index calculated for the original natural gas; is the threshold value of the safety indicator; Model building module: used for building an optimized energy flow model of the power-gas combined system considering alternative gas injection under the condition of the safety index; Optimization module: used for converting the optimized energy flow model to obtain a converted optimized energy flow model; Calculation module: used for solving the converted optimized energy flow model; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in the model construction module includes: modeling the natural gas system by: To model the natural gas load, the formula is: ; ; in, GCV is raw natural gas without any other gas components; is the original natural gas load; is the natural gas load of gas component r at node i; Modeling the natural gas source, the formula is: ; ; in, is the natural gas supply vector of natural gas source l at node i; R is the number of gas components; The supply of gas component r from the natural gas source at node i; is the mole fraction of gas component r of natural gas source l at node i; The gas production of the natural gas source meets the upper and lower limit constraints: ; in, and are the upper and lower limits of natural gas supply from natural gas source l at node i, respectively; The natural gas flow in the pipeline is modeled and the Weymouth equation is used to describe the relationship between the gas flow rate and the node gas pressure. The formula is: ; ; ; ; ; in, is the natural gas flow rate between node i and node j; and is the nodal air pressure at nodes i and j; is the characteristic parameter of pipeline ij between gas node i and gas node j; is the gas constant of air; and is the temperature and pressure under standard conditions; , and is the diameter, length and friction coefficient of the pipe ij; and is the relative density and compressibility of the gas mixture in the pipe ij; is the temperature of the gas in the pipeline; is the flow rate of gas component r in pipe ij; is the capacity of pipeline ij; and is the upper and lower limits of the air pressure at node i; Construct a natural gas flow node balance model: According to Kirchhoff's law, for each gas component r, the gas flowing into the node is equal to the gas flowing out of the node, so: ; in, , and is the set of natural gas source, PTG and GPP of node i; is the set of all nodes connected to node i; is the gas composition r produced by PTG l at node i; is the amount of gas component r consumed by GPP l at node i; where PTG is power-to-gas and GPP is gas-fired unit; Modeling the natural gas mixing process: To describe the gas mixing process, the inflow of gas component r flowing into node i is , and the sum of all gas components flowing into node i is and ; The actual direction of the gas flow is represented by the integer variable Indicates that Indicates that the actual flow direction of the natural gas flow is from i to j, On the contrary, the calculation formula for the inflow of gas component r at node i is: ; The mole fraction calculation formula of the gas component r at node i is: ; In formula (14), the relative density and compression factor is a variable, determined by the gas composition, and the calculation formula is: ; ; ; in, is the molecular mass of air; is a function of the compressibility factor, which is related to the air pressure and gas composition, specifically: ; ; ; ; in, and Two parameters needed to calculate the compression factor; is the average pressure of the gas in pipe ij; and is the critical temperature and critical pressure of gas component r; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in the model construction module includes: modeling the coupling element by: The power-to-gas model is: ; ; in, is the power consumption of PTG l at node i; and for the efficiency of the electrolysis and methanation processes; and GCV for methane and hydrogen; and is the hydrogen and methane production of PTG l at node i; The power consumption of power-to-gas meets the following constraints: ; in, is the maximum power consumption of PTG l of node i; The formula for modeling the gas unit is: ; ; in, is the power generation power of gas unit l at node i; is the efficiency of gas unit l at node i; is the consumption of gas component r of gas generator set l at node i; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in the model construction module includes: modeling the power system by: The AC power flow model is used to model the power system, and the second-order cone relaxation technique is used to convexify the AC power flow model. The formula is: ; ; ; ; ; ; ; ; ; ; in, and is the set of traditional units and renewable energy units at node i; , , and is the active power generation of the gas-fired unit, traditional unit, renewable energy unit and the active power consumption of power-to-gas conversion at node i; is the active power of the power load at power node i; is the active power of the power flow of power line ij; , , and is the reactive power generation of the gas-fired unit, conventional generator unit, renewable energy unit i at node i, and the reactive power consumption of the power-to-gas unit i; is the reactive power of the power load at node i; is the reactive power of the power flow of power line ij; is the square of the voltage amplitude at node i; is the square of the current amplitude of the power line ij; and is the resistance and reactance of the power line ij; is the apparent power capacity of power line ij; , , , , and The lower and upper limits of active power for traditional generator sets, gas generator sets, and renewable energy generation; , , , , and The lower and upper limits of reactive power for traditional generator sets, gas generator sets, and renewable energy generation; is the power factor of the renewable energy unit at node i; The method for constructing the optimized energy flow model of the power-gas combined system considering the injection of alternative gas in the model construction module includes: constructing an objective function, the method is: The goal of constructing an optimized energy flow is to minimize the total operating cost. , the formula is, ; in, is a collection of nodes; is the cost function of the traditional generator set l at node i; is the node gas production price of natural gas source l at node i; Subsidized price for green hydrogen; The method for converting the optimized energy flow model in the optimization module is: Mixed integer second-order cone relaxation of the natural gas flow equation: The Weymouth equation with respect to equation (14) is transformed into a mixed integer second-order cone form: ; ; ; ; ; in, ; is the redundant variable of pipeline ij; is the square of the node pressure; ; Formula (17) and Formula (18) are replaced by Formula (46) and Formula (47), respectively: ; ; The penalty function and sequence programming techniques are used to reduce the computational complexity of formulas (41)-(47), where: In the penalty function, in order to drive the relaxation of formula (41) to be tighter, a penalty term is added to formula (40); In the sequence planning technique, additional constraints are added and the formula is: ; Where v is the ordinal number of the iteration; express The value at iteration v; is a slack variable, representing The error of the Taylor expansion of ; Reconstruction of bilinear terms based on McCormick Envelopes: Based on the relative density calculation, formulas (20)-(21) are equivalent to Taylor expansion: ; ; in, In the vth iteration The increment of is the slack variable, which represents the Taylor residue of the gas component r at node i during the vth iteration; for The upper limit of is used to drive formula (49) to become tighter; it is worth noting that in the Taylor expansion The reference value of is determined by its value in the previous iteration v-1; make , formula (23) is replaced by McCormick envelopes: ; ; ; ; Linearize the safety index: For the Wobbe index in formula (2), the nonlinear term exists in the form of , the relative density of the original natural gas As a reference point, linearize it based on the Taylor expansion: ; Substitute formula (55) into formula (2) to obtain its linearized form; The method for solving the converted optimized energy flow model in the calculation module is: Step 41: Initialize physical parameters, security index constraints, and other used parameters of the power and gas combined system; Step 42: solving the optimal energy flow problem of the power-gas combined system without considering the injection of alternative gas, and setting the solution as a reference point; Step 43: Initialize the iteration number v = 0, and initialize the initial reference point of the sequence planning according to the reference point obtained in step 42, including , , , , , , , and , initialize the penalty coefficient for sequence planning , , and their upper limits , , set the remainder threshold , , , and ; Step 44: In the vth iteration, solve the mixed integer second-order cone programming problem, the formula is: ; And subject to the constraints: Formula (9)-(13), Formula (19), Formula (25)-(39), Formula (1)-(8), Formula (41)-(54); in, is the set of pipelines, the security constraints is replaced by formula (55); The optimization variable is: square of node pressure ; Gas production rate of natural gas source; Natural gas load of each gas component ; Hydrogen and methane production of PTG l at node i and ; Power consumption of power-to-gas ; Power generation capacity of traditional generator sets, gas generator sets and renewable energy generator sets , , ; Consumption of gas component r by gas generator set ; Direction of natural gas flow ; Gas composition ; Flow rate of gas component r in pipe ij ; Slack variables , , , and ; By solving the mixed integer second-order cone programming problem in step 44, a solution for the vth iteration is obtained; Step 45: Update the vth iteration according to formula (20), formula (23), and formula (24). , and ; Step 46: Check whether the remainder of the sequence planning satisfies the condition of formula (57): ; If formula (57) holds, the sequence planning ends and the final solution is output; otherwise, the penalty coefficient is updated according to formulas (58) and (59), and the process returns to step 44; ; ; in, is the multiplier of the penalty coefficient.

Citation Information

Patent Citations

  • Electric power and natural gas system joint optimization load flow calculation method considering hydrogen energy injection

    CN115017723A

  • Electric and gas combined system operation method considering dynamic characteristics of hydrogen-doped gas components

    CN118693926A