Security-Constrained Optimal Dispatch of Combined 2 Natural Gas and Electricity Networks Using Genetic 3 Algorithms 4

This paper proposes a method based on genetic algorithm (GA) for the security-constrained 11 optimal dispatch of integrated natural gas and electricity networks, considering operating scenarios 12 in both energy systems. The mathematical formulation of the optimization problem consists of a 13 multi-objective function which aims to minimize both cost of thermal generation (diesel and natural 14 gas) as well as the production and transportation of natural gas. The joint gas-electricity system is 15 modeled by two separate groups of nonlinear equation, which are solved by the combination of 16 Newton's method with the GA. The applicability of the proposed method is tested in the Belgian gas 17 network integrated with the IEEE 14-bus test system and a 15-node natural gas network integrated 18 with the IEEE 118-bus test system. The results demonstrate that the proposed method provides 19 efficient and secure solutions for different operating scenarios in both energy systems. 20 21


Introduction
In 2012, the thermoelectric power sector in Brazil generated 73.456 GWh; whereas the share of natural gas increased by 50% [1].This data provides evidence of the increasing importance of natural gas in the thermal power generation of Brazil, mainly resulting from the high efficiency, low-cost investment, operational flexibility and less environmental impact when compared to diesel [2].This significant increase in the installation of thermoelectric power plants using natural gas associated with increased electricity demand, prompted this type of power generation to assure a greater participation in electric power supply.
On the other hand, this fact creates a strong interdependence between the electrical system and the gas pipeline system, the latter being responsible for the transportation of natural gas from the production well to the consumption point.Traditionally, this interdependence is disregarded in studies of optimal planning of the operation of thermoelectric power plants using natural gas.
However, this simplification may affect the safe operation and performance of the joint systems, as pressure losses, contingencies in gas pipelines, lack of storage or interruptions in the supply of natural gas may bring about a cut off of the generating units.In the occurrence of shutdowns of gas pipelines or power transmission lines, inconsistent procedures for cutting off the supply of natural gas to thermal electric generators may restrict the operation of the electrical system or even result in additional shutdowns [3].The active power adjustment in an arbitrary number of generators may affect the flows in the gas network, which shows the interdependence between both networks [4].
Therefore, this strong dependence operation between these two systems requires a coordinated operation to obtain reduced operating costs and congestion without jeopardize the security of power systems.
Various models have been proposed to ensure optimal combined operation of natural gas and electrical networks by means of an unified formulation.In [3], the authors performed an assessment of interdependence between both networks in terms of the impact of market prices of natural gas in the dispatch of the generating units.In [5], the authors presented an multiperiod generalized network flow model focusing on the economic interdependence of the combined system (electric grid, coal and natural gas).In [6], a model was presented to calculate the maximum amount of energy that should be provided to a natural gas combined cycle power plant.In [7], an integrated model of optimal dispatch was proposed to evaluate the impact of the interdependence of electricity and natural gas networks in the operational safety of the electric system.Other studies have proposed methods of optimal dispatch of joint natural gas and electric networks [8]- [12].All these cited works used conventional optimization methods as a solution to the problem of joint gas-electricity optimal dispatch.
The electricity-gas optimal dispatch is a mixed integer, nonlinear, non-convex problem with a very complex solution.Conventional methods of nonlinear programming may not be able to provide an optimal solution taking into account that generally the solution is trapped in on local minima.As an alternative to conventional optimization methods, an evolutionary computation has been used to solve a variety of problems due to its ability to find the global optimum.However, few studies have employed evolutionary computation to solve the problem of joint electricity-gas optimal dispatch.In [13], an optimization methodology based on genetic algorithms (GA) is proposed to determine the pipeline diameter to minimize the cost of the gas network.Nonetheless, the authors did not take into account the model of the electrical grid.A hybrid model is proposed in [14], combining an evolutionary algorithm with Newton's methods and the interior points to plan for the optimal operation of the natural gas and electric systems.However, the work does not take into account the cost of transportation of natural gas in the objective function, which may reduce the overall efficiency of the system considering that the pipeline system must meet the demands for natural gas with the lowest production and transportation costs [15]- [16].Besides, the authors of [14] did not evaluate the operating interdependence of the gas-electric system from different operational scenarios in both energy systems.
In this context, this paper proposes a method based on GA for security-constrained optimal dispatch of integrated natural gas and electricity networks, in order to minimize the costs associated with thermoelectric generation (natural gas and diesel), natural gas production and transportation.
The nonlinear algebraic equations representing both systems are solved separately by Newton's method combined with GA in order to assess the optimal dispatch of the global energy matrix under a pre-specified operating condition.The proposed method is described in detail hereinbelow in accordance with the following sections.Section II shows the formulation of the natural gas flow system considering the pipeline and the production nodes and gas consumption.section III describes the integrated electricity-gas optimal dispatch using the GA.The application of the proposed method in two coupled energy systems is presented in section IV.Finally, section V presents the conclusions of the work.

