A system dynamics approach to study the long-term interaction of the natural gas market and electricity market comprising high penetration of renewable energy resources

Due to the gas consumption of some power plants for electricity generation and providing an acceptable level of flexibility, the interaction of natural gas markets and electricity markets is inevitable. One of the main challenges of policymakers in the energy sector coupling is the investigation of such interactions. Our main goal is to analyze the effect of the penetration of renewable energy resources on the behavior of gas markets and vice versa from the policymaker’s viewpoint. Moreover, we tend to study the effect of an external shock on the behavior of the whole system and the role of renewable resources in mitigating these side effects. Therefore, we used System Dynamic Approach to model the long-term behavior of the natural gas markets to extend the existed models of the electricity markets behavior and couple these markets. The Net Present Value method was used for the economic assessment of the investment in the development of gas reserves, and new stock and flow variables were defined to simulate this development. The simulations are performed for four scenarios by using a valid case study. Considering the results of simulations and sensitivity analysis, as the wind capacity incentive rose, the gas and electricity prices declined and their fluctuation increased during the time horizon. Although the effect of the gas market shock on the system depends on the time of occurrence, as the penetration of renewable units increased, the severity of its side effects decreased and the price jumps in the markets were mitigated.


Introduction
Undoubtedly, the availability of clean, affordable, and reliable energy is the cornerstone of social welfare and economic growth [1]. In this regard, air pollution concerns, and energy security issues, have forced governments to utilize renewable energy resources for electrical power generation [2]. Studies show that European countries tend to use wind energy to supply their major electricity demand [3]. On the other hand, natural gas has lower pollutant emission and higher energy conversion efficiency in comparison to other fossil fuels; therefore, it has become an appropriate alternative to power generation [4]. Moreover, the stochastic nature of renewable energy resources such as wind and photovoltaic units causes uncertainty in the operation of the integrated energy systems and increases the need for operational flexibility [5]. Among different alternatives for the improvement of flexibility of the power systems such as dispatching the pumped hydropower plants [6,7], electrical energy storages [8], and load management approaches [9], utilization of the gas-fired units is an attractive solution due to their quick response ability and less air pollution [10]. Accordingly, by increasing the share of renewable energy resources, the role of the natural gas network in supporting the electricity system gains more importance [11]. Furthermore, as the installed capacity of gas-fired units rises, the consumption of natural gas alters and this influences the gas price. Meanwhile, the increasing share of renewable energy resources in the electricity market decreases the share of fossil fuel technologies in power generation. Therefore, the interaction between gas and electrical systems is inevitable.
In the past few years, plenty of efforts have been carried out to study the energy sector coupling and the different aspects of interaction among gas and electricity networks. In [12], different levels of coordination between gas and electricity systems were examined and a twostage stochastic programming was used to introduce an integrated operational model for these systems under the uncertain power supply.
In [13], a dynamic game-theoretic model was developed to study the effect of gas market reforming on the development of natural gas-fired units, in which the hourly real-time pricing was considered in natural gas and electricity markets. The implications of renewable energy policies and coordination schemes on the North American natural gas sector were investigated in [14]. The vulnerability of the transmission lines of coupled natural gas and electricity systems was assessed in [15] and a graph theory-based approach was applied to consider the effects of interdependencies among networks. The effect of country-dependent incentives on the feasibility of the wasted heat recovery from the power generation for steam production in Latin America was evaluated in [16] considering natural gas markets, regulation, and macroeconomic variables. The bi-directional cascading failure was evaluated using an integrated simulation approach in an electricity-natural gas system comprised of gas-fired generators and electricity-driven gas compressors [17]. In [18], the European energy transition was investigated to guarantee the security of gas and power supply through an energy system planning model comprised of a long-term investment model and a spatially resolved system security model. The short-time effect of natural gas prices on power generation scheduling and operation, using security-constrained unit commitment was studied in [19]. In [20], the interactions between the natural gas, water, and power generation systems were described and operation, economy, and gas emission of integrated systems were analyzed to reach effective performance. The effects of cross-border energy transmission among North American countries on integrated gas and electricity markets and the generation sectors were investigated in [21]. The authors of [22] examined how investment in the natural gas reserves of Ghana can influence the electricity sector performance of this country. A dynamic energy conversion and management strategy along with deep reinforcement learning was utilized in [23] to coordinate the operations of the power-to-gas units and generators for smoothing the load curve of integrated electricity and natural gas system. The authors of [24] emphasized the multidimensionality of the generation expansion planning execution by the comprehensive review of the most recent approaches in this context. In that paper, seven different challenges that influence generation expansion planning were identified. These challenges are comprised of consideration of transmission expansion planning, risk assessment, deployment of electric vehicles, short-term power systems operation, demand-side management and storage, the interaction of power and natural gas network, and policy implications. A portfolio strategy was introduced in [25] for gas generators that were equipped with power-togas storage devices to mitigate the risk of spot, ancillary, and the financial market in Australia. In [ created for the development of electricity and gas networks based on a static stochastic cost minimization model. Such models help determine the location of new electricity generation units and gas supply facilities, their optimized capacities, and the related transmission lines and pipelines. In [27], a specific energy trading mechanism was designed based on the combination of blockchain and distributed optimization to prevent dishonesty between participants in the energy markets. In another line of research, extensive studies have been conducted in the development of dynamic models of both natural gas and electricity markets separately. In [28], dynamics of conventional and wind capacity investment in the electricity market were modeled considering the uncertainty of wind speed. The authors of [3] measured the investment risk of wind units in a dynamic model and introduced a new incentive policy to reduce this risk. The behavior of electricity markets in several countries such as Colombia, Tanzania, China, and Iran was studied by dynamic models in [29][30][31][32], respectively. In [33], the effect of various factors on the long-term production and demand of the UK natural gas system was analyzed through a dynamic model and the effectiveness of policies that help the UK to shift from a self-sufficient country in gas production into the gas importer country in the long term was investigated. A dynamic approach was introduced in [34] to model Iran's natural gas supply and demand system. Moreover, the possibility of providing sufficient capital for future natural gas resource development through the natural gas supply and demand system of this country was studied. A new, global, bottom-up dynamic model of natural gas supply was introduced in [35] using supply curves in which the size and age of gas fields, operating, abandonment, exploration, and emissions costs of production were considered.
To the best of the author's knowledge, no article proposed the dynamic model representing the interactive behavior of natural gas and electricity markets simultaneously. Any failure in the performance of the natural gas system or under-investment in natural gas production facilities can cause devastating effects on the electricity system. On the other hand, the investment in renewable energy resources influences gas consumption and this, in turn, affects the performance of the gas system. Moreover, the high volatility of energy prices along with construction and development time delays discourages investment and delays the energy technology transition. Therefore, governments and policymakers need a useful tool to investigate the long-term interaction of the natural gas system and electricity network with the high penetration of renewable energy resources.
Due to the specific characteristics of energy policy problems, dynamic models are useful tools for policymakers to examine the policy implications and the result of decisions. The first feature is the complexity of the environment where policy is implemented. This complexity makes policies highly vulnerable especially when, policy measures create feedback from the environment that undermines the policy and this may become worse because of time delays between policy actions and gained results [36]. Such feedbacks and time delays in coupled systems can be modeled by the system dynamics approach. For example, by considering an incentive policy for energy generation development, the generation capacity rises. Then, this leads to price reduction that reduces the profit of generation units and this is in contrast with the original goal of the policy. The second feature is the importance of experimentation and the high cost of incorrect policies [36]. Since the whole system burdens a high level of risk, policy experimentation is important. For example, if the wrong policy ends up with gas network failure, the power system will face serious problems. Moreover, after the implementation of the wrong policies, the crucial features of the system change, and it is usually impossible to reverse that. For example, the available capacity of gas reserves today may be different from 15 years later. The third feature is the need to provide agreement among various sections and market players while forcing the whole system to have the best performance [36]. In sophisticated systems, the profit of some players may influence the profit of other players. For instance, the market price should be determined in a way that encourages companies to invest in energy sectors and meet the welfare of consumers. It is the responsibility of the policymaker to consider the profits of all players in policy designing by using an appropriate tool like dynamic models.
In this paper, our main purpose is the development of a dynamic model to simulate the behavior of the coupled natural gas and electricity markets from the policymaker's point of view. Accordingly, we utilize the System Dynamic Approach to extend and complete the previous electricity market dynamic models by adding the gas market dynamic model. The natural gas demand is formulated in a new framework. Moreover, the Net Present Value (NPV) method is used for the economic evaluation of the investment in the development of gas refinery units. The important feedbacks of the gas markets, investment time delays, causal loop diagram of this market, stock and flow variables for the development of gas resources are introduced in this model. Such a model helps policymakers study the long-term sector coupling and answer the following questions. What is the mutual long-term effect of investment in renewable energy resources and gas prices? What is the impact of possible failures, economic or market shocks on the investment and prices in both systems and does the high penetration of renewable energy resources mitigate the side-effects of these shocks in both markets? How does the investment in the gas sector influence the investment in wind capacity and vice versa? What is the effect of wind technology incentive policies on the gas market?
The remainder of the paper is organized as follows: In Section 2 the general description of the model is introduced. Section 3 details the different parts of the proposed model. To illustrate the effectiveness of the proposed dynamic model, the simulation results are presented in Section 4. The sensitivity analysis is included in Section 5 and finally, Section 6 clarifies the conclusions and future extensions of the model.

Overview of the model
To achieve the dynamic model of the interactive electricity and natural gas markets, the main components of both systems are simulated by the system dynamics approach. Definitions and details of the main components of the dynamic systems have been described in [37].
One of the main components is the causal loop diagram of the system. The causal loop diagram of coordinated natural gas and electricity markets is depicted in Fig. 1. The part of the Figure with black arrows is related to the gas market and the other part with pink, blue, and green arrows represents the electricity market. Two red arrows depict the link of the gas market with the electricity market. Positive (negative) signs illustrate that by increasing the independent variable, the associated dependent variable will increase (decrease) [28]. In the causal loop diagram of economical systems, the positive loops reinforce changes in the system and the negative ones oppose these changes [37]. Seven balancing (negative) feedback loops are seen in this Figure. Loops one to four are described in [28]. We introduced the causal loop diagram of the natural gas market to complete the proposed model of [28]. Therefore, three new negative loops are added to the existed model. The fifth loop in Fig. 1 shows the price elasticity of natural gas demand. As the natural gas demand increases, its price rises; therefore, gas consumers will restrict their consumption due to the high gas price. The sixth loop illustrates the price elasticity of gas production. The more the gas price rises, the more the gas production will increase, and then this will lead to the reduction of gas price. The seventh loop is a negative loop that restricts investment in gas reserves development. By decreasing the expected profit of the companies in the gas market due to the low gas price, investment decisions decline. As a result, the proven and developed gas reserves reduce after a time delay. Then, there will be a shortage in the production of natural gas. Consequently, the shortage in gas production will increase the gas price and this will lead to an increase of expected profitability in a balancing loop. The natural gas resources that can be developed for production with high possibility are called proven gas reserves and developed gas reserves are the reserves that can be applied for production when required [34].
In order to supply the electricity demand, four kinds of technologies are used. These technologies are hard coal (HC), combined cycle gas turbine (CCGT), gas turbine (GT), as well as wind technology. The price of hard coal is constant during the time horizon (see Table 1) [28]. CCGTs and GTs consume natural gas for electricity generation. The price of natural gas is determined in the gas market. Both gas and electricity markets are assumed entirely competitive. Wind units take part in the market. Wind speed and the generation of wind units are considered as a random variable. Once wind units are available, they will supply the portion of the load. The difference between total load and wind generation (net consumption) is supplied by fossil fuel units [38]. We considered the time step equal to one week, and the time horizon equal to 30 years. The construction time for building new power generation units and the time needed for the development of proven gas reserves are the main time delays in this model. The crude oil market and the effect of its price on gas price, ancillary services markets, investment in pipelines and gas exploration, distribution costs, and the effects of transmission lines are neglected in this paper. Moreover, it is assumed that there is no import or export of electricity or gas, although it can be embedded in the demand part of the model.

Detailed description of model
The general framework for modeling the long-term behavior of electricity and gas markets is shown in Fig. 2. There are several blocks in this Figure and each one represents a component of the gas system (blue blocks) and electricity system (black blocks). Each block receives the input signals and provides output data as an input signal for other blocks. The market policymakers can investigate each output signal as the outcome of the problem. The performance of each block is described in the next sections. Wind units as the only renewable resource in this model participate in the market and if they are available, their output power is considered as the negative demand.

Electricity consumption
In this paper, generation and demand in the electricity market are cleared in each time step (one week). The weekly electricity load pattern during each year is depicted in Fig. 3. These coefficients can be obtained from the electricity demand data of the past years in the United States [39]. The time axis in this Figure begins from January and the peak load at the first year is 15 GW [28].
The amount of peak demand changes in later years based on the annual demand growth rate. We considered the mentioned rate as a random variable, and a Gaussian distribution function shows its feature. The standard deviation of the distribution function is 0.01 and its expected value is 0.012 [2]. Then, the electricity demand in each week is calculated by Eqs. (1) and (2) [3].
in which, ΔT is 52 weeks. Since we assumed that the electricity load (in MW) is fixed during the hours of each week. So, the weekly electricity consumption (in MWh) is equal to the product of electric power demand (in MW) and the hours of one week (168 h) [28]. Low or high prices can influence the consuming behavior of consumers. We considered that in the model through the following equation [3].

Natural gas demand
In this paper, the natural gas demand is comprised of domestic, industrial, and consumption for power generation. As depicted in Fig. 4, the weekly coefficients of total domestic and industrial consumption during each year are obtained from the gas consumption data of the previous years in the United States [40].
In order to adjust the gas demand profile with the electricity demand profile, the time axis in this Figure begins from January too. The peak of domestic and industrial gas demand changes each year proportional to the gas demand annual growth rate, which is assumed as a random variable. Therefore, a Gaussian distribution function can describe its behavior. The standard deviation and expected value of this function are 3.9% and 1.1%, respectively. These parameters can be achieved from historical data in the USA [40]. Then, the total domestic and industrial gas demand in each week is calculated similarly to the electricity demand through Eqs. (4) and (5) [3].   Fig. 4. weekly pattern of total domestic and industrial gas demand.
Then, domestic and industrial gas demand after price response is obtained similar to Eq. (3) by using forecasted domestic and industrial gas demand, the average of gas price in recent years, and the price elasticity of domestic and industrial gas demand. In [41], the price elasticity of domestic gas demand and industrial gas demand were considered equal to − 0.25 and − 0.4, respectively. For the sake of simplicity, in this paper, the price elasticity of domestic and industrial gas demand is assumed to equal − 0.33.
The amount of natural gas that is used for electric power generation by CCGT and GT units is calculated by Eq. (6) and then total natural gas consumption in week t is obtained from Eq. (7).
in which, GPCF is equal to 339.8 [5]. The ratio of residential gas demand to industrial gas demand in the winter days is 2.82 and the ratio of gas demand for power generation to industrial gas demand is 1.14 [41]. The gas consumption of CCGT and GT units to supply the electric load in the first time step (first week of January) can be calculated. Then, based on the mentioned ratios, the peak value of total domestic and industrial gas demand is obtained. This peak value is equal to 725.7 million m 3 .

Generation of conventional units
In this paper, three kinds of fossil fuel-based technologies are used to supply the net demand and for simplicity, the generation of nuclear power plants, hydroelectric units, etc. are neglected. To consider the competition among different technologies, we assumed that all of the units with an identical technology belong to one company [28]. The electricity generation of each technology depends on the capacity factor of that technology and the capacity factor in each time step is a function of marginal cost in that time step and electricity price in the previous time step. As the fossil fuel units become older, due to the reduction of efficiency, their variable costs rise. In order to distinguish between the efficiency of new units and old units, a vintage model is used. Therefore, conventional technologies contain three vintages with different efficiencies: new, middle-aged, and old units [42]. As shown in the following equation, the marginal cost of generation for technologies is achieved from Eq. (8) [2].
The capacity factor of each type of technology is achieved from market price, the marginal cost of that technology, and the supply curves of Fig. 5 [3]. Then, the total generated energy by each conventional technology is obtained from the capacity factor and the total installed capacity of that technology [28].

Wind technology generation
The generated power of wind turbines highly depends on wind velocity [28]. On the other hand, seasonal variations and local characteristics affect wind speed [43]. The Weibull distribution functions are useful tools for describing the features of wind speed in different areas [28]. Since we used the past data in the United State to obtain the electricity and gas demand coefficients, the historical data of wind speed in Texas [44] is gathered to adjust the wind speed and consumption profiles from the regional viewpoint. In this paper, twelve different Weibull distribution functions are obtained from the past year's data of wind speed for each month [45]. Then, by using the Monte Carlo technique and proposed methods of [28], random samples of weekly wind speed are produced. There is a difference between the height of the turbine hub (100 m) [46] and the height of installed wind speed measurement instruments (10 m) [44]. Therefore, the measured wind velocity should be modified by Eq. (9) [28].
In this paper, coefficients and technical data of Siemens SWT 108 2.3 turbines and Los Vientos Wind Farm in Texas are used [46]. The power curve of this kind of turbine is illustrated in Fig. 6 and its characteristics can be found in [47]. In Eq. (9) the value of H TC is 0.01 [46].
The capacity factor of the wind turbines in each time step is determined from the turbine's power curve and modified wind velocity [48,49]. Then, the output power of wind turbines is achieved from the capacity factor and total installed capacity of wind units.

Electricity and natural gas market equilibrium and dynamics
As the consumption of electricity exceeds its generation, the electricity price rises, and it decreases when generation exceeds the consumption. The electricity price in each time interval is determined by the following equations [3].
In Eq. (11), the value of Δt is one week. The gas price depends on total gas demand and the capability of the gas market for gas provision. The capacity of gas refinery units for gas Fig. 5. Supply curves for each technology [3]. Fig. 6. Power curve of wind turbines [47].
production and the stored gas in the storage system influence the gas provision capability of the market. The gas price increases as the gas demand becomes more than the capability of the gas market for gas provision while the opposite happens if the capability of the gas market for gas provision exceeds the demand. Based on Eq. (12), the changes in natural gas price are determined in time step t, and as shown in Eq. (13), the natural gas price at week t + 1 is determined from the price changes and the price of natural gas in week t.

Electricity and natural gas price expectation
The generation utilities and companies need to predict future prices accurately to invest successfully. We utilized the trend extrapolation of variables and the exponential smoothing forecast method for the price expectations in both electricity and gas markets [37].

Capacity investment in electricity market
The economic assessment of the investment in electricity generation capacity is conducted through the NPV method [3]. The expected future price of the electricity market that was calculated in the previous section and the marginal cost are the main input signals of this simulation block. On the other hand, the rate of investment in electricity generation units is the main output signal of this block.

Investment in natural gas market development
Similar to the electricity market, for the economic evaluation of the gas reserves development in the gas market, the NPV method that is introduced in [3] is applied. Through this method, cash flows in different years of the project are transferred to a reference time and the profit of the gas reserves development is determined by Eq. (14).
The value of investment cost is fixed and it is depicted in Table 2. The maintenance cost depends on the age of the unit, each year. Therefore, an average value is considered in this study. Regarding the development of gas reserves, the amount of maintenance cost is almost 15% of the investment cost [50]. Based on Eq. (15), the expected profit of refinery units for gas production is calculated from the expected gas price and gas production marginal cost.
In this equation, T P is one year. The marginal cost curve of gas production is depicted in Fig. 7 [41]. As shown in this Figure marginal cost of gas production depends on the ratio of gas production to the capacity of refinery units for gas production. It is assumed that gas production is equal to demand in each time step.
To calculate the investment rate of return (IRR G ), we should substitute Eq. (15) in (14) and solve the PROF G = 0 for D rate [3]. Then, the investment rate in the gas market is calculated from Eqs. (16) to (20).
In Eq. (16), the value of D rate is 9 %/year [3]. The retired rate of developed gas reserves shows the depletion of gas wells and the retirement of refinery units. SCL G , β G , and γ G are the constant parameters that should satisfy the condition of Eq. (21) [42].
Due to the lower possibility of over-reaction or severe investment in gas development facilities, in this paper, the saturation level for these facilities is set approximately low, similar to the HC units. This is because, permitting processes of these units before construction is long, and based on the behavior of competitors and market conditions; the investment decisions of companies can be modified. Moreover, investment in this area is done by well-experienced firms that are aware of the behavior of competitors and do not have herding behavior. Also, high investment costs and the long construction time of gas development facilities prevent even big firms from involving in several projects simultaneously [42]. Therefore, by considering the value of 1.5 for SCL G , the values equal to 3.5 and − 2.8069 for β G and γ G , satisfy the condition of Eq. (21) [3].

Electricity generation capacity development
Stock variables show the state variables of the system and various delays are created by accumulating the difference between inflow and outflow of a process in the related stock variable. In our model, the main time delays depend on the construction duration. Eq. (22) shows the relationship between stock and flow variables [28].

Table 2
The natural gas system characteristics.
Investment cost (1000$/million m 3 ) [34] 70 Maintenance cost (1000$/million m 3 ) 10 Gas well lifetime (years) [35] 25 Time needed for development of gas reserves (years) [52] 3 Amortization period (year) [53] 25 − out flow(s)).ds (22) In this paper, the under-construction capacity and installed capacity are stock variables. Fig. 8 depicts the stock and flow diagram of capacity development of electricity generation. In this Figure, the investment rate is inflow, and the construction accomplishing rate of technology is the outflow variable of under-construction capacity. In addition, the construction accomplishing rate is inflow and the retired capacity rate is the outflow variable of installed capacity. Using the investment rate, that was determined in Section 3.7, The installed capacities of technologies are obtained [28].

