Risk-based optimal operation of coordinated natural gas and reconﬁgurable electrical networks with integrated energy hubs

This paper elaborates on optimal scheduling of coordinated power and natural gas (NG) networks in the presence of interconnected energy hubs considering reconﬁguration as a ﬂexibility source. With regard to the energy hub system consisting of several generation units, storage and conversion technologies, as well as natural gas-ﬁred units, the high interdependency between gas and electricity carriers should be captured. The hourly reconﬁguration capability is developed for the ﬁrst time in a multi-energy system to enhance the optimal power dispatch and gas consumption pattern. The realistic interdependency of electrical and NG grids is investigated by employing the steady-state Weymouth equation and AC-power ﬂow model for power and gas networks, respectively. Furthermore, to han-dle the risk associated with strong uncertainty of wind power, load, and real-time power price, the conditional value at risk approach is employed. The proposed model is implemented on the integrated test system and simulation results are presented for different cases. The impact of the risk aversion level on operating cost and optimal scheduling of controllable units is examined. Numerical results demonstrate that reconﬁgurable capability reduces the operational


Motivation
Natural gas (NG) plays a significant role in energy supply prospects around the world. For example, the share of NG in total US energy consumption has increased from 21% by 1980 to 27% by 2012, and it is anticipated that by 2040, over 35% of total energy production in this country is provided by NG [1]. The emergence of natural gas-fired (GF) generators, combined heat and power (CHP) units have led to the utilization of NG as the primary fuel for electricity production. In addition to the interdependency between electricity and NG systems, the optimal behaviour of units per hour is limited to various technical and economic limitations that lead to fluctuations in gas consumption by these sources. Fluctuations in the NG consumption pattern could negatively affect the gas flow in pipelines and pressure in different gas nodes, which may endanger the safety of the NG network. They could also put the safe operation of GF units and ultimately the reliability of power grid at risk. Meanwhile, the energy hub (EH) as a fundamental concept of multi-carrier energy systems (MCES) can be considered as a promising solution that is connected to different buses and gas nodes to supply electrical and thermal loads, locally [2]. Because of the various paths in the EH to meet multiple consumers, the optimal performance of existing equipment to minimize total system costs should be captured. Furthermore, providing a flexible configuration is a suitable and cost-effective solution that provided multiple benefits to utility and consumers, such as power loss and operation cost minimization, as well as reliability improvement. The hourly optimal topology is accessible by opening and closing tie-switches through the reconfiguration process [3]. Such actions can change the dispatch portfolio of GF units, and the gas flow accordingly. In addition to the complexity of scheduling MCES, the optimal operation of coordinated electrical and NG networks involves uncertainty associated with RES power output, load demand, and energy prices. Toward the goals of coordinated power and NG networks scheduling in reliable and economical ways have been studied recently, an essential challenge of the integrated power and NG systems is to derive the comprehensive model of risk-based operation of the reconfigurable electrical network coupled with NG system, through emerging facilities such GF units and interconnected EHs. This model should tackle RES generation, load, and energy price variation, as well as all interactions and constraints between two networks.