Natural Gas System Formulation
In order to determine the gas flow model in pipelines, it may be admitted as a reference an element of a pipeline of infinitesimal length dx (m) and transversal section A (m 2 ) and consider w (m/s) and a (m/s 2) ), respectively, the velocity and acceleration of the gas inside this element, W (Kg.m/s 2 ) weight of the gas particles, and p (bar) the external pressure as shown in Figure 1, according to [17].Bernoulli's Equation is written as: In steady state, the gas flow is constant, therefore: Figure 2 represents a gas flow in an infinitesimal portion of the pipeline, where: .= . (3) The term dhf represents the losses in the form of heat due to friction of the gas against the pipeline wall and can be quantified by Darcy's equation.
Where f is the friction factor (dimensionless) and D is the inner diameter of the pipeline (m).By replacing (5) in ( 4), one has: Considering equation (3) and the proportionality of density variations, pressure and gas velocity in the pipes, equation ( 7) is obtained according to [17].
The gas density is given by the inverse of the specific volume according to equation ( 8).
From equations ( 2) and ( 3), equation ( 11) can be written as: Where the subscript n indicates the values for the standard pressure and temperature conditions, which are ≅ 0.1 and ≅ 288 .
By replacing equation (11) in equation ( 10), equation ( 12) is obtained as: According to [17], = can be considered, and = for gas, where as = ( ) is for air.By dividing the two expressions for ( ) , equation ( 13) can be written as: With being the specific gravity of gas, equation ( 14) is obtained: By replacing equations ( 13) and ( 14) in equation ( 12), equation ( 15) can be written as: By integrating equation (15) in the following intervals: = 0; , = ; and = ℎ, equation ( 16) is obtained: By isolating , equation ( 17) can be written, which is the equation of gas flow according to [17].
Figure 3 shows the nodes and arcs [16] in a simplified manner.In Figure 3, is the gas production associated with that node, for example, is the natural gas production at node g., ( ) is the flow from one node to another; this means that is the gas flow from node g to node k.Still referring to Figure 3, are the demands for gas in each node.
The supply node, which can be a gas well, a reservoir or regasification terminal of LNG (Liquefied Natural Gas), may have contractual supply requirements.Depending on the flexibility of the contract, the supply of natural gas may have a pre-specified range of values, a minimum (Pdmin) and maximum (Pdmax) production.Mathematically: For the nodes on-demand, the consumption value must always meet the demand .
In pumping gas in pipelines, there is a maximum value in the operating pressure, which refers to safe pressure levels for the operation and at delivery points to consumers.Moreover, for each node in the system, the gas demand should be met at a certain minimum pressure guaranteed to industries, local distribution companies and thermoelectric power plants.Mathematically: In addition to restrictions of operating limits, there is the flow conservation equation at node i, shown below, ensuring gas balance (Figure 3).In pipelines, there is a relationship between the gas flow transmitted and the pressure difference between end nodes.
Mathematically, the flow conservation can be expressed as: The gas flow through each passive pipeline ( ) is a quadratic function of the pressures at the end nodes: The gas flow through an active pipeline is also a quadratic function of the pressures at the end nodes.
In this case, the pressure at the incoming node i (or j) is lower than the pressure at the outcoming node j (or i) (pi < pj) and the gas flows from node i (or j) to node j (or i ) (fij > 0 (or fij > 0) ).Mathematically, = 96,074830.10 Where Ap is the set of passive pipelines and Aa is the set of active pipelines and Cij is a constant that depends on the length, diameter and absolute roughness of the pipeline and the gas composition as shown in ( 23) and ( 24)

Combined Natural Gas and Electric Optimal Power Flow Formulation
The integrated gas-electricity formulation is obtained by the coupled model of power flow and natural gas flow, considering that the link between both systems is the thermal gas-fired generators which are connected to gas pipelines network.
The joint gas-electricity system is modeled by two separate groups of nonlinear equations, which are solved by the combination of Newton's method with the GA.Firstly, the optimal power flow is solved.Next, the gas flow is solved using the values of state variables provided by optimal power flow, in order to assess the steady-state of the overall network.
The attractiveness of using Newton's method is the solution with a local quadratic convergence, irrespectively of the dimension of the electric power grid, provided that all the state variables involved in the study are properly initialized.On the other hand, the solution provided by Newton's method can be trapped on local minima.
In the power flow solution, the voltage magnitudes are initialized 1.0 p.u. for all uncontrolled voltage bus.Meanwhile the voltage magnitudes and the active power at buses of thermal power generation (diesel and natural gas) are initialized by GA at specified values that remain constant throughout the iterative solution provided by the Newton-Raphson method.The active power of the slack generator is not initialized by GA, considering that this slack bus is responsible for supplying the entire imbalance of active power in the system, even when a sufficient spinning reserve exists on other generators.
The strategy adopted for the gas flow solution is similar to that of the load flow.The initial nodal pressures at the pipelines are measured in Baria.The initial values of pressures and gas flow in producing nodes are provided by GA, remaining constant throughout the iterative solution process provided by Newton's method.As for the power flow solution, the gas to be produced by the swing node is not initialized by GA.It is repeated while the maximum generation's number hasn't been reached.Therefore, the proposed approach fully takes the advantages of both evolutionary strategy optimization and classical method in the attempt to jump out from the local optimal point.It increases the precision and quickens the convergence.The flowchart of this approach is depicted in Figure 4.
The scope of this article is to propose a method of joint electricity-gas optimal dispatch, under security constraints that aims to minimize the total operating cost of the gas-electricity system.
(25) Subject to: The variables are described in the Appendix.