Natural gas refinery development
In this study, it is assumed that the gas reserves in the undiscovered gas fields are very large that will not be exhausted and influenced by the end of the planning horizon. The investments and activities related to the exploration of unknown gas fields are neglected, and companies invest only in facilities for the development of proven gas reserves. The proven gas reserves and capacity of refinery units (developed reserves) for gas production are stock variables. As the amount of investment rate increases, after a time delay, more capacity will be developed for gas production. Fig. 9 shows the stock and flow diagram for the development of gas refinery units. Based on this Figure, the investment rate is inflow, and the development rate of proven gas reserves is the outflow variable of proven gas reserves. On the other hand, the development rate of proven gas reserves is inflow and the retired rate of developed gas reserves is the outflow variable of installed gas production capacity (developed reserves). The mathematical relation between these variables can be stated through the following equations.

Natural gas storage facilities
Unlike electricity, natural gas can be stored in large quantities for consumption during scarcity events. The gas storage capacity of great gas producers such as the United States, Russia, Canada, China, and Iran is almost 19%, 11%, 14%, 4%, and 1% of their production capacity, respectively [51]. Gas storage capacity influences the load profile and gas price. Additionally, it can be used in critical situations. The behavior of gas storage facilities can be explained through the stock and flow diagram. In this paper, the capacity of storage facilities is fixed and equal to 19% of the production capacity in the first step (168 million m 3 ) and the amount of gas that is stored in these facilities is considered as a stock variable. Moreover, the amount of gas that is injected into these facilities in each time step is the inflow variable, and the amount of gas that is extracted from these facilities in each time step is the outflow variable. It is assumed that these facilities are filled when the gas demand is lower than the maximum capacity of developed reserves and they are depleted in the opposite condition. The following equations illustrate the relation of these variables.
The filling process of the storage facilities continues until reaching the maximum capacity of the reservoir.

