Electricity-gas comprehensive energy system forward-pushing back-substitution algorithm based on compensation airflow method
Technical Field
The invention belongs to the field of comprehensive energy systems and multi-energy load flow calculation, and relates to an electric-gas comprehensive energy system forward-backward substitution algorithm based on a compensation airflow method.
Background
The comprehensive energy system becomes one of the research hotspots of the current energy system, but because the energy sources are various and the power flow calculation is complex, finding a unified algorithm for power flow analysis is particularly important. Based on the core position of the power system in the comprehensive energy system, the comprehensive energy system is solved by adopting a resolving mode commonly adopted by the power system, so that the unification of the algorithm is realized.
The urban power grid has the characteristic of single-source radiation, load flow calculation is usually carried out by adopting a forward-backward substitution method, and the method has the obvious advantages of high calculation precision, less iteration times, lower requirement on initial values and the like. For an electric-gas integrated energy system, the radial topology of the gas distribution network offers the possibility of adaptation of the algorithm. However, because the gas network itself contains a ring, and the natural gas system is a nonlinear system, it cannot be handled by the superposition principle often used by the power system. Therefore, the traditional forward-backward substitution method suitable for power grid load flow calculation is popularized to natural gas network calculation, and a compensation airflow method is introduced, so that the algorithm can well process the ring-containing problem possibly existing in the electricity-gas integrated energy system.
The invention provides a forward-backward substitution algorithm of an electricity-gas comprehensive energy system based on a compensation airflow method. The method realizes the unification of the load flow calculation method of the electricity-gas integrated energy system, and simultaneously has good processing capability for the ring network structure with poor applicability of the traditional forward-backward substitution method.
Disclosure of Invention
Aiming at the problems, the invention provides a forward-backward substitution algorithm of an electricity-gas integrated energy system based on a compensation airflow method, which takes the problems that the load flow calculation of the integrated energy system is complex and the algorithm is not uniform into consideration. According to the core position of the power system in the comprehensive energy system, the method applies the forward-backward substitution algorithm commonly adopted by the power distribution network to the load flow calculation of the electricity-gas comprehensive energy system, and simultaneously introduces the compensating airflow method to process the ring network structure in the natural gas network, thereby realizing the unified solution of the forward-backward substitution algorithm of the electricity comprehensive energy system.
In order to achieve the purpose, the invention adopts the technical scheme that:
an electric-gas comprehensive energy system forward-pushing back-substitution algorithm based on a compensation airflow method comprises the following steps:
step 1: learning a forward-backward substitution algorithm of the power distribution network; the influence factor matrix method is adopted to improve the traditional forward-backward substitution algorithm, and further the algorithm can process a large number of PV nodes in the distribution network.
Step 2: building a pipeline model of a natural gas system; based on the improved forward-backward substitution algorithm in the step 1, the forward-backward substitution algorithm commonly used for the power system is applied to the load flow calculation of the natural gas system by using the gas-electricity comparison idea.
And step 3: the ring of the ring network part in the natural gas system is separated; and solving by adopting a compensation airflow method to realize the forward-backward substitution method load flow calculation of the natural gas system with the ring.
And 4, step 4: solving and calculating the coupling part between the electric comprehensive energy systems; the comprehensive steps 1-3 realize the forward-pushing back-substitution algorithm of the electricity-gas comprehensive energy system based on the compensation airflow method;
further, the step 1 specifically includes the following steps:
step 101: the power system advances back to the generation algorithm. The forward-backward substitution method is divided into two parts of power forward-forward substitution and voltage backward substitution. And starting power forward from the last node, calculating the power of the branch of the previous node at the sending end by the injection power of the receiving end node and the branch impedance data for each branch, and stopping power forward until the calculation of the power of the first node is finished. The power variation is as follows:
p, Q are the injected active and reactive power of the node respectively; u is the node voltage; r + jX is the branch impedance.
And calculating the node voltage of the receiving end node by the node voltage of the sending end node and the branch power for each branch from the first node, and stopping voltage back-generation until the calculation of all the tail end node voltages is completed. The real part and imaginary part of the voltage variation are as follows:
step 102: the impact factor matrix method. The traditional push-forward substitution method cannot well deal with the problem of multiple PV nodes in modern power systems. The impact factor matrix method is often used for processing. In brief, in the process of load flow calculation, a PV node can be treated as a common PQ node, after calculation convergence, the difference between a given value of a PV node voltage amplitude and a calculated value is used as a voltage unbalance amount, and then the reactive power compensation amount of the PV node is calculated by combining an influence factor matrix to correct the node voltage. Namely:
ΔU=IΔQ (3)
wherein, the delta U is a PV node voltage unbalance vector; delta Q is a PV node reactive compensation vector; and I represents an influence factor matrix, and the order of the influence factor matrix is the number of PV nodes in the network.
Step 103: and performing power flow analysis on the power distribution network model by adopting an improved forward-backward substitution method, judging whether all voltages meet a convergence judgment condition, and if not, correcting the injected reactive power. The convergence determination conditions of the PV nodes are:
in the formula
The node voltage at the ith PV node obtained by the calculation is obtained; u shape
schiA given node voltage magnitude at the ith PV node; epsilon
pvIs the convergence accuracy.
When iteration is carried out until each node meets the precision requirement, the calculation is finished; otherwise, the iteration is continued until convergence.
The step 1 realizes the improvement of the traditional forward-backward substitution algorithm, so that the method is more suitable for load flow calculation of the actual power distribution network.
Further, the model building and power flow calculation method of the natural gas system is as described in step 2. The method specifically comprises the following steps:
step 201: and modeling a natural gas system. Natural gas pipeline models are often described by natural gas steady-state flow equations. Natural gas steady state gas flow can be expressed in terms of a one-dimensional compressible flow equation that describes the relationship between pressure, temperature, and flow through a pipeline. It should be noted that, considering that the actual operating pressure of the urban gas distribution network is high, the Weymouth formula applicable to the high-pressure pipe network is selected for description:
the parameter analysis of the above formula is shown in table 1.
TABLE 1 list of formula parameters
Transforming equation (5) to concentrate the natural gas pipeline intrinsic parameters as pipeline constants, equation (5) can be written as:
wherein p isiAnd pjAir pressure at nodes i and j; f. ofijIs the amount of airflow between nodes i and j; k is the constant of the pipeline, and the variables describing the constant are related to the diameter, the length and the like of the pipeline and are also given in the table 1. It can also be seen from equation (6) that, unlike power systems, natural gas systems are nonlinear systems.
Step 202: a forward-backward substitution algorithm of the natural gas system is given by adopting a comparative idea. Power system nodes are typically divided into balanced nodes of known voltage magnitude and phase angle, PQ nodes of known active and reactive power, and PV nodes of known active and voltage magnitude. The natural gas system nodes are therefore divided according to the known quantities as follows, as shown in table 2.
TABLE 2 analogy for power and gas system node classes
Step 203: combining the comparison between the natural gas system and the electric power system in step 202 and the electric power system forward-backward substitution algorithm in step 1, applying the forward-backward substitution method to the load flow calculation of the natural gas system by using the pipeline gas flow to simulate current, the node gas pressure to simulate voltage and the node gas load to simulate node power, wherein the forward-forward process is a gas flow convergence and superposition process, and the backward substitution process is calculated in formula (6).
And step 2, applying a forward-backward substitution algorithm suitable for power system load flow calculation to the natural gas system through a gas-electricity comparison idea, so as to realize load flow calculation of the natural gas system. The advantages of simple programming, high calculation precision and the like of the original algorithm are also reserved.
Further, the processing for the ring network structure of the natural gas system is as described in step 3, specifically as follows:
step 301: and (5) ring opening of the natural gas ring network. The ring network structure in the natural gas network is unlooped at nodes far away from the balance node so that the topology structure becomes a pure radiation mesh. The number of network branches is unchanged after the ring is disconnected, the number of the nodes is increased to be the number of the disconnected ring networks, and new nodes after the ring is disconnected are numbered again, so that the pure radial natural gas network after the ring is disconnected is obtained. The radial structure can be well solved by adopting the natural gas system forward-backward substitution algorithm given in the step 2, and the difference correction method of the solution result at the solution loop point is given in the step 302.
Step 302: and solving the natural gas network by a compensation gas flow method. For the radial natural gas network after ring-opening, the pressure of each node can be calculated by formula (6), and the pressure squared difference between the original node and the new node at the ring-opening position mentioned in step 301 can be described by the following formula:
ΔΠ=AI2+BI+C (7)
wherein Δ Π is the squared difference of the pressures at the solution ring nodes; i is the gas flow compensation between the ring-opening nodes; A. b, C are all constants, the magnitude of which is related to the pipe coefficient and the amount of load at the node. The specific calculation formula will be given in the detailed description.
As the quadratic term coefficient A is very small, neglecting the quadratic term coefficient to obtain a linear relation formula between the open loop point air pressure square difference and the compensating air flow. Since the actual air pressure is the same at the open loop point, the corresponding amount of airflow to compensate this air pressure difference to 0 is the amount of airflow in the actual operating circuit. One of the fitted curves from the following examples was selected here as shown in fig. 4. It can be seen that the fitting precision is very high after the quadratic term is ignored, so the algorithm has good convergence. For a natural gas system comprising a plurality of looped networks, the compensation airflow can influence the air pressure of each loop-breaking point. Given n ring-out nodes in the network, n can be made2The slope of each line is taken as an element of the correction matrix X, so that the correction matrix of the natural gas system compensated gas flow method under the multi-ring condition can be obtained.
Equation (8) can be written in simplified form:
ΔΠ=XΔI (9)
wherein: Δ Π is the squared difference of the air pressure at the solution ring; delta I is an airflow compensation quantity vector; x represents a correction matrix, and the order of the correction matrix is the number of rings in the network.
And 3, introducing a compensation airflow method, solving the problem of applicability of a forward-backward substitution method in the load flow calculation of the natural gas system with the ring, and obtaining a complete load flow calculation method of the natural gas system.
Further, for the electric-gas integrated energy system, the coupling part between systems and the overall calculation are as described in step 4, specifically as follows:
step 401: and modeling and solving the coupling part between the systems. Cogeneration units are one of the most common coupling elements in an electricity-heat-gas integrated energy system. Generally, the chemical energy of natural gas is converted into electrical energy and thermal energy by a gas turbine. The micro gas turbine is used for realizing the coupling of the electricity-gas integrated energy system.
The operating characteristics of a gas turbine plant are described by the following formula:
wherein L is the natural gas flow (m)3Q is natural gas heat value (KJ/m)3) And η is the conversion efficiency.
Step 402: the electric-gas comprehensive energy system is pushed forward to replace a power flow calculation method. Firstly, calculating the load flow of the urban power distribution network by adopting the method in the step 1, then converting the electric power required by the balance node of the power system into the consumed natural gas flow through a coupling element, finally determining the load of the natural gas load node, adopting the algorithm in the step 3, carrying out ring-opening on the natural gas network, and solving through a compensation gas flow method, thereby realizing the solution of the forward-backward substitution method of the electricity-gas integrated energy system based on the compensation gas flow method.
The invention has the beneficial effects that: the invention provides a forward-backward substitution algorithm of an electricity-gas comprehensive energy system based on a compensation airflow method. The method realizes the whole trend analysis of the electricity-gas comprehensive energy system, has the advantages of good convergence, high operation speed, low requirement on initial values and the like, and also provides a processing method with good convergence for the problem of the non-linear natural gas system containing rings. The method has important significance for analysis and calculation of the comprehensive energy system.
Drawings
FIG. 1 is a schematic illustration of a 5-node dual ring natural gas system;
FIG. 2 is a schematic diagram of a 7-node radial natural gas system;
FIG. 3 is a schematic diagram of a simple ring-containing gas network;
FIG. 4 is a schematic view of a curve fitted to the compensated air flow and air pressure;
FIG. 5 is a schematic diagram of an electric-gas integrated energy system.
Detailed Description
The invention is further described below in connection with specific embodiments.
The comprehensive energy system model is complex and inconvenient to analyze, and the electric power system is in a core position in the comprehensive energy system, and a related calculation and analysis method of the electric power system is very mature. Therefore, the trend calculation of the electricity-gas integrated energy system is analyzed by adopting a common forward-backward substitution method of the power distribution network in a gas-electricity analogy mode. Meanwhile, for the problem that the nonlinear gas network contains rings, a compensation gas flow method is introduced for processing. Finally, a forward-backward substitution calculation method of the electricity-gas comprehensive energy system based on the compensation airflow method is provided. The method has the advantages of good convergence, high operation speed, low requirement on initial values and the like. The method has important significance for analysis and calculation of the comprehensive energy system.
Step 1: learning a forward-backward substitution algorithm of the power distribution network; the influence factor matrix method is adopted to improve the traditional forward-backward substitution algorithm to realize the processing of a large number of PV nodes in the distribution network by the algorithm.
Step 2: building a pipeline model of a natural gas system; based on the algorithm of the step 1, a gas-electricity analogy idea is applied, and a forward-backward substitution algorithm commonly used for a power system is applied to load flow calculation of a natural gas system.
And step 3: the ring of the ring network part in the natural gas system is separated; and solving by adopting a compensation airflow method to realize the forward-backward substitution method load flow calculation of the natural gas system with the ring.
And 4, step 4: solving and calculating the coupling part between the electric comprehensive energy systems; the comprehensive steps 1-3 realize the forward-pushing back-substitution algorithm of the electricity-gas comprehensive energy system based on the compensation airflow method;
further, the step 1 specifically includes the following steps:
step 101: the power system advances back to the generation algorithm. The forward-backward substitution method is divided into two parts of power forward-forward substitution and voltage backward substitution. And starting power forward from the last node, calculating the power of the branch of the previous node at the sending end by the injection power of the receiving end node and the branch impedance data for each branch, and stopping power forward until the calculation of the power of the first node is finished. The power variation is as follows:
p, Q are the injected active and reactive power of the node respectively; u is the node voltage; r + jX is the branch impedance.
And calculating the node voltage of the receiving end node by the node voltage of the sending end node and the branch power for each branch from the first node, and stopping voltage back-generation until the calculation of all the tail end node voltages is completed. The real part and imaginary part of the voltage variation are as follows:
step 102: the impact factor matrix method. The traditional push-forward substitution method cannot well deal with the problem of multiple PV nodes in modern power systems. The impact factor matrix method is often used for processing. In brief, in the process of load flow calculation, a PV node can be treated as a common PQ node, after calculation convergence, the difference between a given value of a PV node voltage amplitude and a calculated value is used as a voltage unbalance amount, and then the reactive power compensation amount of the PV node is calculated by combining an influence factor matrix to correct the node voltage. Namely:
ΔU=IΔQ (3)
wherein, the delta U is a PV node voltage unbalance vector; delta Q is a PV node reactive compensation vector; and I represents an influence factor matrix, and the order of the influence factor matrix is the number of PV nodes in the network.
Step 103: and performing power flow analysis on the power distribution network model by adopting an improved forward-backward substitution method, judging whether all voltages meet a convergence judgment condition, and if not, correcting the injected reactive power. The convergence determination conditions of the PV nodes are:
in the formula
The node voltage at the ith PV node obtained by the calculation is obtained; u shape
schiA given node voltage magnitude at the ith PV node; epsilon
pvIs the convergence accuracy.
When iteration is carried out until each node meets the precision requirement, the calculation is finished; otherwise, the iteration is continued until convergence.
The step 1 realizes the improvement of the traditional forward-backward substitution algorithm, so that the method is more suitable for load flow calculation of the actual power distribution network. Further, the model building and power flow calculation method of the natural gas system is as described in step 2. The method specifically comprises the following steps:
step 201: and modeling a natural gas system. Natural gas pipeline models are often described by natural gas steady-state flow equations. Natural gas steady state gas flow can be expressed in terms of a one-dimensional compressible flow equation that describes the relationship between pressure, temperature, and flow through a pipeline. It should be noted that, considering that the actual operating pressure of the urban gas distribution network is high, the Weymouth formula applicable to the high-pressure pipe network is selected for description:
the parameter analysis of the above formula is shown in table 1.
Transforming equation (5) to concentrate the natural gas pipeline intrinsic parameters as pipeline constants, equation (5) can be written as:
wherein p isiAnd pjAir pressure at nodes i and j; f. ofijIs the amount of airflow between nodes i and j; k is the pipe constant, andthe variables relating to pipe diameter, length, etc. are also given in table 1. It can also be seen from equation (6) that, unlike power systems, natural gas systems are nonlinear systems.
Step 202: a forward-backward substitution algorithm of the natural gas system is given by adopting a comparative idea. Power system nodes are typically divided into balanced nodes of known voltage magnitude and phase angle, PQ nodes of known active and reactive power, and PV nodes of known active and voltage magnitude. The natural gas system nodes are therefore divided according to the known quantities as follows, as shown in table 2.
Step 203: combining the comparison between the natural gas system and the electric power system in step 202 and the electric power system forward-backward substitution algorithm in step 1, applying the forward-backward substitution method to the load flow calculation of the natural gas system by using the pipeline gas flow to simulate current, the node gas pressure to simulate voltage and the node gas load to simulate node power, wherein the forward-forward process is a gas flow convergence and superposition process, and the backward substitution process is calculated in formula (6).
And step 2, applying a forward-backward substitution algorithm suitable for power system load flow calculation to the natural gas system through a gas-electricity comparison idea, so as to realize load flow calculation of the natural gas system. The advantages of simple programming, high calculation precision and the like of the original algorithm are also reserved. Further, the processing for the ring network structure of the natural gas system is as described in step 3, specifically as follows:
step 301: and (5) ring opening of the natural gas ring network. A natural gas network, such as the ring network of fig. 1, is looped at a node such that its topology becomes a purely radiative mesh. As shown in fig. 2, is a new system structure after the ring is released. Since the ring is broken at the nodes 3 and 4, more new nodes are set as the nodes 6 and 7 after the ring is broken. The radial structure after the ring is solved by adopting the natural gas system forward-backward substitution algorithm given in the step 2, and the difference correction method of the solving result at the ring-opening point is given in the step 302.
Step 302: and solving the natural gas network by a compensation gas flow method. The modification method is given by taking a simple ring-containing gas network as an example, as shown in fig. 3. This is a simple 3-node ring network and is broken into nodes 3 and 3' at node 3. The air pressure square difference between each adjacent node can be calculated by combining the formula (6), and further the air pressure square difference at the ring-opening node can be obtained, namely:
wherein I is the gas flow compensation between the ring-opening nodes; i is2,I3Injecting a flow of gas into the node; k12,K23,K13Is the corresponding pipe constant.
As the quadratic term coefficient A is very small, neglecting the quadratic term coefficient to obtain a linear relation formula between the open loop point air pressure square difference and the compensating air flow. Since the actual air pressure is the same at the open loop point, the corresponding amount of airflow to compensate this air pressure difference to 0 is the amount of airflow in the actual operating circuit. One of the fitted curves from the following examples was selected here as shown in fig. 4. It can be seen that the fitting precision is very high after the quadratic term is ignored, so the algorithm has good convergence. For a natural gas system comprising a plurality of looped networks, the compensation airflow can influence the air pressure of each loop-breaking point. Given n ring-out nodes in the network, n can be made2The slope of each line is taken as an element of the correction matrix X, so that the correction matrix of the natural gas system compensated gas flow method under the multi-ring condition can be obtained.
Equation (8) can be written in simplified form:
ΔΠ=XΔI (9)
wherein: Δ Π is the squared difference of the air pressure at the solution ring; delta I is an airflow compensation quantity vector; x represents a correction matrix, and the order of the correction matrix is the number of rings in the network.
And 3, introducing a compensation airflow method, solving the problem of applicability of a forward-backward substitution method in the load flow calculation of the natural gas system with the ring, and obtaining a complete load flow calculation method of the natural gas system. For the electricity-gas integrated energy system, the coupling part and the overall calculation between the systems are as described in step 4, which specifically includes the following steps:
step 401: and modeling and solving the coupling part between the systems. Cogeneration units are one of the most common coupling elements in an electricity-heat-gas integrated energy system. Generally, the chemical energy of natural gas is converted into electrical energy and thermal energy by a gas turbine. The micro gas turbine is used for realizing the coupling of the electricity-gas integrated energy system.
The operating characteristics of a gas turbine plant are described by the following formula:
wherein L is the natural gas flow (m)3Q is natural gas heat value (KJ/m)3) And η is the conversion efficiency.
Step 402: the electric-gas comprehensive energy system is pushed forward to replace a power flow calculation method. Firstly, calculating the load flow of the urban power distribution network by adopting the method in the step 1, then converting the electric power required by the PV node of the electric power system into the consumed natural gas flow through a coupling element, finally determining the load of the natural gas load node, adopting the algorithm in the step 3, carrying out ring-opening on the natural gas network, and solving through a compensation gas flow method, thereby realizing the solution of the forward-backward substitution method of the electricity-gas integrated energy system based on the compensation gas flow method.
First, the natural gas system shown in fig. 1 is taken as an example to verify the correctness of the compensated gas flow method. In the embodiment, the air pressure of a balance node, namely the node 1, is 60 Bar; an average compressibility factor of 0.95; the temperature of the natural gas is 288K; the specific gravity of the natural gas is 0.589; taking 1.175 as the polytropic exponent; the heat value of the natural gas is 39MJ/m3. Data on the length and diameter of the pipe are not given here. The topology of the network after the ring is broken is shown in fig. 2. The calculation results are shown in table 3 using the linearized correction matrix compensation method and the gradient descent method, respectively. The iteration precision is selected to be 0.05 (the magnitude order of the pressure square initial value is 10)3)。
TABLE 3 comparison of gas network energy flow calculation results
Comparing the results of the two algorithms in table 3, the maximum error of the air pressure is 0.000336%, and the maximum error of the air flow is 0.0015%. The applicability of the algorithm was verified. Meanwhile, when the calculation precision of the algorithm is similar to that of a gradient descent method, the algorithm can be converged only by iterating for 6 times, and meanwhile, the algorithm also has many advantages of load flow calculation of a forward-backward substitution method.
Taking the schematic diagram of the electric-gas integrated energy system shown in fig. 5 as an example, the electric power subsystem and the natural gas subsystem are coupled through the CHP, and EBi and GBi represent the electric power node and the natural gas node, respectively. Here, the power system works in a grid-connected mode, the node 1 is connected with a large power grid to serve as a balance node, the nodes 12 and 13 are PV nodes, and the conversion efficiency of the gas turbine set is 0.57. The calculation results are shown in tables 4 and 5.
TABLE 4 distribution network node voltage data comparison
TABLE 5 Natural gas System energy flow calculation results
The above-mentioned embodiments only express the embodiments of the present invention, but not should be understood as the limitation of the scope of the invention patent, it should be noted that, for those skilled in the art, many variations and modifications can be made without departing from the concept of the present invention, and these all fall into the protection scope of the present invention.