Case Studies
The proposed method for optimal dispatch of the power grid combined with the natural gas network is tested in two systems, namely: • Case 1: The Belgian natural gas network integrated to the IEEE 14-bus electric grid; • Case 2: 15-node natural gas network integrated to the IEEE 118-bus electrical grid.

a) Case 1
The proposed method is applied to determine the optimal gas-electricity operation made up by the Belgian natural gas network [16], shown in Fig. 5, and the IEEE 14-bus electric grid [18], illustrated in Fig. 6.The 20-node Belgian natural gas network consists of eight nodes for gas consumption for non-electrical purposes, seven nodes for gas production and 24 pipelines [16].The node referred to as Zeebugge is considered the slack node.On the other hand, the electric grid is assumed to consist of two natural gas generators connected to bus bars 2 and 3, which are supplied by nodes 4 (Zomergen) and 12 (Namur) of the natural gas network, respectively.For analysis purposes, the optimal gas-electricity solution was obtained assuming the following operating conditions in both systems: (a) base case; (b) shutdown of the pipeline between nodes 4 and 14; (c) 20% increase in the total gas demand for non-electric purposes; and (d) 20% increase in the total load of the electrical grid.Table 1 shows the correspondence between the nodes of the Belgian natural gas network and the cities to the Figure 5.

Table 1. Nodes and Cities-Belgian Natural Gas Network
Table 2 shows the coefficients for the costs of thermal power generation using natural gas (connected to bus bars 2 and 3) and diesel (connected to the buses 1 and 4) of the 14-bus electric grid.
Figures 7, 8 and 9 show the results of the joint electricity-gas optimal dispatch with power provided by natural gas and diesel-fired generators, the natural gas flows and nodal pressures of the gas network, respectively.Table 3 presents the total costs of the integrated electricity-gas optimal dispatch with the cost of thermoelectric power generation (gas and diesel) and the production and transportation costs of natural gas.The results presented are related to the operating conditions: (a), (b), (c) and (d).
All generators have regulated their active powers to meet the economic criteria, according to the operation scenario without compromising the security of the gas-electricity system.The voltages in the buses of the electric system, the thermal capacity of lines and transformers and reactive capacity of the generators were not violated.Figure 7 shows that natural gas-fired generators injected a greater amount of active power compared to diesel generators for the base case (a), showing the efficiency of the method to minimize the cost of thermal power generation (natural gas and diesel).For cases (b) and (c), which correspond to different scenarios of the gas network in relation to the base case, figure 7 illustrates that natural gas-fired generators also injected more active power when compared to diesel-fired generators.
The model adopted first solves the optimal power flow through Newton´s method combined with GA, and subsequently solves for the gas flow also by Newton's method combined with GA.In other words, in case there are no changes in the scenarios in the electric grid, the results to be obtained for the optimal dispatch of thermal units tend to be very close.These similar results take into account that the GA has associated structures to the probability.For this reason, the generation levels obtained for cases (b) and (c) are close to those in case (a).On the other hand, cases (b) and (c) could have been critical considering that both the shutdown of a pipeline and the increase of gas consumption for nonelectrical purposes could have restricted the supply of natural gas to generating units.However, the solution of the gas flow converged to cases (b) and (c), ensuring the supply of natural gas to nodes 4 and 14, which in turn correspond to the nodes that supply the gas-fired generators.It is important to note that producing nodes store gas for supply in scenarios of increased natural gas demand.For case (d) both the diesel and gas-fired generators contribute with the increase in electric demand.
Figures 8 and 9 illustrate the flow in the pipeline network and the pressures at each node of the network, respectively.It is possible to notice in case (b) an interruption of the gas flow in the branch between nodes 4 and 14.Such contingency causes a reduction in gas production illustrated in Fig. 10 in nodes 1, 2 and 5, reducing the flow in the pipelines located in the upper part of the gas system.
Since node 14 does not receive gas from node 4, gas production in nodes 8, 13 and 14 increases to maintain the systems supplied.Case (c) reflects an increase in the demand for gas for non-electrical purposes.This condition causes an increase in gas supply and an increased gas flow transported in pipelines and the pressures of the nodes, as can be observed in Figures 8 and 9.For the scenario applied in case (d), which refers to an increased electrical power demand, it can be observed in Figs. 8 and 9 that the branches responsible for supplying nodes 4 and 12 (nodes that supply the thermal gas-fired generators) undergo an increase in gas flow without a significant pressure variation in the nodes.In the lower portion of the gas system an inverse process occurs.Without the amount of gas transported from node 4 to 14, the producers nodes located in the cities of Voeren (node 8), Anderlues (node 13) and Perrones (node 14) increase their level of gas production (Figure 10), causing an increase in the gas flow in that part of the pipeline network (Figure 8).Thus, the Genetic Algorithm (AG) evaluate the levels of security of electric and gas system and optimizes the solution to new values of the costs, as shown in case (b) of the Table 3 below.
This scenario demonstrates the importance of the security-constrained studies related with integration of gas network and electric systems.At the same time it´s possible to guarantee the process of cost optimization (minimization of costs) based on GA as described previously.
Table 3 depicts the operating costs for each scenario.It is observed that the costs are subject to individual variations due to the contingency brought about in the respective simulation.The largest identified cost refers to the increase in electricity demand, represented by scenario (d).its optimal value.The 2nd situation is related to disruption in the gas flow in a branch of 55 miles long.

