Flexibility-based operational management of a microgrid considering interaction with gas grid

Power systems have been undergoing signiﬁcant restructuring as a result of increasing independently operated local resources. Consequently, new entities, i.e. microgrids (MGs), are developed, which facilitate the integration of local resources, speciﬁcally renewable energy sources (RESs), into the operation of power systems. Despite many beneﬁts, the integration of RESs could cause severe rampings in the net-load, which would challenge the reliable operation of the system. Therefore, it seems essential that ﬂexible local resources in an MG should be employed to provide ﬂexibility services to the main grid, thus ensuring that ramping in the MG’s net-load would meet the ramping capability in the upper-level system. Accordingly, this study aims to develop an energy management framework to schedule local resources in an MG considering system’s ramping limits. In this regard, the interaction between electricity and gas grid as a potential future ﬂexible resource for energy systems is considered in the developed scheme. Moreover, the chance-constrained methodology is employed to address the uncertainty associated with the operational management of RESs. Finally, the proposed energy management model is analysed from different perspec-tives to show the importance of the contribution of ﬂexible local resources to the efﬁcient improvement of the power system ﬂexibility.


INTRODUCTION
Development of microgrids (MGs) as a result of restructuring and privatisation in power systems could cause significant modifications in the operation and planning procedures of the system. In this context, these independently operated entities facilitate the integration of local resources into the operation and planning of power systems. Therefore, the operational scheduling of local resources in an MG could affect the operation of the main grid. In other words, MGs would rely on the main grid to supply the local demands while collaborating with the system operator to efficiently manage the system from the flexibility and reliability as well as economical points of view.
Renewable energy sources (RESs), as potential energy resources in MGs, have received considerable interest in recent years owing to their environmental-friendly origins and gov-This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. © 2021 The Authors. IET Generation, Transmission & Distribution published by John Wiley & Sons Ltd on behalf of The Institution of Engineering and Technology ernmental supports. However, the current increasing trend of integrating RESs, i.e. photovoltaic (PV) and wind power units, has raised new issues in conventional procedures of operating power systems. In this context, intermittency and uncertainty associated with RESs could result in volatility of the systems' net-loads [1]. Therefore, a great amount of flexible ramp would be required to meet the gap between demand and supply when the power produced by RESs suddenly drops.
Traditionally, system operators rely on conventional power plants in order to provide flexibility ramp services to meet the gap between supply and demand. However, decreasing the investment costs of RESs along with significant investment costs, construction time, and operational costs associated with conventional power plants would decrease the role of conventional bulk power units in the flexible operation of power systems [1][2][3]. On the other hand, demand response programs, dispatchable generation units, and energy storage systems as potential flexible resources have considerably expanded in MGs. As a result, the system operator would depend on flexible local resources to improve the flexibility of the system. In this regard, the operational management of the MG considering flexible ramp that could be provided by the upper-level system would be a reliable option to improve the flexibility of the system. This would also align with the upcoming concept of zonal ramping capacity management in power systems [4,5], which is aimed to activate flexible ramping service in pre-defined areas of the system to address the potential transmission grid congestions. Furthermore, significant investment costs associated with improving the flexibility of the main grid could be avoided by flexibleoriented scheduling of local resources [6].
Dispatchable gas-fired generation units have extensively been installed in local systems because of the low fuel costs and emissions, as well as to decrease the active power losses in transmission systems. In this regard, the operational management of MGs should be optimised considering the possibility of interaction with the gas grid. Furthermore, the gas grid could play the role of storage units taking into account the possibility of power-to-gas (P2G) and gas-to-power (G2P) transformations. In this regard, investigating the interconnection of electricity and gas grids has recently been taken into consideration in research works associated with the operational and planning management of power systems.
A management strategy based on interval optimisation to coordinate the operation of gas and electricity grids considering the responsive demands and power generation by wind power units has been proposed in [7]. The proposed optimisation model is developed by incorporating demand response to study flexibility of the load on the operational management of gas and electricity grids. The authors in [8] have developed a bi-level optimisation model in order to maximise the profits of combined cycle gas turbine generators while coordinating the operation of electricity and natural gas networks. Manshadi and Khodayar [9] have developed an optimisation model to coordinate the operation of gas and electricity grids utilising sparse semidefinite programming relaxation. Distributed operation of gas and electricity networks is studied in [10] taking into consideration the alternating direction method of multipliers. Zheng et al. [11] have studied the interdependency of electricity and gas networks from an operational point utilising multiobjective algorithms. In this regard, the Pareto-optimal solution set is determined to analyse their associated conflicting benefits, and multiple attribute decision analysis is taken into account to obtain the final optimal solution. The authors in [12] have studied the integrated operation of gas and electricity grids considering the energy exchange between the two infrastructures. In this regard, the linear analogue transformation and Newton-Raphson algorithms are utilised to model the joint natural gas and power flow. A virtual power plant consisted of distributed energy resources is modelled in [13] to optimise the participation of local resources in day-ahead and real-time electricity markets, as well as the wholesale gas market. In this regard, the interaction between gas and power systems is taken into account to maximise the expected benefits in the day-ahead market while minimising the associated imbalance costs in the real-time balancing market.
Accurate modelling of the combined cycle power units is studied in [14] to investigate their capability to provide flexible ramp services for the efficient operation of the system. The effects of energy exchange between the grid and charging stations of electric vehicles on increasing the ramp-up associated with the net-load of the system are discussed in [15]. In this regard, a dynamic pricing framework is developed in order to alleviate the ramp-up of the net-load in distribution networks. The authors in [16] proposed a home energy management system with the aim of minimising the costs associated with the day-ahead operational energy management while providing utilities with flexibility services. Developing a practical flexibility index and flexibility-based operational management of the system are studied in [17]. Incorporating demand response and electrical storage units as potential flexible resources in the operational management of power systems with high rate penetration of RESs are investigated in [17][18][19]. The authors in [20] studied the significant role of MGs in the provision of ancillary and flexibility ramp services for power grids. While these research works strive to provide flexible service to the power system, the effect of the interaction of electricity and gas grids has not been taken into account in the developed schemes.
The authors in [21] incorporated the Gumbel copula function to model the joint probability distribution of load, solar, and wind forecasting errors in order to develop a novel multiinterval flexible ramp product based on the net-load forecasting. The authors in [22] have developed a flexibility function to control the demand of the building utilising penalty signals associated with emission and electricity prices. In this regard, a flexibility index is proposed to model the dynamic nature of flexibility function and evaluate the capability of the building to respond to the grid's needs for flexibility. A flexible power ramping product to address the ramping associated with PV-penetrated systems in multi-time scale operations has been proposed in [23]. In this regard, a surrogate-based optimisation model is developed based on the economic and reliability benefits of the balancing authorities in order to approximate the objective function and determine the optimal ramping requirements of the system. A multi-stage stochastic bi-level optimisation model is developed in [24] to investigate the effects of incorporating a flexible ramp market into traditional markets (i.e. day-ahead and real-time markets) from equilibrium and feasibility perspectives. Different flexibility-based operational methodologies to deal with issues raised by the integration of RESs are discussed and classified in [25]. The contribution of electric heating demand in providing flexibility to address potential severe ramps in power systems with high penetration of wind power units is studied in [26]. In this regard, Monte Carlo simulation is taken into account to develop wind generation scenarios and determine the system unit commitment to address the ramps associated with the net-load of the system.
Considering the previous research works in the context of flexibility as well as the interaction of electricity and gas grids, as far as the authors are aware, integrated operational modelling of electricity and gas grids in an MG from the flexibility ramp perspective has not yet been investigated in the developed methodologies. In this regard, this study aims to study the alleviation of intense ramps issues and provide flexibility ramp services to the main grid by exploiting the operational scheduling of flexible resources in the MG as well as the interaction of electricity and gas grids. In this context, the developed framework aims to address the shortage in the ramp capacity of the system by incorporating local responsive resources in the MG. Moreover, the coordinated operational management of electricity and gas grids would result in improving the security and reliability of both systems by mitigating the risk of fluctuation and curtailment of demands in the electrical and gas grids. Finally, the chance-constrained methodology is taken into consideration in this study in order to address the uncertainty associated with RESs. In this regard, network operational constraints and limitations over rampings of the MG's net-load are expressed by probability constraints to guarantee the confidence level of the flexibility-based operational management of the MG. Finally, the taxonomy of research works in the flexibility management context is presented in Table 1. Based on the above discussions, the contributions associated with this study are summarised as follows: 1. Interaction of electricity and gas grids along with the efficient management of adjustable loads, conventional generation units, and electrical storage systems (ESSs) are explored as potential flexible local resources in order to improve the flexibility of the system. Moreover, integrated operational management of electricity and gas grids would avoid potential fluctuations in the system. 2. Operational flexibility ramp constraints are taken into consideration in the scheduling of local resources with the aim of providing flexibility services to the main grid. In other words, variations in the net-load of the MG in each time interval would meet the ramping capacity that could be provided by the main grid in the respective time period. In this regard, this study could finally result in decreasing the investment and operational costs associated with providing the required flexibility measures in the power grid. 3. The chance-constrained methodology is utilised in order to model operational constraints of the MG's network considering uncertainty associated with RESs. Moreover, the flexibility ramp constraint is reformulated using the chanceconstrained concept in order to tighten the ramping limitations to address the uncertainty of RESs.
The rest of this study also includes the following sections. Section 3 presents the model and formulation associated with the operational scheduling of the MG. Moreover, the employment of flexibility constraints, modelling the interconnection of electricity and gas networks, and incorporating the chanceconstrained algorithm in the developed model are discussed in this section. Finally, in Section 4, simulations and analysis of the results are presented, followed by the conclusion in Section 5.