Literature review and related works
The fast-growing utilization of natural gas as the primary fuel for electricity generation has led researchers to focus on modelling and operation of the NG network. The flow of NG into gas pipes is a complex phenomenon that requires the use of partial differential equations to well represents its behaviour [4], [5]. To simplify these complex equations, several assumptions are considered, resulting in equation analysis in a steadystate or transient state. A dynamic programming approach was presented in [6] to minimize the operation cost of long NG pipelines including a pressure regulating stations. In [7], a bilevel optimization approach was introduced to solve the optimal location and determination problem for pipeline diameter, which was formulated as a mixed-integer non-linear programming (MINLP) model. Recently, GF units with their unique features such as higher efficiency, fast response, far less pollution generation, and quick start-up have triggered more dependence of the electricity grid to the NG network. Therefore, the electricity sector has become an important player in the gas industry, which has led to a strong interaction between electricity and NG networks. In contrast, the gas price variability, and its effects on the power system should be accounted for coordinated scheduling of power and gas networks. Authors in [8] evaluated the robust flexible security constraint unit commitment (SCUC) model for interconnected multi-carrier energy networks n the presence of flexible resources. The coordinated optimal energy dispatch of integrated electricity and NG networks under the stochastic optimization approach was extended by [9], [10]. In [11], a bi-level optimization problem was proposed for optimal scheduling of integrated NG and electricity grids with respect to NG transient state equations. The security constrained integrated electrical and NG networks co-expansion planning integrated with demand response and high penetration of wind energy was evaluated by [12]. The expansion planning of the multi-energy system based on the MINLP model was studied in [13], to address the optimal location and time of installation of multiple components in power and gas grids to minimize investment cost. In [14], a mixed-integer linear programming (MILP) model was developed for the optimal operation of integrated power and gas networks, considering line-pack capability with regard to steady-state and AC power flow models. In [15], a stochastic decentralized model for the operation and planning of interconnected gas and electricity networks was investigated. The real-time and short-term scheduling of the coordinated electricity and NG system in the presence of the power-to-gas facility and GF units was developed in [16]. The proposed model extends minute-scale gas flow, as well as the hourly scale power flow for the integrated system with the aim of operation cost minimization. Authors in [17] stated that GF units are an inseparable part of multi-carrier energy systems. The presence of these resources, coupled with electricity and gas networks, will pose several challenges. To address these challenges, the dynamic models for the NG grid have been investigated to better evaluate the interconnection of electrical and NG networks. The unit commitment model was extended in [18], including NG network and interdependency constraints between two systems aiming to minimize the operational cost. In [19], the resilience and vulnerability of interconnected electricity and NG networks in the micro-grid environment have been studied. To mitigate the negative effects of renewable energy fluctuations on the performance of multi-energy residential systems (MERS), the scheduling of these systems with regard to electricity and gas carriers has been proposed in [20].
The EH concept has attracted much attention for conversation, store, generation, and consumption of multiple energies. An interconnected EH model describes the transmission, conversion, and energy storage in a system, including several sub-regions [21]. All the challenges, weakness, and promising options of the EHs with a fast-growing toward multi-energy systems have been discussed by [22]. The authors of [23] stated that the interconnected EHs are a key factor in the multi-carrier system. Therefore, here, a multi-dimensional piecewise linear approximation approach was developed to simplify the complex NG transmission equation, as well as electrical power flow equation considering interconnected EHs. The energy management model of residential EH, including electricity and NG as inputs, was formulated based on the MILP model by [24]. The co-planning multi-EH system with NG and electrical carriers incorporated with high penetration of renewable energy based on the robust framework was evaluated by [25]. In [26], a new framework for optimal operation and planning of multienergy systems considering EHs including CHP and GF units, was developed. The proposed framework determines the optimal capacity, location, and time of installation of new equipment over a 10-year period. The multi-energy network incorporating NG, heat and electricity networks based on distributed EHs was developed in [27]. In this study, the comprehensive model of integrated networks corresponding the restrictions based on the mixed-integer second-order cone programming was presented. In [28], a smart EH integrated with wind power and demand response to meet thermal and electrical loads considering energy prices uncertainty was developed. In [29], a novel EH system incorporated with CAES was developed for modelling transaction between power and heating networks using bi-level optimization framework.
Meanwhile, the flexible configuration for integrated energy system can provide extra benefits for utility and consumer from economic and technical perspectives. Reconfiguration capability can be implemented at distribution level as a control option to reroute the power flows and maximize capacity utilization of the feeders, which in turn changes the GF unit commitment and gas flow in pipes. The authors in [30] stated that the future of the distribution networks will be envisaged as neighboring grids that exchange power through a reconfigurable framework. The bi-level optimization framework for reconfiguration of distribution networks to improve the system operation against any disaster events such as storm was investigated by [31] aiming at minimizing the load interruption cost. The risk-based optimal scheduling of reconfigurable microgrids integrated with wind energy based on the condition-value at risk (CVaR) criteria was evaluated in [32]. The proposed problem is formulated as a two-stage stochastic approach considering electricity price, wind power, and load demand variations. In [33], a novel heuristic method named switch opening and exchange approach has been implemented to solve a multi-hour network reconfiguration based on the stochastic framework. The authors of [34] have proposed a bi-level transactive energy trading framework to improve the energy dispatch of multi-carrier system, based on EH concept. The upper-level problem maximizes the social welfare of each EH, while the reconfiguration of the network is done by the system operator in the lower level to reduce the power loss. The optimal scheduling of the reconfigurable distribution network with considering the islanding capability based on the chance-constrained optimization model was extended by [35]aiming to minimize total operation cost.
However, the fast-growing installation of RESs with intermittent output, besides load and price uncertainties, results in optimal operation of multi-energy systems and it highlights the importance of risk management in such problems associated with random variables. The risk-averse stochastic programming of EH to serve both electrical and heat demands in the presence of the price uncertainty with the aim of operational cost minimization was developed by [36]. The risk-averse strategy in the security-constrained unit commitment model incorporated with battery storage system in the rail transportation was investigated by [37]. The proposed robust-stochastic approach analyzes the effects of battery-based rail transportation in the wind power curtailment reduction. The risk-based framework based CVaR was presented in [38] for optimal short-term energy and reserve operation of a virtual power plant integrated with wind energy and demand response.