Analysis of simulation results
The main forte of this paper is introducing a generic framework that can be used for other real case studies. In other words, by substituting the data of other wind farms and their related wind speed features, the data of other conventional electricity generation technologies and gas production facilities, and another electricity and gas demand data in the proposed model, the long term behavior of coupled gas and electricity market is achieved. In this section, the case study of [3] is used to assess the presented model and study the behavior of the coordinated markets from the policymaker's perspective. Since we tend to consider the regional and seasonal correlation in this paper, technical and wind speed data in Los Vientos Wind Farm in Texas, gas, and electricity demand coefficients in the USA are utilized along with other data of case study of [3]. The features of the electric power system and gas system are illustrated in Tables 1 and 2, respectively. In addition, MATLAB software is used for simulations.
The coefficients in the system dynamics approach play an important role in determining the results. For instance, by decreasing the amount of discount rate, the investment in markets will intensify, while increasing the amortization period encourages companies to the investment. Moreover, as the investment cost of a specific type of unit declines, the investment in that type of unit rises. The effect of these coefficients on simulation results is discussed in detail in [28]. In this paper, since we extended the proposed model of previous electricity markets by adding the model of the gas market behavior to study sector coupling, therefore we will discuss the related coefficients of the gas market in the sensitivity analysis section.
In order to simulate and analyze the electricity and gas market's behavior under various conditions, four different cases are introduced as follows. These cases provide a comparing opportunity from the market regulator's perspective.
1. There is no incentive for wind units. 2. The fixed payments are paid to wind units in case one.
3. An unusual shock happens in the gas system of case 2 in week 989. 4. The same unusual shock happens in the gas system of case 2 in week 1122. Fig. 8. The stock and flow diagram in the electricity market.
Case 1: Fig. 10A demonstrates the average electricity price in each week. High prices emerge when the electric power consumption exceeds its generation, and in reverse situations, the electricity price decreases. Fig. 10B shows the installed conventional capacity, reserve margin, and weekly electricity demand. The reserve margin in each time step is the difference between the installed capacity of conventional units and net demand. The price response of demand and its growth rate are major reasons for the fluctuations of electricity load. Fig. 10C shows the installed capacities. As shown in Fig. 10A and B, when the reserve margin decreases, the electricity price rises. As the electricity price increases due to the lack of generation capacity, the investment rate of electric generation technologies rises and after a time delay resulting from the construction time, new capacity is added. Based on Fig. 10C, since the investment cost and emission of HCs are high, the investment in these units has a falling trend, which is lower than those of CCGTs and GTs are. The long-time boom and bust cycles are the result of over and under-investment. These cycles are seen as peaks and valleys in Fig. 10C. The different construction times, gas price, the lifetime of units, incentive policies, and different retired rates of units are the main reasons for these over and under-investments. Since wind technology is expensive, the investment rate of these units was comparatively low in this case. Therefore, to motivate the investors to invest in this generation technology, an incentive policy is required. Fig. 11 illustrates the capacity factor of wind units and their average in each week of the year. The time axis of this Figure begins with the first week of January. The historical data related to the capacity factor of the Los Vientos wind farm reveals that the capacity factor varied approximately between 0.2 and 0.6 [46]. These data confirm the findings of this paper. Fig. 12A shows the average weekly gas price in case 1, and Fig. 12B shows the capacity of refinery units and gas demand for different sections. When the capacity of refinery units exceeds the total gas demand, the gas price decreases and it rises as the total gas demand becomes more than the capacity of refinery units. The total gas demand changes due to the consumption growth rate and the price response. Based on Fig. 12A and B, during the shortage of natural gas, its price increases, and this will lead to investment in gas refinery facilities after a time delay. Based on Fig. 10C and A, not only does the electricity price influence the investment in CCGT units but also gas price can affect that. The falling trend of the gas price at the end of the time horizon accelerates the investment in CCGT units. This is because lower gas prices cause the lower marginal cost of electric generation for these units and this leads to the achievement of higher profit for them. Therefore, they rush for the investment. Although investment in GT units depends on gas price too, companies invest in these units just during the high electricity prices and scarcity events. Fig. 12C illustrates the amount of gas in storage facilities. The stored gas is used during gas shortages.
Case 2: In case 2, wind units receive an incentive equal to 20 $/MWh in each time step. We assumed that the value of this incentive do not change during the time horizon. Fig. 13A shows the average electricity price in each time step in case 2. The average electricity price (in 30 years) decreased from 33.36 $/MWh in the previous case to 33.09 $/MWh in this case. This is because of the conventional capacity reduction and the rise of wind capacity in this case in comparison to the previous case and the lower marginal production cost of wind units compared to the conventional units. Fig. 13B shows the installed conventional capacity, reserve margin, and weekly electricity consumption. Fig. 13C shows the installed capacity of different technologies. The investment rate of wind technology increases due to the incentive.  Fig. 10. behavior of the electricity market in case 1. Fig. 11. Capacity factor of wind units in case 1.
Accordingly, the amount of installed wind capacity increases, and the amount of installed conventional capacity decreases in this case compared to case 1. Fig. 14A represents the weekly gas price in case 2, and Fig. 14B illustrates the capacity of refinery units and gas demand for different sections. Due to the more installed wind capacity in this case, the installed capacity of GTs and CCGTs declines compared to case 1. As a result, gas consumption for power generation purposes in case 2 is lower than in case 1. Accordingly, the average gas price decreased from 25.27 in the previous case to 24.56 in this case. On the other hand, because of the intermittent behavior of wind units, the supporting role of gas-fired units increases in case 2. Therefore, the standard deviation of gas price increased from 2.55 in the previous case to 2.61 in this case.
In order to get a better picture for comparing cases 1 and 2, installed wind capacity, installed capacity of GTs and CCGTs, gas demand for power generation, and capacity of refinery units in these cases are depicted in Fig. 15A, B, C, and D, respectively. As shown in these Figures, by considering an incentive in case 2, the penetration of wind units, in this case, was more than in case 1, while the opposite happened for conventional capacity. Therefore, the gas demand for power generation during the time horizon, in this case (569,233 million m 3 ), becomes lower than case 1 (573,945 million m 3 ). This is because, in case 2, more electricity demand is met by wind farms once they generate power. Based on Fig. 15B and D, there is a relation between boom and bust cycles in the electricity market and gas market. When there are severe boom and bust cycles in the electricity market, the same happens in the   gas market, and when these cycles in the electricity market are moderate, the investment wave of refinery capacity is moderate.
The lack of investment in the natural gas market can cause severe problems in both electricity and gas markets and this will become worse when part of the existing gas production facilities are destroyed due to unusual accidents or natural disasters. For instance, about 20-25% of the U.S. daily gas production was lost due to Hurricane Katrina, in 2005 [54]. This hurricane formed in the Gulf of Mexico on August 23 and lasted for almost one week [55]. In order to study the effect of an unusual outage of gas production capacity on electricity and gas market behavior, case 3 was introduced. In this case, it was assumed that 25% of the total gas production capacity of case 2 was lost due to a hypothetical disaster on a winter day (the worst case for the gas system), in week 989 of the time horizon.
Case 3: Fig. 16A shows the average electricity price in each time step in case 3. As shown in this Figure, a sudden shock in the gas system in week 989 cannot have a significant effect on electricity prices. This is because electricity demand does not peak this week. Moreover, as shown in Fig. 17C, a portion of gas scarcity (almost 90 million m 3 ) is supplied by stored gas in storage facilities. Fig. 16B shows the installed conventional capacity, reserve margin, and weekly electricity consumption. Fig. 16C shows the installed capacity of various technologies. Fig. 17A represents the weekly gas price in case 3, and Fig. 17B shows the capacity of refinery units and gas demand for different sections. About 25% of gas production is lost due to the sudden disaster in the gas market in week 989, therefore the gas price jumps to almost 28,500 $/million m 3 . Based on Figs. 16C and 17B, although the shock in the gas system does not have any tangible effect on the investment in electric power generation units, investment in gas development facilities increases rapidly and after a few months, a high amount of refinery units is added to the system due to the lack of capacity. As a result, a few years after the price shock, the falling trend of gas prices emerges. Increasing the standard deviation of gas price in case 2 from 2.61 (1000$/million m 3 ) to 3.09 (1000$/million m 3 ) in case 3 shows the effect of price shock on gas price fluctuations. The price shock in week 989 is the worst case for the gas system but its effect on the electricity market is not considerable. In case 4, it is assumed that the gas system of case 2 is burdened by an unusual shock in week 1122 when electricity demand reaches almost its peak value and there is scarcity in electricity generation capacity.
Case 4: Fig. 18A shows the weekly electricity price in case 4. The gas price shock affects the marginal cost of electricity generation. Due to the gas production shock in week 1122 and shortage of electricity generation capacity in this week, electricity price increases despite high amounts of stored gas in gas storage facilities. Fig. 18B shows the installed conventional capacity, reserve margin, and weekly electricity consumption. Fig. 18C shows the installed capacity of various technologies. During the high electricity prices, companies invest in electricity generation capacity to achieve higher profits, and a few years after the gas production shock; new electricity generation capacity is added. The lower prices in the final years are the result of this over-investment. Fig. 19 A shows the gas price in case 4. The gas price jump resulting  from production shock is seen clearly. Fig. 19B illustrates the capacity of refinery units and gas demand for different sections, and Fig. 19C shows the amount of gas in storage facilities. Although when the production shock happens, the gas storage is full, there are price jumps similar to case 3.