System modelling
In recent years, integration of distributed generation (DG) units and thermal loads has tremendously coupled operation of electricity and gas grids in an MG. From the electricity grid point of view, the MG, as an independent entity, could exchange electricity with the main grid in the grid-connected operational mode. Nevertheless, it would rely on the gas grid to supply microturbines (MTs) and thermal loads. In this context, the MG usually consists of conventional DG (CDG) units like MTs, nondispatchable power generation units like PV systems, ESSs, curtailable and shiftable loads called controllable loads, and fixed loads, i.e. non-controllable loads.
From an economic point of view, MGs optimise operational scheduling of their local resources taking into account the electricity price associated with purchasing/selling power from/to the main grid. In this regard, the independent operation of MGs may impose a very steep load on the main grid. It is noteworthy that this operational condition could be exacerbated by the current increasing trend of integrating RESs in MGs while the flexibility ramp capacity that could be provided by the main grid is limited in the future modern power system. That is why MGs must take into account the flexibility that could be provided by the main grid in their operational scheduling of local resources. In this regard, MGs could also provide flexibility services to the main grid by maintaining the ramping of their net-load in predetermined constraints.
Additionally, the interconnection between the electricity and gas grids in an MG enables the control units to convert P2G during off-peak time periods and G2P during peak time periods considering the operational characteristics of both grids. Moreover, by utilising electrical flexible resources as well as interconnection with the gas grid, the MG could perform its optimal scheduling to minimise its operational costs while providing flexibility services for the main grid. Simplified