b) Case 2
The proposed method is also applied to obtain the optimal dispatch of the electricity-gas system made up of the 15-node natural gas network [8], shown in Figure 11, and the IEEE 118-bus electric grid [18], shown in Figure 12.The 15-node natural gas network consists of five nodes for the consumption of gas for non-electrical purposes, and two nodes for gas production, and 16 gas pipelines.Node 1, is considered the slack node.Table 4 shows the operational characteristics of these networks.
On the other hand, the 118-bus electric grid is assumed to be made up of 118 buses for nineteen generators, out of which 8 gas-fired generators and 11 diesel-fired generators.For analysis purposes, the optimal gas-electricity solution was obtained assuming the operating conditions in both networks: (a) base case; (b) shutdown of two gas pipelines between nodes 3 and 4 and another between nodes 13 and 14; (c) 20% increase in the total gas demand for non-electric purposes; and (d) a 20% increase in the total power of the electric grid.show the results of integrated gas-electricity optimal dispatch with the powers provided by natural gas and diesel generators, the natural gas flows, and the nodal pressures of the gas network, respectively.Table 5 presents the total costs of integrated gas-electricity optimal dispatch with the cost of thermoelectric power generation (gas and diesel) and the costs for the production and transportation of natural gas.The results presented are related to the operating conditions: (a), (b), (c) and (d).
As can be observed in Figure 13, all generators regulate their active powers to meet the economic criteria according to the operation scenario without compromising the security of the gas-electricity system.Figure 13 shows that natural gas-fired generators connected to buses 10 and 89, respectively, injected a greater amount of active power compared to the other generators in the system to the base case (a), showing the efficiency of the method to minimize the cost of thermoelectric power generation (gas and diesel).It's noted that contingency in the pipelines between the nodes 34 and 1314, represented by the case (b), causes an increase in the cost of gas production and a reduction in cost of transportation.
Again the 1st situation is explained by the need of the node 2 produce a quantity of gas higher than its optimal value.The 2nd situation is related to disruption in the gas flow in the branches cited above, as shown in Figure 14.As expected, case c) returns an increase in gas flow transported in pipelines, the pressures of the nodes and in gas production, as can be observed in Figures 14, 15 and 16 respectively.
Table 5 shows the operating costs for the scenarios presented herein.It is verified that the costs are subject to individual variations due to the contingency brought about in the respective simulation.
Similar to case 1, the largest identified cost refers to the increase in electricity demand, represented by scenario (d), because this scenario reflects an increase in the generation of electricity in diesel-fired power plants.

Figure 1 .
Figure 1.Parameters of the gas flow in pipelines.

Figure 2 .
Figure 2. Gas flow in an infinitesimal portion of the pipeline.

Figure 4 .
Figure 4. Flowchart of the proposed method

Table 2 .
Operational Characteristics of Gas-and Diesel-Fired Generators

Table 3 .
Optimal Dispatch CostsIt's verified that contingency in the pipeline between 4 and 14, represented by the case (b) causes an increase in the cost of gas production and a reduction in cost of transportation.The 1st situation is explained by the need of the node 8 from the gas network to produce a portion of gas higher than

Table 4 .
Operational Characteristics of Gas and Diesel-Fired Generators