Exploring Parallel Layers Commodities Energy Systems

download Exploring Parallel Layers Commodities Energy Systems

of 15

Transcript of Exploring Parallel Layers Commodities Energy Systems

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    1/15

    ENERGY ECONOMICS AND POLICY FS 11

    Exploring parallel layers of commodities in energy systems

    MARIA KANINIA

    June 9, 2011

    WORKING DRAFT

    Abstract

    Within the energy system, the natural gas and electricity markets can both be represented as grid-

    bound networks. We can imagine these networks as horizontal network topologies. Because of the

    interactions between the markets for natural gas and electricity, the networks are linked via several

    vertical interconnections between interface points (energy hubs). An interesting characteristic of both

    markets is that they are liable to congestion due to the limited capacity of the respective transmission

    networks. Also, price variations in one market may have effects on a linked market. Understanding the

    cross-effects between the networks is important for efficient planning of future expansion of the network

    infrastructure.

    Thus, the first target of this paper is to explore these cross-effects, using a static version of the linkedmodels. The second target is to implement a dynamic version of the model (taking into consideration

    new investment in infrastructure expansion) and observe how the investment decisions are influenced by

    congestion and cross-network linkages.

    This paper uses a simplified partial-equilibrium model involving the natural gas and electricity sec-

    tors of the energy system on a European-wide scale to explore several cases, including disruption of

    natural gas supply (e.g. because of geopolitical reasons, as occurred in January 2009) and effects of

    environmental policies (e.g. increases in the price of allowances for carbon dioxide emissions, a cap on

    emissions or a combination thereof, emulating the EU Emissions Trading System).

    Keywords: network, energy hub, natural gas, electricity

    1

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    2/15

    1 Introduction

    The interaction between the markets for different energy carriers (such as natural gas and electricity) is

    complicated and occurs at several interface points.

    Taking the example that is analysed here: In the electricity supply chain, natural gas is located upstream

    of electricity, since it can be used as fuel for electricity generation. However, it is also encountered down-

    stream, in the sense that these energy carriers are substitutes, competing to cover final energy demand (e.g.

    for heat production). The degree of substitution that can be achieved depends on the sector (industrial,

    residential, commercial or transportation) and the time scale. The interface point is depicted in 1.

    Figure 1: Representation of an energy hub with natural gas and electricity as inputs.

    Why is it pertinent to investigate the linkage between the networks of these commodities?

    First, in European countries, the share of natural gas as fuel for electricity production ranges from rather

    low (e.g. in Germany, for the year 2008, the percentage of electricity production from natural gas was

    13.8% and in France only 3.8%) to significant (e.g. 54.1% in Italy and 38.8% in Spain for the same year,

    [10]). However, even in countries with low usage of natural gas in the electricity generation mix, naturalgas fueled plants are typically used for mid and peak load (especially through combined cycle gas turbines).

    These plants are often marginal in terms of merit order (see figure 3). So their marginal cost (fuel price)

    affects the electricity market price.

    Figure 2 shows an example of the correlation between prices for the two commodities.

    Inversely, the percentage of the Total Primary Energy Supply of natural gas that is used as fuel for

    electricity production is substantial (31.9% for EU-27, year 2008, source: [7]). Thus, developments in the

    electricity sector will also reflect upon the natural gas market.

    The mathematical description of the static version of the partial-equilibrium model which is used to

    examine these interactions has been adapted from [3]. First, each market is modeled independently, taking

    into consideration the relevant agents which act in each market. Then, additional relationships are introduced

    to show the linkage between the networks.There exist common characteristics in the representation of both commodity markets, such as the be-

    haviour of producers (who attempt to maximise their profit subject to their limited production capacity)

    and of consumers. Consumers are governed by their linear demand function (calibrated based on reference

    values (PD, QD) and an assumed global elasticity , according to equation 1). Furthermore, each market ismanaged by a single operator who is assumed to be responsible for clearing the market; the operator also

    determines investments for capacity expansion in the case of the dynamic model.

    QD = QD

    1

    PD

    PD 1

    = QD(1 + )

    a

    QD

    PD

    b: slope

    P (1)

    1

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    3/15

    Figure 2: Scatter plot for monthly prices of electricity vs natural gas. The value of the correlation (0.49) is

    lower than expected because the data series refer to different areas (due to unavailability of data). Sources:

    PowerNext gas futures monthly index, NordPoolSpot Elspot system price.

    2 Electricity model

    The electricity model assumes a single artificial node (denoted as e E) per area market, or UCTE controlarea. It is also assumed that there exists a single connection between physically connected neighbors. This

    means that all cross-border lines are aggregated as a (bi-directional) lump Transmission Capacity. These

    transmission links are denoted as lij = (ei, ej) E E.The country-nodes are characterised by their production portfolio and their electricity demand. It is

    assumed that all generators and producers interact through a single network operator in a competitive market.

    The model takes into account physical flows (as opposed to commercial exchanges) along transmission

    lines. The physical power flows are determined by the power supply and extraction at production and

    consumption nodes, respectively, as well as by the technical characteristics of the network (topology, as

    indicated by the admittance matrix, and line capacities).

    Power flows can be calculated according to the simplified lossless DC method, which states that the

    active power flow in line (i, j) is given by the relationship Pij =i j

    xi,j, where i is the voltage angle at

    node (bus) i and xi,j the reactance of the line. In matrix form it can be expressed as:

    P = B (2)

    where P = [P1 . . . P i . . . P N] is the vector of net injections, B is the nodal admittance matrix of di-

    mensions N N (considering only the reactance values) and = [1 . . . i . . . N] is the vector of voltageangles ([4]).

    Based on the DC power flow model, a set of PTDF1 values is derived, according to the following

    1The Power Transmission Distribution Factor value PTDF(e, ei, ej) for node e and line lij = (ei, ej) expresses the powerflow that would occur on line ei ej if 1 MW was injected at node e, given an initial state of the network. It basically corresponds

    2

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    4/15

    Figure 3: Typical merit order for electricity generation plants.

    GENERATION CONSUMPTIONtransmission

    TSO

    Figure 4: Aggregated agents in the electricity market model

    formula, where Xm,n is an element of the reactance matrix:

    PTDF(li,j, e) =Xi,0 Xj,0 (Xi,e Xj,e)

    xi,j(3)

    Subsequently, it is assumed that an imaginary central hub (denoted with 0 in the equation above) con-nects all the nodes (see Figure 5). So, exports and imports Y(e) (commercial exchanges) are routed fromnode e through the virtual hub (along virtual links with infinite capacity originating at the hub). The pre-

    calculated PTDF values are used to find the (physical) flows F(l) which are induced along the actual lines lbecause of the commercial flow Y(e):

    F(l) = PTDF(l, e)Y(e) (4)

    node #1 node #i node #N

    prod_1

    VIRTUAL HUB

    cons_1 prod_icons_i prod_Ncons_N

    Figure 5: Model based on single virtual hub for handling cross-border transmission.

    to the derivative (sensitivity) of the line flow for line l with respect to a change in injection at node e.

    3

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    5/15

    Table 1: Agents in the electricity model

    agents objective

    producers maxXel(e,i)

    i

    P Tel(e) + PHUB

    f

    pfuel(f) + (f)pemi

    (f, i)

    transmission system operator maxY(e)

    e P T

    el(e)Y(e)

    final consumers [satisfy final demand]

    The electricity price as perceived by a final consumer at node e comprises two components: The price

    for energy, which is unique and determined as the shadow value of the market clearing equation at the virtual

    hub for the entire network, and the transmission fee P Tel

    (e) from the hub to node e, which can be positiveor negative. A linear demand curve is assumed:

    DEMel(e) = ael(e) + bel(e)(P Tel(e) + PHUB total nodal price:Pel(e)

    ) DEMel(e) 0 (5)

    At each node e, the power producers maximise their profit subject to the available capacity constraint

    by plant type (technology) i, given the exogenously determined prices for fuel pfuel(f) and emission al-lowances pemi, the efficiency (or, inversely, the heat rate) for each technology (f, i) and the emissioncoefficients (f).

    f

    pfuel(f) + (f)pemi

    (f, i) + P Cel

    (e, i) P Tele + PHUB X

    el

    (i, e) production

    0 (6)

    capel(e, i) Xel(e, i) P Cel(e, i) scarcity price of production capacity

    0 (7)

    The market clearing condition is:

    (e,i):capel(e,i)>0

    Xel(e, i) e

    DEMel(e) PHUB commodity price at virtual hub

    0 (8)

    The equilibrium at each node requires that the energy Y(e) exported (or imported) from (to) a certainnode equals the difference between the local generation and demand:

    Y(e) =i

    Xel(e, i) DEMel(e) P Tel(e) (9)

    The optimisation problem for the network operator is to maximise his revenue (making the assumption

    that the network operating costs are zero), given the available line capacities.

    There are two symmetrical constraints (only one of which can be activated) regarding the bi-directional

    transmission line capacities:

    ePTDF(l, e)Y(e)

    physical flow on line l

    capline(l) P C+(l) (10)

    4

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    6/15

    e PTDF(l, e)Y(e) capline

    (l) P C

    (l) (11)

    The shadow prices of transmission constraints P C+(l) and P C(l) serve as indicators for future ca-pacity expansion.

    The zero-profit condition of the transmission system operator is:

    P Tel(e) =l

    PTDF(l, e)(P C+(l) P C(l)) Y(e) e E (12)

    2.1 Data

    For experimentation purposes, a simplified UCTE power system model is used, based on [12]. It consists of

    20 nodes, each corresponding to an aggregated control area or country, and depicts cross-border transmissionlines. The sparse matrix showing the transmission links corresponding to the 20-node network is shown in

    figure 7. The cross-border transmission capacities for the 20-node interconnected system are given by the

    Indicative values for Net Transfer Capacities (NTC) in Europe ([6]).

    The demand data for each aggregated area (node) is provided from [ 1]. For the static version of the

    model, an indicative average load value (for the hour 12:00 in July 2010) has been used (as a simplification,

    instead of representing the load duration curve using load segments). The drawback of this simplified

    approach is that it is not possible to capture the effect of intermittent power input and of fluctuating demand.

    The portfolio of generating capacity for each node is based on data by ENTSOE ([2]).

    In terms of natural gas supply, each electricity node can be supplied from at least one gas trading node

    (as indicated by the mapping function GE(g, e)).

    Figure 6: Simplified interconnected system for electricity transmission with 20 nodes, source: [12].

    5

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    7/15

    Figure 7: The elements of the sparse matrix corresponds to the lines in the interconnected system shown in

    figure [6].

    3 Natural gas model

    The natural gas market is described as a set of nodes g G which are linked through pipelines. Theflow of natural gas in the pipelines Fpipe(g, h) is unidirectional from node g to node h (determined by

    compressors) and constrained by the available capacity cappipe

    (g, h). We assume that there is a singleindependent network operator that controls the entire network.In terms of economic behaviour, the model is defined by the individual optimisation problem for each

    agent (see table 3) and the market-clearing equations.

    Traders

    Pipeline Network Operator

    PROD_1

    PROD_m

    PROD_M

    Producers

    CONS_1

    CONS_n

    CONS_N

    Consumers

    Figure 8: Schematic of the agents taken into account for the natural gas model

    Producers (assuming a single producer per node) aim at maximising their profits by selecting to extract

    6

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    8/15

    Table 2: Agents in the natural gas model

    agents objective

    producers maxXgas(g)(P Sgas(g) cgas(g))Xgas(g)

    pipeline operator maxFpipe(g,h)

    g,h(P T

    pipe(g, h) cpipe(g, h))Fpipe(g, h)

    traders [maximise profit]

    final consumers [satisfy final demand]

    quantity Xgas(g) under constraint of the available extraction capacity:

    P Cgas

    (g) scarcity price for production

    P Sgas

    (g) supply price

    cgas

    (g) Xgas

    (g) g Gprod G (13)

    capgas(g) Xgas(g) P Cgas(g) 0 (14)

    The pipeline operator maximises his profit, restricted by the existing pipeline capacity:

    P Cpipe(g, h) P Tpipe(g, h) transportation price

    cpipe(g, h) Fpipe(g, h) 0 (15)

    cappipe(g, h) Fpipe(g, h) P Cpipe(g, h) 0 (16)

    The final demand at each consumption node is expressed by a linear demand curve:

    DEMgas(g) = agas(g) + bgas(g)P Dgas(g) DEMgas(g) 0 g Gcons G (17)

    Final consumers are served by traders, which must provide the demanded quantity (procured at pro-

    duction nodes). The market-clearing condition for each (consumption) demand node (where Tgas(h, g)corresponds to a trade flow and not to a physical flow) is:

    h

    Tgas(h, g) traded quantity, delivery at node g

    DEMgas(g) P Dgas(g) 0 g Gcons G (18)

    The traders are supplied with gas from the producers and subsequently transfer the demanded quantities

    to the consumers through the pipelines. The transportation service from node g to node h is priced atP Tpipe(g, h) (payable to the single pipeline network operator). The property of flow conservation mustapply for each node:

    g

    Fgas(gg,g,h) + Tbuy(gg)gg=h

    =g

    Fgas(gg,h,g) + Tgas(gg,h) P Ngas(gg,h) (gg,h)

    (19)

    The physical flow along each pipeline segment (constrained according to 16) is given by:

    Fpipe(g, h) gg

    Fgas(gg,g,h) (20)

    Based on this model of the network, the price P Ngas(gg,h) of natural gas (expressed as the shadowprice of the flow conservation equation 19) is different at each node h (nodal pricing). Also, at the same

    7

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    9/15

    node, there are different prices for different qualities of natural gas (depending on the production node gg).

    However, these price differences are absorbed, so that the final consumer perceives price homogeneity.In addition to the agents described here, a realistic model should also include storage nodes and LNG

    liquefaction and regasification nodes ([5]). Because we assume that no storage capacity is available, seasonal

    demand fluctuations are ignored (average hourly quantities referring to a certain year in GWh/h are used

    instead).

    3.1 Data

    The natural gas network is represented as a graph. For simplicity, the actual network has been condensed

    into a 3x3 network, following [9]. Production nodes outside continental Europe are only taken into account

    as sources of supply, but their inland consumption is ignored. The incidence matrix describing the test

    network is shown in table 3.1.

    Table 3: Incidence matrix for the natural gas model

    RUS NOR ALG GER FRA ITA

    RUS 1NOR 1 1ALG 1 1

    GER 1 1FRA

    ITA 1

    The model for the natural gas market will be expanded to include a realistic representation of the network

    ([11]) as well as LNG trading.

    4 Interconnection between the natural gas and electricity models

    In order to express the linkage between the two energy carrier networks, the following changes are applied:

    In the natural gas network, the demand becomes endogenous. Thus, equation [18] is modified todivide natural gas demand into two parts: The demand from power producers and other demand (e.g.

    from the residential or industrial sector).

    h

    Tgas(h, g)

    e:GE(g,e)

    Xel(e, NGS)

    (f = NGS, i = NGS) demand from power plants

    + DEMgas(g) demand from other sectors

    P Dgas(g) 0

    (21)

    In the electricity network, the price of natural gas as a fuel for electricity production becomes endoge-nous. For nodes with production capacity from natural gas plants, the following modified equation

    (which replaces [6]) must hold true:

    g:GE(g,e)

    P Dgas(g) + (i = NGS)pemi

    (f = NGS, i = NGS)+P Cel(e) P Tel(e)+PHUB Xel(e, i = NGS) 0

    (22)

    8

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    10/15

    For power plants that are not fueled with natural gas (i = NGS), the price of the respective fuel

    remains an exogenous variable (equation [6]).

    5 Model

    The model has been formulated as a Linear Mixed Complementarity Problem in the GAMS modeling sys-

    tem. It is solved numerically using the Newton-based PATH solver ([8]).

    5.1 MCP

    Formally, the Mixed Complementarity Problem is defined as:

    find x

    D subject to

    F(

    x)

    , y

    x 0

    ,

    y {

    x

    n

    |l

    x

    u

    }(23)

    Ifl = and u = + then problem [23] becomes a nonlinear equations system:

    F(x) = 0, x n

    Ifl = 0 and u = + then problem [23] is equivalent to a nonlinear complementarity problem:

    F(x) 0 x 0

    The equations used to describe the natural gas and electricity markets for this model were derived from

    the Karush-Kuhn-Tucker (first-order optimality) conditions of the optimisation problems faced by each

    agent. For each profit maximisation problem, the complementary variable represents an activity output

    or flow (e.g. quantity of energy commodity that is produced, traded or transported). For each clearing

    equation, the corresponding variable is a price (e.g. scarcity price of available infrastructure or commodity

    price).

    6 Results

    6.1 Case A: Restricted supply of natural gas

    By simulating a reduction in the quantity that is imported from the eastern (Russia) and south (North Africa)

    interconnections, it is expected (according to equation [22]) that the price of natural gas will increase,

    thereby driving the price of electricity up. Intuitively, it is also expected that in a more advanced version of

    the model, including seasonal variations and storage capacity, the shadow value of existing storage capacity

    would increase.

    6.2 Case B: Increased price of emission allowances

    In this case, we assume that the price for carbon dioxide emission certificates (exogenous variable) within

    the context of the EU ETS is high enough to motivate electricity producers to switch to a less carbon-

    intensive fuel portfolio (including natural gas fueled production). Therefore, it is expected that the demand

    for natural gas will increase, according to equation [21], thus increasing the pressure (as expressed by

    the scarcity price P Cpipe(g, h)) at the congestion points of the natural gas network. By performing a seriesof counterfactual runs of the model at different carbon prices, we derive useful observations regarding the

    increase of the demand for natural gas (because of the inter-fuel substitution of carbon-intensive fuel in the

    power sector).

    9

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    11/15

    Figure 9: Representation of an energy hub with natural gas and electricity as inputs.

    7 Conclusion

    It has been shown that the markets for natural gas and electricity interact, because the two commodities

    are substitutes at the final energy demand level while natural gas is also an input for electricity production.

    The infrastructure-bound nature of the markets creates further complications, since an activated capacity

    constraint in one market can influence the state of the other market.

    Thus, we conclude that it is especially meaningful to examine the two markets in conjunction through apartial equilibrium model, which reveals important properties of this interaction.

    10

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    12/15

    References

    [1] ENTSOE statistical database. https://www.entsoe.eu/resources/data-portal/; accessed April 19, 2011.

    [2] ENTSOE statistical yearbook 2009. https://www.entsoe.eu/resources/publications/entso-e/statistical-

    yearbooks/; accessed April 19, 2011.

    [3] Jan Abrell and Hannes Weigt. Combining energy networks. Electricity Markets Working Papers WP-

    EM-38, Available at SSRN: http://ssrn.com/abstract=1550712, 2010.

    [4] G. Andersson. Modelling and Analysis of Electric Power Systems, Lecture 227-0526-00. ITET ETH

    Zurich, EEH - Power Systems Laboratory, 2010.

    [5] Egging, Gabriel, Holz, and Zhuang. A complementarity model for the european natural gas market.

    1st CESSA conference, Berlin, Available at http://www.cessa.eu.com/?group=publications, 2007.

    [6] ENTSOE. NTC matrix. https://www.entsoe.eu/resources/ntc-values/ntc-matrix/; accessed April 19,

    2011, 2010.

    [7] Eurostat. Energy balance sheets 2007-2008 KS-EN-10-001-EN-N, page 268. European Union, 2010.

    [8] Michael C. Ferris and Todd S. Munson. PATH 4.6 solver manual.

    http://www.gams.com/solvers/solvers.htm, 2011.

    [9] Franziska Holz. Modeling the European Natural Gas Market - Static and Dynamic Perspectives of

    an Oligopolistic Market. PhD thesis, Technische Universitaet Berlin - School VII Economics and

    Management, 2009.

    [10] IEA. Electricity/heat data. http://www.iea.org/stats/; accessed April 19, 2011, 2008.

    [11] A. Neumann, N. Viehrig, and H. Weigt. Intragas - a stylized model of the european natural gas network.

    Dresden University of Technology Resource Market Working Paper WP-RM-16, 2009.

    [12] A. Papaemmanouil, Le Anh Tuan, G. Andersson, L. Bertling, and F. Johnsson. A cost-benefit analysis

    of transmission network reinforcement driven by generation capacity expansion. Power and Energy

    Society General Meeting, IEEE, 2010.

    11

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    13/15

    A GAMS code

    *ENERGY ECONOMICS AND POLICY - HS2011

    *MARIA KANINIA

    *-------------------------------------------------------------------------------

    $eolcom //

    $setglobal fin inXLS.xls // input xls file

    $setglobal fout outXLS.xls // output xls file

    $setglobal gdxin inGDX.gdx

    $setglobal gdxout outGDX.gdx

    *directories of building blocks to be imported - exported excel gdx

    $setglobal dirIn dirIn.txt // imported data coordinates - xls file

    $setglobal dirOut dirOut.txt // exported data coordinates - xls file

    set g ng_nodes /

    RUS,NOR,ALG,

    GER,FRA,ITA

    /

    alias (g,h,gg);

    set g_prod(g) subset - ngas producers /RUS,NOR,ALG/;set g_cons(g) subset - ngas consumers /GER,FRA,ITA/;

    set e electricity network nodes (aggregated areas);

    alias (e,ee,ei,ej);

    *mapping_1:

    *(i) electricity production nodes where natural gas is used as fuel

    *(ii) gas trading nodes

    set GE(g,e) mapping_1;

    *mapping_2: sparse matrix populated with boolean values

    *represents the links (transmission network) in the electricity market

    set EL(e,ee) cross-border capacities;

    set i plant types /

    HYD

    NUC

    CLG

    NGS

    /

    set iNGS plant types fuelled by NGS

    /

    NGS

    /

    set fu fuels /

    HYD

    NUC

    CLG

    NGS

    OIL

    /

    parameter

    el_data(e,*) (auxiliary) parameters for nodes of electricity network

    a_el(e) constant-1 for electricity linear demand curve (GWh per hour)

    b_el(e) constant-2 for electricity linear demand curve (neg-slope)

    gas_data(*,*) ( au xi li ar y) p ar am et er s f or g as n et wo rk n od es

    a _g as (g _c on s) c on st an t f or n -g as d em an d c ur ve

    b_gas(g_cons) constant for n-gas demand curve (slope)

    gas_cap_data(g,*,h) (auxiliary) parameters

    cap_gas(g_prod) extraction capacity

    c_g as(g_ prod ) e xtrac tion p rice

    fuel_data(fu,*) ( au xi li ar y) p ar am et er s f or f ue l d at a

    pf(fu) fuel price (Euro | MWth)

    the ta(fu ) e missi on coe ffic ient (t -CO2 | MWt h)

    cap_line_el(e,ee) electrical transmission capacity

    c_p ipe(g ,h) p ipeli ne tra nspo rtati on cost

    cap_pipe(g,h) pipeline capacity | uni-directional flows

    cap _el(e ,i) g enera tion c apaci ty by plant type ;

    table eff(fu,i)

    HYD NUC CLG NGS

    HYD 0.8

    NUC 0.7

    CLG 0.4NGS 0.5

    ;

    12

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    14/15

    *IMPORT_DATA_XLS_BEGIN----------------------------------------------------------

    *compilation phase---------------------- ---------------------------- ------------

    *load data

    $call GDXXRW I=%fin% O=%gdxin% @%dirIn%

    $gdxin %gdxin%

    $load e, GE, EL

    $load el_data, cap_el

    $load gas_data, gas_cap_data, fuel_data

    $gdxin

    ;

    *IMPORT_DATA_XLS_END------------------------------------------------------------

    *process parameters from input file

    a _e l( e) = e l_ da ta (e , EL _D EM _a ) ;

    b _e l( e) = e l_ da ta (e , EL _D EM _b ) ;

    a_gas(g_cons) = gas_data(g_cons, GAS_DEM_a);

    b_gas(g_cons) = gas_data(g_cons, GAS_DEM_b);

    cap_gas(g_prod) = gas_data(g_prod, cap_gas);

    c_gas(g_prod) = gas_data(g_prod, c_gas);

    c_pipe(g,h) = gas_cap_data(g, c_pipe, h);

    cap_pipe(g,h) = gas_cap_data(g, cap_pipe, h);

    pf(fu) = fuel_data(fu, pf);

    theta(fu) = fuel_data(fu, theta);

    *temporary assignment

    cap_line_el(e,ee) = 1e+8 $(EL(e,ee));

    execute_unload outGDX.gdx, fuel_data, theta;

    $exit

    table PTDF(l,e)

    DE FR IT

    line1 0.5 0.5 0.5

    line2 0.5 0.5 0.5

    line3 0.5 0.5 0.5

    ;

    positive variables

    DEM_gas(g_cons) demand of final consumers for n-gas

    PD( g) pri ce for n-ga s (co nsump tion no de)

    PS( g) pri ce for n-ga s (pr oduct ion no de)

    XTR_gas(g) extraction quantity

    PC_gas(g) scarcity price of extraction capacity

    F_pipe(g,h) flow of n-gas along pipeline g-->h

    PC_pipe(g,h) scarcity price of pipeline capacity g-->h

    PT_pipe(g,h) price of pipeline transportation service g-->h

    T_buy(g) quantity of n-gas bought by trader at node g

    T (g ,h ) q ua nt it y t ra de d ( g: bu y h :s el l)

    F(gg,g,h) quantity bought at node gg to be transported g-->h

    DEM_el(e) demand of final consumers for electricity

    PT_el(e) transmission fee chargeable at node e (congestion fee)

    PHU B mar ginal energ y pri ce (en tire s yste m)

    X_el(e,i) electricity generated at node e by plant type i

    PC_el(e,i) scarcity price of capacity for plant type i

    ;

    *free

    variables

    PN(gg,h) nodal price (at node h) of n-gas bought at node gg

    Y (e ) e le ct ri ca l e ne rg y t ra ns po rt ed f ro m n od e e t o h ub

    PCl_pos(ei,ej) scarcity price of line capacity - direction ei-->ej

    PCl_neg(ei,ej) scarcity price of line capacity - inv. direction ej-->ei

    ;

    *fixed variables

    XTR_gas.fx(g)$(not g_prod(g)) = 0;

    PD.fx(g)$(not g_cons(g)) = 0;

    F_pipe.fx(g,h)$(cap_pipe(g,h) = 0) = 0;

    PT_pipe.fx(g,h)$(cap_pipe(g,h) = 0) = 0;

    equations

    *section_A: natural gas model

    d_gas(g_cons) linear demand curve of final consumers for n-gas

    xtr_cap_gas(g) extraction capacity constraint

    zp_gas_prod(g) zero-profit condition | n-gas production

    pipe_cap_gas(g,h) pipeline capacity constraint

    zp_pipe_flow(g,h) zero-profit condition | pipeline flow

    s_eql(g) equilibrium at supply market

    zp_purch_gas(gg,h) zero-profit condition | purchased amount

    13

  • 8/6/2019 Exploring Parallel Layers Commodities Energy Systems

    15/15

    zp_sold_gas(g) zero-profit condition | sold amount

    zp_pipe(gg,g,h) zero-profit condition | pipeline

    flow_cnsrv(gg,h) flow conservation

    pipe_clr(g,h) market clearing condition | pipeline flow

    * linkage equation 1

    dq_gas(g) clear demand market | trading

    *section_B: electricity model

    d_e l(e) l inear dema nd cur ve of final cons umers for e lectr icit y

    el_gen_cap(e,i) electricity generation capacity constraint

    e l_ mr kt _c lr e le ct ri ci ty m ar ke t c le ar in g c on di ti on

    el_equil(e) equilibrium at each node

    el_line_cap_pos(ei,ej) capacity constraint el-line-pos

    el_line_cap_neg(ei,ej) capacity constraint el-line-neg

    z p_ ts o( e) z er o- pr of it c on di ti on | t ra ns mi ss io n s ys te m o pe ra to r

    * linkage equation 2 ***zp_gen(e,i) zero-profit | generator (distinguish between NGS fuelled power plants and otherss)

    ;

    *section_A: natural gas model

    d _g as (g _c on s) .. D EM _g as (g _c on s) = e= a _g as (g _c on s) + b _g as (g _c on s) * PD(g_cons);

    xtr_cap_gas(g_prod).. cap_gas(g_prod) =g= XTR_gas(g_prod);

    zp_gas_prod(g_prod).. c_gas(g_prod) + PC_gas(g_prod) =g= PS(g_prod);

    p ip e_ ca p_ ga s( g, h) .. c ap _p ip e( g, h) = g= F _p ip e( g, h) ;

    zp_pipe_flow(g,h).. c_pipe(g,h) + PC_pipe(g,h) =g= PT_pipe(g,h);s_eql(g).. XTR_gas(g) =g= T_buy(g);

    zp _pur ch_ga s(gg ,g).. P N(gg, g) =g= PD(g );

    zp_sold_gas(g).. PS(g) =g= PN(g,g);

    zp _pip e(gg, g,h) .. P T_pip e(g, h) + P N(gg, g) =g= PN(g g,h);

    *unity matrix removed

    flow_cnsrv(gg,h).. sum(g,F(gg,g,h)) + T_buy(gg)$(ord(gg) eq ord(h)) =e= sum(g,F(gg,h,g)) + T(gg,h);

    pi pe_c lr(g, h).. F _pipe (g,h ) =g= s um(gg , F(gg ,g,h ));

    *linkage equation 1

    dq_gas(g_cons).. sum(h, T(h,g_cons)) =g= DEM_gas(g_cons)+sum(e$GE(g_cons,e),X_el(e,NGS)/eff(NGS,NGS));

    *section_B: electricity model

    d_el(e).. DEM_el(e) =e= a_el(e) + b_el(e) * (PT_el(e) + PHUB);

    el _gen _cap( e,i) .. c ap_el (e,i ) =g= X _el(e ,i);

    el _mrk t_clr .. s um(i, sum( e, X_el (e,i ))) =g= sum( e, DEM _el( e));

    el_line_cap_pos(ei,ej)$EL(ei,ej)..

    sum(e, PTDF(ei,ej,e)*Y(e)) =l= cap_line_el(ei,ej);

    el_line_cap_neg(ei,ej)$EL(ei,ej)..

    -sum(e, PTDF(ei,ej,e)*Y(e)) =g= -cap_line_el(ei,ej);

    zp _tso (e).. P T_el( e) =e= sum( (ei, ej)$E L(ei, ej), PTDF( ei,e j,e)*(PCl_pos(ei,ej)-PCl_neg(ei,ej)));

    el_equil(e).. Y(e) =e= sum(i,X_el(e,i))-DEM_el(e);

    *linkage equation 2 ***attention re: multi-input production plantsz p_ ge n( e, i) .. s um (f u$ (e ff (f u, i) g t 0 ), p f( fu )/ ef f( fu ,i )) $( no t i NG S( i) )

    + sum(g$GE(g,e),PD(g)/eff(NGS,i))$iNGS(i)

    + PC_el(e,i) =g= PT_el(e) + PHUB;

    model ngasmod

    /

    d_gas.DEM_gas,

    xtr_cap_gas.PC_gas,

    zp_gas_prod.XTR_gas,

    dq_gas.PD,

    pipe_cap_gas.PC_pipe,

    zp_pipe_flow.F_pipe,

    s_eql.PS,

    zp_purch_gas.T,

    zp_sold_gas.T_buy,

    zp_pipe.F,

    flow_cnsrv.PN,

    pipe_clr.PT_pipe,

    d_el.DEM_el,

    el_gen_cap.PC_el,el_mrkt_clr.PHUB,

    el_line_cap_pos.PCl_pos,

    el_line_cap_neg.PCl_neg,

    zp_tso.Y,

    el_equil.PT_el,

    zp_gen.X_el

    /;

    solve ngasmod using mcp;

    %result processing

    14