Co-operation of electrical and gas grids
In this section, the mathematical operational optimisation modelling of coupled electricity and gas grids in an MG is developed in which the MG's control unit optimises the scheduling of its local resources considering operational characteristics of both electricity and gas grids, as well as the flexibility ramp that could be provided by the main grid in each time period. In this regard, the operational optimisation is formulated as below: PH Elec ( The objective function in Equation (1) strives to minimise the operational cost of the MG. In this regard, the cost associated with load shedding, operation of CDG units, and gas wells, and power exchange with the main grid are taken into account in Equation (1). Moreover, the operational model of the electricity grid utilising the DistFlow formulation [27][28][29] is illustrated in Equations (2) to (5). Note that the MG's electric grid is operated radially, where tree(i, j )shows the set of nodes connected by a line in the grid. Equations (6) to (8) enforce operational limitations over the nodal voltages, line loadings, and reactive power in the electrical network. The active power balance in each node of the system is modelled by Equations (9) and (10), where the summation of the power injection in each node, load shedding, power production by RESs, and discharging of storage units meet the electrical and heat demands, as well as charging of storage units. Note that node 0 is considered as the point of common coupling (PCC) between the MG and the main grid. Moreover, Equations (11) to (15) illustrate the operation of ESSs, where Equations (11) and (12) impose charging and discharging limits of the units, and Equations (14) and (15) model the energy states of ESSs. Note that Equation (13) assures that ESSs would not function simultaneously in charging and discharging states. Furthermore, the ramping constraints associated with the MG's net-load and the power exchange with the main grid are represented in Equations (16) to (18).
In the gas network, the gas flow equation based upon Weymouth's formula [13] is represented in Equation (19). Note that Γ 0 andP 0 denote temperature and pressure under normal conditions, and D i, j ,F i, j ,G,L i, j ,Γ, andZ Gas are the internal diameter of the pipe, the dimensionless friction factor, the specific gravity ratio ( R air R gas = 1 0.6 [13]), the length of pipe, temperature, and gas compressibility factor, respectively. In this regard, the gas flow in the steady state depends on the differences between the pressures in the adjacent nodes. Moreover, the sign function is utilised to define the direction of the gas flow, whereas sgn(i, j ) is equal to +1 if the pressure at node i is greater than the pressure at node j. In case the pressure at node i is less than the pressure at node j, sgn(i, j ) would be equal to -1. Equation (20) shows the nodal balance equation where the extracted and injected amount of gas equals gas consumption. Regarding Equation (22), the gas consumption consists of the gas demand, the heat demand supplied by the gas network, and the gas consumption by DG units. As presented in Equation (23), heat demands in the MG would be cooperatively supplied by electrical and gas grids (i.e. electrical and gas thermal demands). In this regard, the ratio of electrical and gas thermal demands is bounded by Equation (24). Operational constraints associated with DG units, gas wells, gas flow, and the pressure in each node are represented in Equations (25) to (28).
The overall optimisation model would become non-linear due to the presented model of the gas flow in Equation (19). In this regard, based on the big-M concept, Equation (19) is substituted by the following equations, i.e. Equations (28) to (33), in order to relax the non-linear terms. In this regard, the following formulations aim to determine the direction of the gas flow in a linearised form and set the value of operational variables based on the determined gas flow direction: Note that a i, j,t and b i, j,t are binary variables that would, respectively, be equal to one when the gas flow direction is from node i to node j and node j to node i at time interval t. In other words, a i, j,t equals one when the gas pressure at node i is higher than node j. Furthermore, B i, j represents the connection between nodes i and j in the gas grid, and K is equal to 10.4892 (19). It is noteworthy that the piecewise linearisation technique is employed to model the squared gas flow term in Equations (28) to (32) to prevent the non-linear model.