Sensitivity analysis
To investigate the long-term effect of the penetration of wind units on coupled electricity and gas market, the sensitivity analysis is implemented. In this regard, case 2 was used and four values equal to 0, 10, 20, and 30 $/MWh were selected for the wind capacity incentive. Fig. 20 compares the results of the consideration of different payments for wind units and Table 3 provides useful data in this regard. Fig. 20A illustrates the installed wind capacity due to the different values of wind incentive. As the amount of incentive increases, the amount of installed wind capacity rises. Fig. 20B shows the average electricity price in the recent year in each time step. By increasing the penetration of wind units, the electricity price decreases. This is because the generation marginal cost of wind units is zero. The average gas price in the recent year in each time step and gas demand for electric generation are depicted in Fig. 20C and D, respectively. The utilization of wind units for energy production declines the gas consumption in the electric sector especially at the end of the time horizon and this, in turn, will lead to lower gas prices and CO 2 emission. On the other hand, high penetration of wind technology increases the standard deviation of gas prices due to the random features of wind speed. Fig. 21 illustrates the sensitivity of the electricity price and gas price to the wind capacity penetration during a sudden shock in the gas market. In this analysis, case 3 was used. It was assumed that there was an outage equal to 25% of total gas production in week 989. Although there were no remarkable changes in the electricity price, the gas price changes due to the shock were considerable. As the penetration of renewable energy resources increases, the severity of the gas price jumps decreases. It is worth mentioning that the high penetration of wind technology intensifies the electricity price fluctuations. Since the stochastic behavior of the wind units is supported by GTs and CCGTs. Therefore, the gas consumption of these units will fluctuate and these fluctuations are transferred to the gas price.
The effect of sudden gas market shock on the electricity market highly depends on the time of happening. This is because the condition of gas storage systems, gas production and electricity generation capacity, penetration of renewable energy resources, gas and electricity demand, which are determinant factors in this regard, vary during the time horizon. Although in week 989, gas demand is at its peak and the storage system is not completely full, there is no capacity scarcity in the electricity market and electricity demand is not at its peak. Therefore, the effect of shock on electricity price is negligible in contrast to its effect on gas price. Fig. 22 illustrates the sensitivity of the electricity price and gas price to the wind capacity penetration during the same shock in the gas market in week 1122. In this time step, there is capacity scarcity in the electricity market and electricity demand is at its peak, on the other hand, gas demand is not at its peak, and the storage system is full. As shown in this Figure, the jump of gas price in week 1122 leads to an electricity price jump, and as the percentage of wind capacity increases the electricity price jumps less.
The features of the S-shaped function that was introduced in Eq. (19) highly depend on coefficients SCL G , β G , and γ G . Therefore, the effect of the S-shaped function and the related coefficients on simulation results should be investigated. In this part, the sensitivity of the installed Fig. 17. behavior of the gas market in case 3. Fig. 18. behavior of the electricity market in case 4.
capacity of the refinery units to the S-shaped function was studied. By choosing the values of SCL G and β G , the value of γ G is determined from the condition of Eq. (21). Table 4 depicts corresponding coefficients that create different S-shaped functions and Fig. 23 shows these functions. Fig. 24 shows the sensitivity analysis of the capacity of refinery units to S-shaped functions. The first case was used to reach this analysis. Based on this Figure, the simulation results highly depend on the characteristics of this function. Considering the first three S-shaped functions, for fixed values of γ G , as the amount of SCL G increases the installed capacity of the refinery units increases. In contrast, there is not any specific pattern between other functions and the installed capacity of the refinery units. However, since we used the third function in simulations of previous sections, the general aspects of the simulations are valid.