Research gaps and contributions of this work
Under the high interdependency between electricity and natural gas networks, it may be unrealistic and unreasonable if the two energy networks are operated separately. Thus, a comprehensive model of coordinated NG and reconfigurable electrical networks, considering all the limitations and interconnections between both gas and electrical grids, is urgently needed, which has rarely been studied in the literature. The remarkable gaps in the literature review can be outlined as follows: • In [8][9][10][11][12][13][14][15][16][17][18][19][20], only the optimal operation of a coordinated energy system with a focus on security constraints of both networks has been studied, neglecting the reconfiguration capability and interconnected EHs. • In [21][22][23][24][25][26][27][28][29], the authors focused on EHs scheduling as a basic infrastructure for the multi-carrier energy system, while security constraints and interdependency of gas and power grids have been ignored. • In [30][31][32][33][34][35], although the reconfiguration capability of distribution networks has been investigated as a flexible solution, this capability for integrated gas and power grids has not been evaluated by each work. • In [33][34][35][36][37][38], although the risk management in multiple problems has been studied, the risk-based optimal operation of integrated energy systems considering a comprehensive model for the interdependency of gas and power systems, and the reconfiguration capability under strong uncertainty has been ignored.
Based on the mentioned gaps, this paper concentrates on the risk-based optimal scheduling of integrated NG and reconfigurable electricity grids with distributed EHs. The proposed model is formulated as a two-stage stochastic approach considering the real-time power price, electrical load, and wind power variations. The distributed EHs equipped with CHP, gas boiler (GB), heat pump, and thermal storage are considered as connection points between NG and electricity distribution networks to supply both heating and electrical consumers. The ACpower flow and steady-state Weymouth gas flow equations are employed to model electrical and NG networks, respectively. Also, the risk-measure based on the conditional value-at-risk (CVaR) is extended to analyze the risk of the proposed model. The main contributions of this paper can be summarized as follows: • Proposing a two-stage stochastic operation of coordinated NG and reconfigurable electricity networks. The proposed model considers all interactions between both carriers to reveal the effects of multiple technologies on the optimal daily scheduling. • Implementing the AC-power flow and steady-state Weymouth equations for electricity and NG networks, respectively, under the reconfiguration capability for the first time to reveal the interdependence of both energy systems, achieving a more realistic model. • Considering the interconnected EHs, containing multiple components beside gas-fired units as connection points between natural gas and electricity carriers under risk-based scheduling. The system operator can rely on the distributed EHs at different buses to supply local loads and reduce his dependency on the upstream gas and power market, results in the total operation cost reduction. • Analyzing the consumption pattern of the gas-fired unit under hourly reconfiguration and its interactions with the gas network. The reconfiguration can affect the optimal power flow, and hourly unit commitment which results in gas flow changes in pipelines, consequently cost reduction. • Incorporating the risk-measure based on CVaR criteria in the MINLP model to evaluate the risk of expected cost considering load, wind energy, and energy price uncertainties on the decision making process by the integrated energy system's operator.