2.2.2
Chance-constrained modelling of line loading constraints As mentioned, uncertainties associated with the power generation by RESs should be taken into account in the operational scheduling of the MG to improve the reliability and resiliency of the system. As a result, operational constraints associated with permissible line loadings are modelled utilising the chanceconstrained method in order to secure the operation of the system against uncertainties corresponding with RESs. In this regard, as shown in Equation (7), it is conceived that line loading constraints would be fulfilled with the desired probability of 1 − . In other words, the chance-constrained optimal power flow (OPF) is taken into account in order to restrict the feasible solution area to an acceptable confidence region such that line loading constraints would be satisfied with the desired probability considering uncertainty associated with RESs [30].
The chance-constrained model could be reformulated as illustrated in Equation (34) by linearising the line loadings around their respective nominal operating points. In this regard, the linearised sensitivity modelling of line loadings is derived by applying the Taylor series expansion around the forecasted power generation by RESs: Moreover, the deviation of line loadings due to the forecasting error associated with the power production by RESs could be approximated utilising sensitivity factors as follows: In this study, the linear sensitivity factors are derived from the Jacobian matrix, which is resulted from the power flow at the operating point associated with the forecasted power generation by RESs. In this regard, the deviation of line loadings could be estimated as follows: The detailed derivation of linear sensitivity factors can be found in [30,31]. Moreover, regarding the approach discussed in [32], the chance-constrained line loading could be reformulated as an analytical constraint considering a multivariate distribution to model the deviation in the RESs power generation. In this context, the chance-constrained line loadings could be reformulated as presented in Equations (37) and (38) by assuming Gaussian distribution to model the error of forecasting the power generation by RESs: The derived constraints show that the uncertainty of RESs leads to tightening of the original line loading constraints, which imply that the feasible space is decreased to the desired confidence region by the confidence level of 1 − . In this regard, the uncertainty margin, which secures the system against the uncertainty of RESs, is defined as follows: The derived formulation for implementing the chanceconstrained technique considers Gaussian distribution to model the uncertainty of RESs; however, by taking into account Chebyshev inequality as discussed in [33], Equation (39) could be reformulated as shown in Equation (40) with the aim of finding a more conservative response by tightening the chanceconstrained response area:

2.2.3
Chance-constrained modelling of MG's power exchange with the main grid and the net-load's ramping Similar to the previous procedure, the constraints associated with the power exchange between the MG and the main grid (i.e. MG's net-load), as well as its respective ramping could be modelled by the chance-constrained concept to address the uncertainty of RESs. In this regard, similar to the procedure utilised in the previous section for employing chance-constrained technique on the modelling of line loading constraints, the results of deploying the chance-constrained technique for modelling the constraints associated with the maximum power exchange of the MG with the main grid as well as its net-load's ramping are presented in Equations (41) to (44). It is noteworthy that the limitation over the power exchange of the MG with the main grid could be caused by the maximum loading of the PCC or the operational regulations determined by the power system utilities. Moreover, the MG could provide the main grid with flexibility ramp service while considering the ramping constraints announced by the system operator in the operational scheduling of the local resources. This would finally improve the flexibility of the power system and result in the reliable and secure operation of the system. In this regard, high price spikes resulted from the high rampings in the net-load of the system [34] would also be impeded, which finally benefits the system customers:

NUMERICAL RESULTS AND DISCUSSIONS
The proposed model has been applied to a test system MG as shown in Figure 2 in order to investigate the application of the proposed model for the flexibility-based co-operation of electricity and gas grids in the MG. In this regard, it is considered that the electricity and gas grids are coupled at each bus in our test system and the distance between neighbour buses is 1 km. Furthermore, it is assumed that the forecasted power generation of PV units has Gaussian distribution with the standard deviation of 5%. The characteristics of PV units, loads, ESSs, and the power sector network are described in [35,37]. Moreover, energy prices and loads in the gas sector are modelled based on the Australian energy market as presented in [36]. The peak

FIGURE 2
The simplified model of the test system demands for electricity and gas grids are 792.2 kW and 155.44 GJ at hours 21 and 1, respectively. Three CDG units are located on buses 2, 7, and 8, which utilise gas to produce electric power. Also, heat demands with the peak of 601.12 GJ are located on buses 2, 6, 7, and 8, which would be supplied by both gas and electricity grids. The heat rate is assumed to be 1000 GJ∕kWand the value of load loss is considered to be 1000 $∕kWh.
In order to investigate the performance of the proposed model to prevent emerging intense ramps in the MG's netload, while considering uncertainties of RESs and co-operation of electricity and gas grids, two case studies composed of four states are simulated as defined below: 1. Case1: The flexibility ramp constraints are not considered in the operational scheduling of the MG. 2. Case2: MG's operator employs the flexibility ramp constraints in the MG operational scheduling optimisation. In this regard, the limitation over the rampings of the MG's netload is assumed to be 210kW∕h.
Furthermore, the following four states are studied in each of the case studies: 1. State1: Uncoordinated operation of the electricity and gas grids while modelling the uncertainty of RESs by chanceconstrained technique. 2. State2: Uncoordinated operation of the electricity and gas grids without considering uncertainties of RESs. 3. State3: Coordinated operation of the electricity and gas grids while modelling uncertainty of RESs by chance-constrained technique. 4. State4: Coordinated operation of the electricity and gas grids without considering uncertainties of RESs.
Note that the confidence level in states 1 and 3 is 0.95. Furthermore, as mentioned in Equations (39) and (40), the chanceconstrained equations would be reformulated as deterministic equations by considering uncertainty margins. Respectively, Figure 3 shows the power exchange of the MG with the main grid while considering the coupled operation of electric- Comparing the operational cost of the system while considering the coupled operation of electricity and gas grids ity and gas grids, i.e. Case1_State3, Case1_State4, Case2_State3, Case2_State4. Based on the obtained results, by considering flexibility constraints in the operational scheduling of the MG, high ramps would not occur in the MG's net-load. In this respect, the severe ramp-down at hours 3, 9, and 11 as well as ramp-up at hours 4, and 17 associated with the net-load of the MG in Case1, are not seen in the net-load of the system while considering Case2. Consequently, by revising the resource scheduling optimisation in the MG, the ramping request from the main grid would be minimised, which finally benefits the system by decreasing the costs of improving the flexibility of the power system from operational and investment perspectives. The operational costs of the system by considering the coupled operation of electricity and gas grids are represented in Figure 4. In this regard, taking into account ramping constraints would result in decreasing the MG dependence on the main grid. Furthermore, this condition would cause operating more expensive units, which results in increasing the operational costs associated with studies considering flexibility constraints. Moreover, the studies that model the effects of the uncertainty of RESs on the line loadings, the MG's net-load and its rampings would confront with higher operational costs. This is based on the fact that by employing the Chance-constrained technique on the mentioned constraints, the response area would be tightened to address the uncertainty of RESs, which finally increases the cost of operating the MG by changing the operational scheduling of dispatchable resources.
A similar study is conducted for the uncoordinated operation of electricity and gas grids, i.e. Case1_State1, Case1_State2, Case2_State1, Case2_State2, which is presented in Figures 5  and 6. In this respect, it is conceivable that without considering the interconnection of electricity and gas grids, the Comparing the operational cost of the system while considering the uncoordinated operation of electricity and gas grids operational cost of the MG increases significantly, which is based on the flexibility provided by the co-operation of the electricity and gas grids to impede load curtailment and supplying heat loads, as well as the cost of fossil fuels for MTs. In this regard, while considering coupled electricity and gas grids, power production by MTs would be increased, so the MG would sell the extra generated power to the main grid.
The detailed resource scheduling associated with Case1_State3 and Case2_State3 is, respectively, represented in Figures 7 and 8. The results show that scheduling of resources in Case1_State3 is conducted to maximise the profit, while in Case2_State3 the constraints on ramping of the netload have resulted in changing the resource scheduling. In this regard, the power generation by MTs is increased significantly in hour 3 due to the low price of gas, which leads to high ramping in the net-load of the system. However, the increase in power production by MTs in Case2_State3 is scheduled in a way that copes with the flexibility ramping constraints of   the system. A similar change in operational scheduling of MTs could be seen in hours 11-16 to address the intense ramping up in the evening time periods. The proportional changes in the operational cost of the system in case of considering coordinated/uncoordinated operation of electricity and gas grids, and the RESs uncertainty by utilising chance-constrained technique are, respectively, presented in Tables 2 and 3. The results show the importance of coordinated operation of electricity and gas grids from the operational cost perspectives. Moreover, regarding Table 3, while considering the RESs uncertainty increases the operational cost of the MG, the increase in costs would be lower in the case of modelling coupled operation of electricity and gas grids.
In another study, the sensitivity of the operational cost of the MG while considering different levels of flexibility ramp constraints is investigated. Based on the presented results in Figure 9, the cost of operating the MG would be increased by considering lower ramp limits. In this regard, while the operational cost of the system by employing the chance-constrained technique is higher, the proportional increase in the operational cost of the system is higher without employing the chanceconstrained technique. It is noteworthy that the increase in the

FIGURE 9
The change in operational cost of the MG considering different levels of ramping constraints

FIGURE 10
The change in the operational cost of the system considering Chebyshev inequality cost of the MG would be justifiable in comparison to the costs associated with investments in the main grid to improve the system flexibility. In other words, while the ramping in the MG is limited to 30 kW/h, the proportional increase in operational cost is less than 10%, which could be compensated in comparison to the operational and investment costs that would be required in the main grid to address the ramping in the net-load. As discussed in the study, considering Chebyshev inequality to develop the chance-constrained technique as presented in Equation (41) would result in tightening the response area of the optimisation model. It is noteworthy that while this would result in a more conservative response, the operational cost of the system would be increased as shown in Figure 10. In other words, tightening the response area would decrease the operational risk of the system because of RESs uncertainty, which is compensated by the increase in the operational cost.

CONCLUSION
In this study, flexibility-based scheduling of the local resources in an MG while considering the coupled operation of electricity and gas grids is investigated. In this regard, the co-operation of electricity and gas grids, as well as the scheduling of flexible resources, are exploited in a way that ramping in the net-load of the MG meets the flexibility constraints announced by the main grid operator. Furthermore, the chance-constrained technique is taken into account to tighten the response area of the optimisation model in order to address the RESs uncertainty. In this context, the constraints associated with the line loadings, power exchange with the main grid, and the net-load ramping are re-formulated based on the chance-constrained technique. The proposed operational management framework is applied to the MG test system in order to investigate the application of the developed flexibility-based operational management framework, interconnection of electricity and gas grids, and modelling uncertainty utilising chance-constrained concept from the flexibility and economical perspectives. In this regard, implementation of the proposed framework would decrease the investment and operational costs required to address the ramping of the MG's net-load, which justifies the application of the proposed framework in the operational management of the MG. In other words, the simulation results show the application and effectiveness of the proposed scheme in order to improve the flexibility of the power system by exploiting the operational management of the flexible resources in the MG. injection reactive power to the ith node at t P dch i,t , P ch i,t charging/discharging amount of power storage unit in the ith node at t. E b,t stored energy in the storage unit of the ith node at t Pr i,t gas pressure in the ith node at t PH Gas i,t heat demand supplied by the gas grid in the ith node at t PH Elec i,t heat demand supplied by the electricity grid in the ith node at t. P DG i,t power production by distributed generations in the ith node at t. PDG Gas i,t power produced by consuming gas in the ith node at t flow Gas i, j gas flow from the ith node to the jth node at t Ω l uncertainty margin v b,t , u b,t binary variables for charging and discharging of storage unit b at t. a i, j,t , b i, j,t axillary binary variables for determining gas flow directions from the ith node to the jth node at t.

Parameters
C voll i , C c i , C Gas , C lmp i cost of load shedding in node i, the operational cost of the dispatchable unit in node i, gas price, and energy exchange with the main grid r i, j , x i, j , z i, j resistance, reactance, and impedance between the ith and jth nodes. gas demand in the ith node at t PH i,t heat demand in the ith node at t PD Gas i,t gas consumption in the ith node at t proportional ratio of electric and gas heat demands. FG max i, j maximum capacity of gas flow between the ith and jth node. Pr min , Pr max maximum and minimum of the pressure of nodes in the gas network. PG max Gas maximum gas extraction from gas wells B i, j represents the connection between the ith and jth node confidence level Δ required flexibility M a large number Functions Φ −1 ( ) inverse Gaussian cumulative distribution Γ sensitivity to renewable uncertainty Σ pv covariance matrix.