Conclusions
The main goal of this paper is to study the long-term interaction of electricity and gas markets under the different levels of incentive policies for wind technology. In this way, the long-term effect of penetration of renewable energy resources on the gas and electricity prices, gas production and electricity generation, gas and electricity demand can be analyzed. For this purpose, a dynamic model was used to model the behavior of the natural gas market and extend the previous dynamic models of the electricity market to study the energy sector coupling. Three negative loops, which illustrate the dynamic performance of the gas market, were included in the previous causal loop diagram of the electricity market, and the interaction of two markets was shown in this diagram. The NPV method was used to assess the investments in gas reserves development from an economical perspective. Stock and flow variables for gas reserves development and the related time delays were modeled. The effect of the implementation of incentive policies for the development of wind capacity was studied in both natural gas and electricity markets. Furthermore, the influence of an abnormal shock in the gas market on the behaviors of the electricity and gas markets was   investigated. Then, the effect of penetration of wind technology in balancing the side-effects of the mentioned shock on both markets was evaluated. The proposed model of this paper is a beneficial instrument for market policymakers and helps them investigate the policy implications on gas and electricity markets. The behavior of gas and electricity markets was simulated under four different scenarios using a valid case study. In this case study, the regional and seasonal correlation of wind speed data, electricity demand profile, and gas demand profile was considered. The results of these simulations and sensitivity analysis show that the utilization of wind technology in the electricity market had a remarkable effect on gas demand and consequently on the gas market. By expanding the installed wind capacity, although the electricity and gas prices decreased, their fluctuations increased. Furthermore, the devastating effects of the gas market's sudden shocks on both electricity and gas markets can be mitigated through higher investment in renewable energy resources.
In the presented model, the possible effect of electric vehicle deployment and load management programs on the electricity and natural gas networks was ignored. Moreover, one of the main shortcomings of this model is using the limited types of generation technologies. The existence of nuclear, small-scale photovoltaic panels with storage systems, and hydropower plants can affect the electricity price, gas price, and accordingly, the result of simulations. In future researches, these factors can be included in the proposed dynamic model to study the effect of these issues and measures on the electricity and gas market behavior. In addition, the behavior of the natural gas market highly depends on external factors such as the global price of crude oil.
To reach a precise model, the crude oil market can be included in future models. Furthermore, the long-term effect of trading mechanisms in coupled markets, which are formed based on the combination of blockchain and distributed optimization to prevent market failure can be studied in future works.     Table 4.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.