Notation
The subscripts t and that were used for all variables in Nomenclature section demonstrate the amount of the variables at time t and scenario .

Paper organization
The rest of this paper is organized in following order. Section 2 presents the problem description and formulation, including objective function and constraints related to both electrical and NG networks. The risk measure approach based on CVaR model is represented in Section 3. Section 4 contains the simulation and numerical results. Finally, Section 5 concludes the paper.

Paper description
The optimal scheduling of coordinated electrical and NG networks considering reconfiguration capability and interconnected EHs (incorporated with CHP, GB unit, heat pump, and TES) is formulated as a two-stage stochastic model. The overall schematic of the proposed problem is depicted in Figure 1. The operator seeks to minimize the operational cost of coordinated NG electrical systems, considering a load demand, wind energy and real-time power price variability. The power purchased from the day-ahead market (DAM), and unit commitment are determined at the first stage as here-and-now variables. Based on wind power, load and real-time power price uncertainty modelling using the scenario-based stochastic framework, the opti-mal power dispatch, purchasing NG and electricity from gas market and real-time market (RTM), respectively, and energy procured by each interconnected EHs are determined as waitand-see variables in the second stage. It should be noted that the electricity and thermal procedure of each EH has a significant effect on the GF units, as well as power and gas purchased from the markets. The risk-measure based on CVaR criteria is implemented by the operator to mitigate the risk of expected cost based on the optimal solution for power dispatch of GF units, energy procured of interconnected EHs, hourly switches status, and power and NG exchanged with corresponding markets based on AC-power flow and steady state Weymouth models.

Objective function
The objective function of the proposed model is represented by (1). The first term of (1) denotes the purchased power cost from the DAM. The start-up and shut-down cost related to the GF and CHP units are represented by second and third terms of (1), respectively. The cost of purchased power from the RTM is expressed by fourth term of (1). The generation cost of GF by fifth term of (1). The cost of purchased NG from the gas market is given in sixth term of (1). Finally, the switching cost for any switching action as [35], is represented by seventh term of (1). ) (1)

Problem constraints
The proposed scheduling of coordinated reconfigurable electrical and NG networks is restricted by multiple constraints as follows.
• Gas-fired unit constraints The fast-growing installation of GF units makes the electricity sector as an important player in the gas industry, which has led to a strong interaction between electricity and NG networks. The operation of GF units is limited by different constraints such as active and reactive power output, ramp-up/ ramp-down, minimum up/down times, and etc., which are provided by [3].

• Electrical energy storage constraints
This study shows battery energy storage system (BESS) is embedded in the power system to facilitate the integration of wind energy and preserve load balance. The BESS charging and discharging power are bounded by upper and lower values, as represented in (2) and (3), respectively. The binary variables to separate the charging and discharging modes at each time is established in (4). If BESS operates in charging mode, x ch b,t , = 1 and constraint (3) is imposed, being 0 otherwise, and constraint (2) is imposed. Constraints (5)-(7) are related to energy capacity and state-of-charge (SOC) of BESS.
• Power flow and radiality constraints The active and reactive power balance between supply and demand sides at each bus and other power flow limits are established by (8)- (17). The active and reactive power balance are established by (8) and (9), respectively. It should be noted that the first two terms in (8) and (9) must be eliminated for each bus except for slack bus (main bus that make the connection between electrical system and upstream network). Also, the third term in (8) and (9) are related to the active and reactive power of EH which are considered for buses with EHs (buses with i ′ index). The active and reactive power flow in the distribution feeder considering the reconfiguration capability are represented by (10) and (11). The amount of power exchanged with the upstream network is limited by (12) [39]. The thermal capacity of feeder is established by (13). Constraint (14) shows the voltage limit for each bus. However, the radiality structure of distribution network should be maintained; hence the optimal structure should not contain any loop at each time. To establish the radiality constraint, the number of open switches pre and after reconfiguration must be equaled as (15). It should be noted that the possible loops in the distribution network structure are found only once after equipment installation. To prevent making any loop in distribution network structure, constraint (16) is imposed. Also, the number of total switching action to calculate the switching cost term is determined by (17).
• EH constraints The interconnected EH is considered to be the connection point between electricity and NG networks as well as bidirectional connection at coupling points with energy networks. The proposed EH model is shown in Figure 2.
The proposed EH can contain the GB, CHP, heat storage, transformer and electrical pump. The operation of EH is restricted by multiple limitations described as follows.
• Energy balance constraints (power and heat balance) Constraints (18) and (19) demonstrate the active and reactive power balance in the interconnected EH. The right term of constraint (18) denotes the power exchanged between the hub and the corresponding bus. In other words, the EH can be back into the bus. The thermal balance limit is represented by (20).
• GB constraints Constraint (21) represents the limitation of produced heat by GB unit which is bounded by maximum and minimum values. The fuel function of GB represents the consumed NG by it that is expressed by (22), where HR bo is heat rate for the GB.
• TES constraints The thermal energy storage (TES) facility is coupled with GB and CHP unit to provide more flexibility in thermal load supply. Similar to BESS, TES can only operate either in charging or discharging mode, established by (23). The charge and discharge value limits are represented by (24) and (25), respectively. Constraint (26) represents the current thermal energy content of TES. This value is limited by the maximum value as established in (27). Constraint (28) • Heat pump and transformer constraints Heat pumps transfer thermal energy in the opposite direction of spontaneous heat transfer. The active and reactive power consumption by heat pump are bounded by minimum and maximum values, as represented by (29) and (30), respectively.
As the heat pump, there are active and reactive power limits on the transformer operation which are bounded by the minimum and maximum values as [40].
• CHP unit constraints Generally, the produced heat and power by CHP unit depend to each other. The produced power (active and reactive power outputs) and heat limits b CHP unit are given by (31)- (33). HPR n and he are, respectively, heat to power and heat exchange efficiency [28]. The generated power by CHP cannot change rapidly. Therefore, the ramp-up and ramp-down constraints for CHP should be established as (34) and (35), respectively. The start-up and shut-down costs related to the CHP are represented in (36)- (39).
H n,t , ≤ P n,t , × HPR n × he , SU n,t ≥ SUC n (u n,t − u n,t −1 ) SU n,t ≥ 0 (37) • Natural gas network constraints Equation (40) models the gas flow in a pipeline as a non-linear function of pipeline characteristics and node pressure. The sgn is the sign function as formulated in (41). The amount of gas flow in pipeline is limited by maximum value as (42). The pressure of gas node is limited by the minimum and maximum values as given by (43). As electrical network, the gas balance should be established at each gas node. Therefore, constraint (44) represents the gas balance between production and consumption sides, where G d ,t , is the gas loads, including GF units and EH's input described in the following. The scheduled value of the purchased NG from the gas market is calculated by (45), while the gross heating value is applied to convert the volume of the NG to the energy value [41]. This value is limited by constraint (46).
• Electrical and NG coupling constraints The GF units and interconnection EHs are the two gas consumers, which make connection points between electrical and NG networks. As [9], the gas consumption by GF unit is modelled based on the quadratic function. Also, the gas balance and maximum gas consumption by GF unit and EH are bounded by the maximum values, which are represented in [9].

Risk measure based on CVaR
In optimization problems associated with multiple uncertainties, including RES fluctuation, load demand, as well as energy prices, the objective function can be specified by the stochastic programming criteria such as expected value. The expected value of the objective function is the most useful criterion that is applied in such stochastic programming problems. Despite the multiple advantages of utilization of the expected value criterion for the problem associated with random variables, the main impediment of this approach is that it only shows an average of multiple scenarios [41] and [42]. In other words, the optimal value of the objective function in some scenarios may be far from the average value, while more acceptable to the decisionmaker. Therefore, control of the risk of experiencing cost in the presence of different random variables is essential. CVaR with unique features can assess and manage the risk associated with wind energy, load demand, and electricity price in the RTM. The general form of CVaR can be formulated as follows: where is confidence level, is value at risk, s is non-negative and continuous variables which equals to the maximum value of OF s − , and equals to 0, if the value of the left side of (48) is negative. It should be noted that the confidence level ( ) is considered to be 0.95 and has been increased from 0 to 1 in fixed steps.

CVaR-based optimal scheduling of coordinated electrical and NG distribution systems
The risk-constrained scheduling of coordinated NG and reconfigurable electricity distribution networks incorporated with interconnected EHs with multiple terms in the objective function (1) can be reformulated based on the risk measure strategy which was described in previous section as follows: ) where ∈ 0, 1 is a risk parameter that is used to specify the compromise between cost function and risk aversion. The proposed CVaR-based objective function (50) is subjected to fol- ) (2) − (46). (53)

Case study
The integrated distribution energy system including reconfigurable electrical and NG networks test case as shown in Figure 3 was utilized to verify the effectiveness of the proposed riskbased optimal scheduling. A modified 10-bus reconfigurable distribution network, including two tie-switches and nine sectionalizing lines, and three gas-fired units (at bus 5, 7, and 8) are implemented. All characteristics of 10-bus distribution system are presented in [32]. The 500 kW wind turbine is included in distribution system, which is located in bus 3. Also, the battery energy storage is located in bus 3, with 50 kW maximum charging and discharging and 200 kWh capacity.
The hourly energy price Also, a modified 6-nodes natural gas network is used in this paper [41]. The maximum allowable NG volume pass from the main pipeline is 420 cubic meter per hour. The three NGfired units are supplied from nodes 1, 3, and 5. The minimum and maximum limits of NG pipeline pressure are 0.2 and 1.3 (p.u.), respectively.
There are three interconnected EHs in the multi-energy system, which are located in buses 4, 5 and 7 and nodes 4, 5 and 2, respectively. The existing resources in each EH is shown in Table 1. Also, characteristics of embedded resources in EHs are given in [41]. The electrical and thermal loads of 3 interconnected EHs are given in [40]. Figure 4 shows the real-time price, NG price as well as dayahead power price. The mean value of electrical load (active and reactive), and wind energy scenarios are shown in Figure 5.
It should be noted that all uncertain parameters are subjected to the corresponding probability distribution function with unique features. More information can be found in [43].

Numerical results
The proposed risk-constrained scheduling of coordinated NG and reconfigurable electrical distribution systems incorporated with distributed EHs, considering AC power flow and Weymouth equations was formulated as MINLP model, carried out in GAMS software and solved with SBB solver. The simulation results are provided for the following cases: • Case 1: Optimal scheduling of coordinated natural gas and electrical distribution networks without reconfiguration capability. • Case 2: Case 1 considering reconfiguration capability.
In order to capture the benefit of reconfiguration capability, numerical results for two first cases are presented, simultaneously, which facilitates the comparison between the obtained results. Table 2 presents total operation cost in 10 scenarios for Case 1 and Case 2 with corresponding probabilities. Also, the expected operation cost in Case 1 and Case 2 is given in this table. The reconfiguration capability in Case 2 reduces the expected operation cost by 7.82%, with respect to Case 1. For more explanations, scenario number 6 with the most expensive total operational cost (worst case scenario) is selected and is provided in detail. Figure 6 depicts the power dispatch in scenario number 6. According to Figure 6, in Case 2, GF 1 as a high-cost unit is committed few hours in comparison with Case 1 (only peak hours: 13-16 and 21-22). Also, at lower electricity price (1-7), by adjusting the switches status and using the maximum feeders' capacity through reconfiguration, the system operator tends to purchase more power from DAM and RTM, instead of turning on the GF2 in Case 2. Furthermore, the battery energy storage has the same behaviour, in comparison with Case 1, due to the purchasing of more power from both markets, the battery is charged more in Case 2, and injects the power to the system at peak hours.  Figure 7 shows the power purchased from DAM and RTM in Case 1 and Case 2, for scenario number 6. According to Figure 4, for the time period including 1-11, 15-18, and 23-24, the DAM prices is less than RTM prices and it is economical for the operator to purchase more power from the DAM as depicted in Figure 7. As can be seen from this figure, in comparison with Case 1, the reconfiguration capability enables the operator to purchase more power from DAM in Case 2. The main reason for this phenomenon is that the reconfiguration transfers the electrical load from heavily loaded parts to lightly ones contributing to more economic benefits. In other words, using the reconfiguration to improve the power loss and adjust the switches status, enables the operator to purchase more electricity at lower prices (1-7) and contributes to more economic savings from the electricity supply side. The opposite of this procedure is true for higher prices (13-16, and 20-22). Also, the power purchased from the RTM is increased at this period, due to declining RTM in comparison with DAM for both cases.
The procured electrical and thermal energy for three interconnected EHs in scenario number 6 are analyzed separately.
• Energy Hub 1 Figure 8 shows the procured electrical and thermal energy of EH 1. For the time period with lower electricity prices (1-7 and 23-24), more power injects to EH 1. In this period, the heat pump operates with the maximum capacity to supply thermal loads. In both cases, for lower electricity prices, more power is injected into EH 1, consequently, the injected NG is reduced. In contrast, for the time periods with higher prices, more NG is injected, and the power injection is reduced. The main reason for this phenomenon is that the main part of the injected NG is burned by the CHP to generate electricity with the maximum capacity, and supply electrical load at peak hours. Furthermore, according to Figure 8, in the time periods 12-16 and 20-22, the extra power generated by the CHP back into the bus, when the electricity price reaches higher values and contributes to more economic saving by the operator. The optimal scheduling of the GB and TES are also following the thermal demand. The only noticeable difference between the two cases is the increase in power injection in lower electricity prices and consequent decrease in gas injection due to the reconfiguration capability.
• Energy Hub 2 Figure 9 shows the procured electrical and thermal energy for EH2 in Case 1 and Case 2. The EH 2 has a higher thermal loads and the CHP unit is not embedded. For the time period with lower electricity prices, the heat pump operates with the maximum capacity in both cases. The GB operates with the maximum capacity to supply thermal loads. In comparison with EH1, TES discharges more hours. At the initial time of day, TES is charged by the generated heat from the heat pump and GB and injects the stored heat when the gas price is higher or pump heat is off. The power injection in Case 2 is more than Case 1 thanks to the reconfiguration capability. For example, at 18 and 23-24 (lower electricity prices), more power injected to turn on the heat pump, in comparison with Case 1.
• Energy Hub 3 The procured electrical and thermal energy for EH3 is depicted in Figure 10. For time periods with lower electricity prices, more power is injected to EH3 in both cases. Although reconfiguration capability causes more power injection from the corresponding bus in Case 2, in comparison with Case 1 (for example at [23][24]. The EH3 has more electrical load and relatively less thermal demand. Therefore, the CHP unit

FIGURE 11
The hourly natural gas flow rate in main pipeline for Case 1 and Case 2 is used only for electricity supply and the heat generated by the CHP is zero. Also, at 13-16, the extra power generated by CHP back into the network. The optimal scheme of the GB and TES also follow the thermal demand to minimize operation cost through the reduction of the NG consumption.
The optimal switches status in Case 2 for scenario number 6 is given by Table 3. At each time, two switches are opened to establish the radiality constraint. Using the reconfiguration to improve the power loss and adjust the switches status causes the maximum utilization of feeder capacity and consequent reduction of operation cost. Figure 11 shows the NG flow in the main pipeline between the gas grid and system to supply gas loads, including three interconnected EHs, and three GF units for both cases in scenario 6. As previously discussed, the local gas consumers' supply via EHs have more priority than GF units. The effect of the reconfiguration capability on the burned NG by the GF units and EHs is quite obvious. Reconfiguration by using the maximum feeder capacity can change the power dispatch, and consequently gas flow. As presented in results, for the time periods with lower electricity prices, more power injected from the DAM and RTM and GF units' behaviour are completely changed. This action results in the gas consumed by the integrated system. According to Figure 11, at 1-7, the NG flow is reduced in Case 2. The main reason for this phenomenon is that the G3 is less committed, and the thermal loads are supplied via a heat pump, therefore, less NG burned.
• Case 3 In the following, the risk management of the proposed scheduling problem is evaluated. The effects of risk parameter ( ) on the values of multiple variables are analyzed. The values of depending on the operator's performance in the face of risk management. The risk-taker operator prefers the values of to reach a fewer operation cost with high risk, while the risk-averse operator prefers values of to reduce the risk. Figure 12 depicts the values of CVaR per the expected cost for different values of . According to this figure, the high expected operation cost is obtained at low risk, while at high The power purchased from day-ahead and real-time markets for three different values of is shown in Figure 13. By increasing , the power purchased from DAM is increased, while the power purchased from RTM reduces. This action is caused by the risk associated with real-time electricity prices.
The optimal daily structure including opened switches for different values of is given by Table 4. According to Table 4, changing results in an optimal hourly topology.
The NG flow rate in the pipeline between main pipeline and the system for different values of is shown by Figure 14. By increasing , for the time period between 7-24, the NG flow is reduced compared with Case 2 ( = 0 ). The main reason for this phenomenon is the significant increase of power purchased from the DAM. Therefore, the risk-taker operator trends to purchase more electricity and minimize the NG purchased for the operation cost reduction, based on NG price conditions (depicted in Figure 4).
Here, the reconfiguration process is considered in the optimal scheduling of coordinated gas and power distribution systems. As discussed in the radiality constraint, the offline method is employed to find the possible loop in the structure. After that, the number of open and closed switches at each period according to (15) and (16) is calculated, without any complication in the radiality modelling compared to the branch incidence matrix. However, there are different solutions in the literature to solve the reconfiguration problem like the heuristic method. Genetic algorithm (GA) and particle swarm optimization (PSO) are the two most known heuristic approaches which have been mainly implemented in several problems in the power system operation. To reveal the effectiveness of the proposed model for the integrated gas and reconfigurable electrical

FIGURE 14
Variation of natural gas flow in main pipeline for different values of distribution network, we compared the major conclusion obtained from the reconfiguration results with GA and PSO as represented in Table 5. These methods act based on the fitness function and a large number of iterations are required for converging. To find the optimal topology, both algorithms establish the radiality constraint based on the branch incidence matrix. As shown in Table 5, the proposed model has much less execution time compared to the GA and PSO. In terms of obtained topology at each hour, there is no noticeable difference between the results. Furthermore, the expected operation cost examined by the proposed model is 12.5% and 14.7% less than the GA and PSO methods, respectively. 19

CONCLUSION
In this paper, optimal risk-based scheduling of integrated power and natural gas grids with a focus on distributed EHs was proposed, which considered the reconfigurable capability in a multicarrier energy system, for the first time. The natural gas-fired units and EHs that were equipped by CHP, gas boiler, heat pump, and thermal storage were considered as gas consumers which make links between gas and electricity carriers. The proposed scheduling was formulated as a two-stage stochastic model and conditional value at risk was implemented to manage the risk associated with strong uncertainties. The model was examined on the test system in different cases. The following major conclusions are drawn from the simulation results: • The hourly reconfiguration while increasing the power purchased, results in gas purchased reduction, as well as operational cost reduction up to 7.82%. • The effects of reveal that the risk-averse operator prefers to buy power from the real-time market, while the risk-taker operator prefers to purchase from the day-ahead market.
• Under the risk-based strategy, the gas flow rate between the main pipeline reduces while the power purchased is increased, as the value of increases. • As the value of increases, the CVaR is reduced, while the expected operation cost is increased up to 14.6%. In other words, high expected operational cost is obtained at low-level risk, and vice versa.