Annals of Operations Research 139, 39–63, 2005 c 2005 Springer Science + Business Media, Inc. Manufactured in The Netherlands.
A Mixed-Integer Programming Model for Gas Purchase and Transportation LUIS CONTESSE
[email protected] JUAN CARLOS FERRER
[email protected] SERGIO MATURANA ∗
[email protected] Engineering School, Pontificia Universidad Cat´olica de Chile, Casilla 306, Santiago 22, Chile
Abstract. The natural gas supply chain involves three main agents: producers, transportation companies, and local distribution companies (LDCs). We present a MIP model that is the basis for a decision support system developed for a Chilean LDC. This model takes into account many of the complexities of the purchasing and transportation contracts to help optimize daily purchase and transportation decisions in the absence of local storage facilities. The model was solved to optimality within a reasonable time. We show how the model handles several contractual issues and give some insights for the case when demand scenarios are used to deal with uncertainty. Keywords: mixed-integer programming, natural gas, logistics
1.
Introduction and literature review
Natural gas is an important source of energy for many users. In many places it is the preferred alternative for residential heating and cooking. It can also be used by certain industries as an alternative to fuel oil. Although it has been used extensively in the United States for many years, its use in Chile began only in 1997, when a 465-kilometer pipeline between southern Argentina and the central part of Chile was completed. The natural gas industry involves three main agents: producers, which are mainly concerned with the exploration, development and exploitation of gas reserves; gas pipeline companies, which aggregate gas in production areas and transport it to consumption areas; and Local Distribution Companies (LDCs), which provide gas service to end customers in a particular geographic region. These LDCs have traditionally purchased their gas supplies from the gas pipeline companies under long-term contracts (twenty or more years). LDCs provide natural gas service to residential, commercial, and industrial customers within its service territory. They have to decide from which producers to purchase the gas and how to transport the gas from the wellhead to the end customers, ∗
Corresponding author.
40
CONTESSE, FERRER AND MATURANA
using extensive systems of pipelines and storage facilities. Other forms of transportation (truck, train, or ship) are usually not economically feasible. Storage facilities help absorb demand fluctuations that may occur during the year. Large commercial and industrial customers can be served on either a firm or an interruptible basis. Interruptible sales customers are willing to have their gas supply curtailed during periods of peak demands in exchange for a lower price. This type of customer can be an alternative to the use of storage facilities for absorbing demand fluctuations. Changes in the regulatory system of the gas industry in the United States, which began in 1985, have presented new supply alternatives to gas purchasers, including Gas Pipeline Companies (GPCs), LDCs, and large end users. These changes have encouraged pipeline companies to unbundle their traditional merchant services and allow buyers to transport their own gas through the pipeline system. This open access to gas transportation services gives gas purchasers the opportunity to buy gas directly from non-pipeline sources, including natural gas producers and independent marketing companies. This is generating an active spot market for natural gas. The purchase and transportation of natural gas is governed by very complex contracts. LDCs have to operate on a daily basis taking into account the conditions stipulated in the contracts and the uncertainties of the demand. The residential segment of the market, which is usually the most important one, is difficult to predict on a daily basis since it depends on weather conditions. Low temperatures in the winter can induce a significant increase in natural gas demand. It is very difficult to obtain reliable predictions of weather conditions with the anticipation required by the planners. One type of contract that has become more common due to the changes in the regulation is the firm transportation contract, which allows shippers to reserve a portion of the pipeline’s total delivery capacity for their own use. The shipper pays a monthly demand charge based on the maximum daily delivery quantity contracted and a transportation charge for each unit delivered. Additional pipeline transportation services are available on an interruptible basis, where the shipper pays only for the gas transported. The objective of gas supply planning is to minimize the LDC’s costs. Over the short term, this means optimally dispatching the available gas supply to meet variable demand. Over the long term, this means constructing an optimal portfolio of gas sources including gas purchases from pipelines, storage, and transportation of gas purchased directly from producers. Planners need to have a Decision Support System (DSS) to help them determine the best way to satisfy the uncertain demand they face subject to the complex set of conditions specified in the contracts they have signed with their providers and GPCs. Optimization models have been applied to many different problems related to the complex process of purchasing and transporting natural gas. In particular, Murphy et al. (1981), Levary and Dean (1980), and O’Neill et al. (1979) report on the use of Linear Programming (LP) models for long-term supply planning by the natural gas industry and regulators. An optimal gas supply strategy can only be defined after considering a wide range of purchase, transportation, and gas storage options over a multiyear time horizon. As a
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
41
consequence, these optimal strategies should be determined using large scale optimization models. These models have been successfully used to assist gas supply planners in making both strategic and operational gas supply and transportation decisions. Chin and Vollmann (1992) illustrate the use of methodologies based on Material Requirements Planning (MRP) and LP models as decision support tools for the problem of buying natural gas to meet a weather-dependent demand. The problem of optimizing the selection of supply contracts, which is also called the optimal supply mix problem, has been studied by several authors. Avery et al. (1992) present a DSS based on a highly detailed optimization model, used by utilities to plan operations, which minimizes cost while satisfying regulatory agencies. Knowles and Wirick (1998) describe how “The Peoples Gas Light and Coke Company” plans its gas supply. They used an optimization model that considers multiple weather scenarios in determining a supply portfolio. With the deregulation of the natural gas industry, the company has used the model to restructure supply portfolios, saving more than $50 millions annually. Guldmann and Wang (1999) proposed a large Mixed-Integer Linear Program (MILP or MIP) and a much smaller Non-Linear Programming (NLP) approximation of the MILP, involving simulation and response surface estimation via regression analysis to solve the problem of the optimal selection of natural gas supply contracts by LDCs. Each potential supply source is characterized by several price and nonprice parameters. Weather variability is the main stochastic factor that drives the demand for gas of the various market segments. The model minimizes the total cost of gas supply and market curtailment and determines the size of the interruptible market. Other approaches have used optimization models at a more operational level. De Wolf and Smeers (2000) formulated the problem of distributing gas through a network of pipelines as a cost minimization subject to nonlinear flow-pressure relations, material balances, and pressure bounds. The solution method is based on piecewise linear approximations of the nonlinear flow-pressure relations. A project which aims at developing an integrated DSS for the optimization of natural gas pipeline operations is described in Sun et al. (2000). This integrated system uses both expert systems and operations research to model the operations of gas pipelines. In this article we describe the model we developed for Metrogas, a Chilean LDC, which is part of the Optimization-Based DSS (OBDSS) that was implemented in the context of a 3-year R&D project called GESCOPP. This project has produced several prototypes in different areas, one of which is described in Gazmuri and Maturana (2001). For a complete description we refer the reader to Gazmuri et al. (1993). The remainder of this article is organized as follows. In Section 2 we describe the problem in detail. In Section 3 we present the MIP model we developed. In Section 4 we give some details of the implementation of this model at Metrogas. In Section 5 we discuss an extension using stochastic optimization. Finally, we state our conclusions in Section 6.
42
CONTESSE, FERRER AND MATURANA
Figure 1. Transportation network.
2.
Problem description
The natural gas that supplies the central part of Chile comes from two sources in Argentina: Sierra Chata and Total Austral. It is transported to Chile, across the Andes mountains, through a 465 km. pipeline which was completed in August 1997. As shown in Figure 1, the pipeline can be divided into three sections, which belong to three different GPCs: Transportadora de Gas del Norte (TGN), Gas Andes Argentina (GAA), and Gas Andes Chile (GAC). The gas is purchased directly by Metrogas from the producers and then shipped to Chile through these GPCs. The model that will be described in the next section, maximizes the company’s profit over a certain planning horizon. The profit is computed as the difference between the total income derived from sales to different end customers and the purchase and transportation costs. Two different types of demand are considered: firm and interruptible. Firm demand comes mostly from residential customers. Interruptible demand comes mostly from industrial customers with interruptible service. At the La Mora node there is also an external agent who may buy gas from Metrogas at a spot price. Interruptible demand helps deal with demand fluctuations since storage facilities are very limited. Since the prices for interruptible service and for gas sold at La Mora are much lower than the prices for residential customers, selling interruptible service at La Mora only becomes an interesting option when residential demand is low for a relatively long period of time (more than one month). Interruptible service customers can resort to an alternative source of energy but whenever possible switch to gas, because of the lower price specified in their contracts. The producers, Sierra Chata and Total Austral, have long-term gas supply contracts with Metrogas, with monthly and quarterly conditions, respectively. These contracts, which extend over twenty years, include pricing provisions to encourage buyers to maintain high purchase factors. There is a minimum monthly or quarterly amount of gas that
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
43
Figure 2. Make up generation and recovery.
Metrogas must purchase from the producers, regardless of the end customer demand. This quantity is the so-called take-or-pay (TOP), which is a fixed volume of gas contracted with each producer. The total purchase cost is the sum of the fixed TOP cost plus the cost of any additional gas beyond the TOP level, valued at some fixed commodity rate, i.e., a cost proportional to the volume of gas requested. In addition, there are some purchase penalty costs (fines) when daily minimum and maximum purchase levels are not respected. Another important condition specified in the contracts between producers and Metrogas is the make-up recourse. Make-up is the difference between the TOP level and the volume of gas actually received by the buyer, when it is below this level (see figure 2). This make-up may be used, or recovered, when the volume actually received by the buyer exceeds the TOP level, within the twelve periods immediately following the period where it originated, i.e., one or three years depending on whether the periods are months or quarters. After that, the buyer loses it. At the pipeline level, the shippers or transportation companies also establish longterm contracts with Metrogas. Since the three sections of pipeline work under similar operating conditions, the transportation contracts have the same structure for the three shippers. They all have a maximum daily quantity (MDQ), which can be shipped at some daily basic demand charge (BDC). If the buyer needs to transport in excess of the MDQ, it can request an authorized overrun gas (AOG) at a higher cost. If the AOG is not requested or granted, the buyer may incur in an unauthorized overrun gas (UOG) at an even higher cost. If on a given day the shipper is unable to transport the customer’s firm scheduled daily delivery (SDD), the resulting (positive) delivery deficiency (DD) originated in that day may be accumulated by the customer and used in future periods to diminish overrun transportation costs. On the other hand, if on a given day the customer does not make use of all of its firm SDD, a (negative) DD is generated which must also be compensated for in the future.
44
CONTESSE, FERRER AND MATURANA
Figure 3. Contracted capacity and linepack unbalances.
Transportation contracts establish complex linepack conditions related to the pipeline’s daily transportation capacity. The linepack is the fraction of the pipeline’s total transportation capacity that is owned by the customer. Any positive or negative linepack unbalances produced by the daily transported quantities with respect to the contracted linepack, are penalized with increasing return to scale costs (see figure 3).
3.
The model
There are some assumptions of our model that differ from most models found in the gas literature. For instance, the lack of storage facilities in the Chilean pipeline system, which are of great importance in the operation of US natural gas pipelines, forces us to consider interruptible service and the agent at La Mora to handle demand fluctuations. Make-up recovery and linepack unbalances, which are other ways to handle these fluctuations, can only absorb short-term variations. Interruptible service prices are fixed by long-term contracts, so they are known in advance. Prices at La Mora, however, are spot prices which were estimated by experts based on their experience. Another consideration is that we only model the part of the pipeline operated by Metrogas, not the complete pipeline. That is why we model the loss of gas due to pumping (and other losses) as a fixed proportion of the gas received at each node. It would be necessary to include compressor considerations if we were modeling the transportation company’s problem. In addition, there are several assumptions that relate to the operational nature of the decisions that are supported by the model, as opposed to tactical or strategic decisions, which are more commonly found in the literature. For instance, our model requires detailed daily data to make daily decisions. Furthermore, the contract conditions require us to make long-term decisions in order to estimate the profits in the planning horizon. However, since the model is run daily with a rolling planning horizon, short-term decisions are more relevant than those much farther into the future. The data for the whole
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
45
planning horizon is assumed to be known, although in reality there is some uncertainty. Each time the model is solved, the data is updated by more accurate estimates. The operational nature of the model also explains why contract terms are considered exogenous as opposed to other models intended to support contract selection (e.g., Guldmann and Wang, 1999), which is a much more strategic decision. We start by defining some notation that will be used in our formulation. Let d and m be the temporal indices in the planning horizon representing each day and month respectively. D˜ is the set of the days that will be considered in the planning horizon, while D˜ m is the subset of the days in each month. The real setting considers two types of contracts with the producers, depending upon the length of the periods they use to specify the conditions (monthly or quarterly periods). For the sake of space and a simpler notation, and without loss of generality, we assume the existence of only one type of contract. We define also c and u as the indices for customers and contract producers respectively. In addition, we define C˜ as the set of customers, and U˜ as the set of contract producers. Finally, parameters will be capitalized, while decision variables will not. It may be also helpful to consult the glossary in Appendix B. The description of the model is divided in three parts: the objective function, the purchasing constraints, and the transportation constraints.
3.1. Objective function The objective function to be maximized, is the profit of the LDC. On the revenue side, we consider two streams of income: gas sold to the external agent at La Mora and gas sold to Metrogas’ customers with either preemptive (interruptible) or non-preemptive (firm) service. Thus, the total income is given by d∈ D˜
PdAG gdR−AG +
c∈C˜
I I Pdc ddc +
F F Pdc Ddc
(1)
c∈C˜
I denote the decision variables for the agent (AG) daily demand where gdR−AG and ddc and the interruptible (I) daily demand respectively, both expressed in cubic meters. The F parameter Ddc corresponds to the firm (F) demand, which is known for all customers. F I The prices are denoted by PdAG , Pdc , and Pdc , and are expressed in dollars per cubic meter. On the other hand we have the total cost, which has the following components: (i) purchase cost, (ii) additional gas cost, (iii) deficit gas cost, (iv) transportation cost, (v) transportation fines, and (vi) linepack fines. Next, we describe each of these costs. The purchase cost includes all daily nominations for all producers plus the fixed costs associated with take-or-pay contracts, which are basically sunk costs and are
46
CONTESSE, FERRER AND MATURANA
denoted by C TOP . Thus, the purchase cost is given by G I2 Cdu · gdu , C P = C TOP +
(2)
d∈ D˜ u∈U˜ G where Cdu denotes the cost of one cubic meter of gas for monthly contract producers. I2 The decision variables gdu represent the volume of injected gas above the monthly TOP threshold, but within the allowed daily range. When the amount of utilized gas is greater than the maximum daily consumption (CDC) in the contract (e.g., period 7 in figure 2), there is a cost for this additional gas given by A A CA = Cdu · gdu , (3) d∈ D˜ u∈U˜ A A where Cdu are the costs for an additional cubic meter of gas, and gdu are the corresponding decision variables for the volume of additional gas. Similarly, when the amount of utilized gas is less than the minimum daily consumption specified in the contract (e.g., day 4 in figure 2), the cost of the deficit of gas is given by D D CD = Cdu · gdu , (4) d∈ D˜ u∈U˜
where the variables and parameters used are similar to the additional gas cost case. The gas is transported by different transportation companies which belong to the set T˜ , for instance T˜ = {TGN, GAA, GAC}. The companies charge different fees for BDC firm and interruptible quantities. If Cdk is the Basic Demand Charge (BDC), which is PSP constant in our case although we maintained the daily index for generality, and Cdk is the daily spot price for a cubic meter of interruptible gas, the transportation cost is given by BDC PSP I CT = Cdk (5) · G MDQ + Cdk · gdk dk k∈T˜ d∈ D˜ I where G MDQ is the maximum daily amount of gas transported by company k, and gdk dk is the decision variable of how much interruptible gas will be transported by the same company. A transportation fine is charged when there is some level of unauthorized overrun UOGi gas, UOG. These fines are calculated as a proportion M·dk ∈ [0, 1] of the corresponding BDC. The model considers three different sections of the pipeline for the transportation fines. Thus the cost is given by 3 BDC UOGi UOGi UOGi UOGi M0dk . (6) Cdk · g0dk + M1dk · g1dk C TF = i=1 k∈T˜ d∈ D˜
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
47
Lastly, we consider a fine due to linepack unbalances. This fine has four components: the first two associated with daily unbalances (positive LP-DP and negative LP-DN) and the other two with cumulative unbalances (positive LP-CP and negative LP-CN). For linepack fines, this model considers four different sections in the pipeline. Thus, the fine is given by LP−DP LP−DPi LP−DPi BDC C LF = · Mdk · Cdk · gdk Cdk i=1,...,4 k∈T˜ d∈ D˜ LP−DN LP−DNi LP−DNi BDC + Cdk · Mdk · Cdk · gdk LP−CP LP−CPi LP−CPi BDC + Cdk · Mdk · Cdk · gdk
LP−CN LP−CNi LP−CNi BDC + Cdk · Mdk · Cdk · gdk ,
(7)
LP−·i LP−·i where Mdk ∈ [0, 1] is the proportion of the corresponding BDC, Cdk is the associated LP−·i fine of one cubic meter in section i, and gdk is the decision variable for the amount of linepack gas. Therefore, by adding up (2)–(7) the total cost is given by
C = C P + C A + C D + C T + C TF + C LF .
(8)
3.2. Purchase constraints The constraints related to the gas purchase process are the following: • Injection of gas: There are two types of injection which can be requested to the producers on a given day: gas injected under the take-or-pay contract, denoted by I1 I2 gdu ≥ 0, and gas consumed above the TOP threshold, denoted by gdu ≥ 0, which has a higher cost. The sum of all injections in a single period has to be less than or equal to the TOP level G TOP mu for the same period. Thus, for monthly contract producers we have I1 gdu ≤ G TOP ∀m ≤ M, ∀u ∈ U˜ . (9) mu d∈ D˜ m
• Maximum daily consumption: As shown in figure 2, there is a maximum daily consumption in the contract (G CDC du ) which can be increased by requesting additional A gas (gdu ). This quantity has to be higher than or equal to the sum of injected and recovered gas. The following constraint represents the previous condition for monthly contract producers: I1 I2 R A gdu + gdu + gdu ≤ G CDC du + gdu
˜ ∀u ∈ U˜ . ∀d ∈ D,
(10)
In addition, it is not always possible to request additional gas. The binary parameter A Ddu is equal to 1 when additional gas can be requested in day d from a given producer,
48
CONTESSE, FERRER AND MATURANA
0 otherwise. This restriction yields the following two constraints: A A gdu ≥ 0 if Ddu =1 A A gdu = 0 if Ddu = 0.
• Minimum daily consumption: This constraint is similar to the previous one. The total injected gas has to be higher than or equal to the minimum daily consumption in D the contract minus the requested deficit of gas if possible (Ddu = 1). These constraints can be expressed as I1 I2 D gdu + gdu ≥ G MIN du − gdu D gdu ≥0 D gdu = 0
˜ ∀u ∈ U˜ ∀d ∈ D, D if Ddu =1 D if Ddu = 0.
(11)
• Make-up generation: If the total gas utilized in a given period is less than the TOP quantity for the same period, make-up is generated. This is represented by G I1 gmu = G TOP − gdu ∀m ≤ M, ∀u ∈ U˜ . (12) mu d∈ D˜ m
• Make-up utilization: It is not possible to use make-up in every period. Different M be the binary parameters producers have different restrictions in that respect. Let Dmu which are equal to 1 for those periods where make-up can be utilized. The associated constraints for monthly contract producers are given by R M gdu = 0 if Dmu =0 (13) d∈ D˜ m
R gdu ≥0
M if Dmu = 1.
(14)
d∈ D˜ m
• Make-up generation and recovery control: In each period it is possible to generate make-up or to recover gas from make-up, but never both in the same period. In order to enforce this, we introduce the binary decision variables αmu which take a value equal to 1 in those periods when gas recovery is allowed and 0 otherwise. The following constraints reflect this condition: R gdu ≤ αmu · M2BIG ∀m ≤ M, ∀u ∈ U˜ , (15) d∈ D˜ m
I2 gdu ≤ αmu · M2BIG
∀m ≤ M, ∀u ∈ U˜ ,
(16)
d∈ D˜ m
d∈ D˜ m
G gmu ≤ (1 − αmu ) · M2BIG
I1 I2 R BIG + gdu + gdu gdu − G TOP mu ≤ αmu · M2
∀m ≤ M, ∀u ∈ U˜ , ∀m ≤ M, ∀u ∈ U˜ ,
(17) (18)
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
G TOP mu −
I1 I2 R gdu ≤ (1 − αmu ) · M2BIG + gdu + gdu
∀m ≤ M, ∀u ∈ U˜ ,
49
(19)
d∈ D˜ m
αmu ∈ {0, 1}.
(20)
where M2BIG is a very big number relative to the nominated amount of gas. When gas recovery is allowed we can see in (15) and (16) that the decision variables for injection and recovery are allowed to take positive values, while (17) forces gas generation to zero. Conditions in (18) and (19) make sure that the utilized gas is above the TOP contracted quantity when recovery is allowed. The case of quarterly contract producers is similar. • Total daily make-up recovery: In order to keep track of the gas recovery for different Ri periods and producers, we use the decision variables gdu , where i = 1, . . . , 12. Thus, the following identity must hold: 12
Ri R gdu = gdu
˜ ∀u ∈ U˜ . ∀d ∈ D,
(21)
i=1
• Make-up recovery: The maximum amount of gas from make-up that can be recovered in a period is bounded. It corresponds to the sum of the generated make-up in the preceding twelve periods less the gas already nominated (recovered) in those periods. G g(m−i)u
−
i−1
R(i−j)
gdu
≥
j=1 d∈ D˜ m− j
Ri gdu
˜ ∀u ∈ U˜ , i = 1, . . . , 12. (22) ∀m ∈ M,
d∈ D˜ m
3.3. Transportation constraints The gas transportation process requires fulfilling the demand for gas in each node, from end customers in both Argentina and Chile, while maintaining linepack levels within the limits stated in the contracts with each transportation company. In addition, each transportation company must be supplied with enough gas in order to be able to pump the injected gas. In a nutshell, the balance of each pipeline corresponds to the injected gas on one end less the gas utilized for transportation minus the gas delivered on the other end of the pipeline. • Pipeline nodes: The total amount of gas gdR−TGN received in node Neuqu´en in day d corresponds to the sum of injected gas by all producers plus the recovered make-up. Thus, we express this condition as follows: gdR−TGN =
u∈U˜
I1 I2 R gdu + gdu + gdu
˜ ∀d ∈ D.
(23)
50
CONTESSE, FERRER AND MATURANA
In node La Mora it is possible to sell gas to an Agent. Thus, the transported gas gdT−TGN by TGN is split in two, the one received by the Agent and the one received by GAA, i.e., gdR−GAA = gdT−TGN − gdR−AG
˜ ∀d ∈ D.
(24)
Next, in node Frontera, the received gas by GAC is equivalent to the transported (or delivered) gas by GAA, i.e., gdR−GAC = gdT−GAA
˜ ∀d ∈ D,
(25)
and finally, the received gas gdR−MG in node Citygate (Metrogas) is equivalent to the transported gas by GAC. Thus, gdR−MG = gdT−GAC
˜ ∀d ∈ D.
(26)
• Pipelines’ linepack: As mentioned above, a proportion M B−TGN of the received gas is used to pump it through the pipeline. Thus, the linepack in TGN is given by the delivered gas minus the received gas minus the utilized gas for transportation, as follows: LP gdTGN = gdT−TGN − (1 − M B−TGN )gdR−TGN
˜ ∀d ∈ D.
(27)
If gdLP−TGN > 0 then Metrogas owes gas to the transportation company TGN. Otherwise, TGN owes it to Metrogas. We can similarly define the linepack gas for pipelines GAA and GAC as follows: LP gdGAA = gdT−GAA − (1 − M B−GAA )gdR−GAA LP gdGAC
=
gdT−GAC
− (1 − M
B−GAC
)gdR−GAC
˜ ∀d ∈ D, ˜ ∀d ∈ D,
(28) (29)
where M B−GAA and M B−GAC are the proportions of gas used as fuel to transport the gas through the pipeline.
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
51
• Gas sale to the Agent: The maximum amount of gas that can be sold to the agent in node La Mora, every day, is restricted by the Agent’s demand G AG d as shown in the following constraint: R−AG ˜ gdR−AG = gdu ≤ G AG ∀d ∈ D. (30) d u∈U˜
Just for completeness it is worth to mention that the gas received from quarterly contract producers has an additional constraint. It cannot exceed a given proportion of the maximum monthly consumption. • Gas sale at Citygate: The daily gas sales to the end customers in Chile is given F I by both firm (Ddc ) and interruptible (ddc ) demand, and should be fulfilled with the R−MG received gas gd by Metrogas, i.e., F I ˜ gdR−MG = Ddc ∀d ∈ D. (31) + ddc c∈C˜
In addition, interruptible gas sales to each customer are bounded by their demand I−MAX Ddc , which is a parameter, so that I−MAX I ddc ≤ Ddc
˜ c ∈ C. ˜ ∀d ∈ D,
(32)
INT Interruptible gas can only be sold in certain days (when Ddc = 1), so we add the following constraints to take that into account: I INT ddc = 0 if Ddc =0 I INT ddc ≥ 0 if Ddc = 1.
(33) (34)
• Transportation capacity: Capacity is a big issue. In order to model it, two cases are considered. The cases are when demand (firm and interruptible) go beyond the threshold, which is a big portion of the MDQ, and when demand is less than this threshold. To characterize these cases we let DdVTX to be equal to 0 for all days d ∈ D˜ such that I−MAX F ˜ k = GAC, + Ddc ∀d ∈ D, (35) Ddc ≥ M TOL G MDQ dk c∈C˜
and to be equal to 1 otherwise. The parameter M TOL represents the percentage of GasAndes Chile’s MDQ, which is the mentioned threshold. CaseDdVTX = 0: In this case it is known in advance that the demand is high. For that reason, the LDC could order gas in advance using four main sources: AOG, UOG, interruptible gas, and delivery deficiency gas. It is important to recall that the unauthorized overrun gas is divided in three sections. The higher the overrun, the higher the
52
CONTESSE, FERRER AND MATURANA
fine rate. The set of constraints associated with the first pipeline in the network, TGN, is given by: 3 MDQ DD I UOGi gdT−TGN ≤ 1 + G AOG G dk + gdk + gdk + g0dk dk
UOG1 0 ≤ g0dk ≤ gdR−AG + UOG2 0 ≤ g0dk ≤ gdR−AG +
i=1 UOG−1 R−GAA gd M0dk UOG−2 R−GAA M0dk gd
UOG−1 − M0dk
(36)
UOG3 0 ≤ g0dk
for all ∀d ∈ D˜ and k = TGN. The model considers very similar constraints for the other two pipelines, GAA and GAC. CaseDdVTX = 1: In this case the demand is below the committed amount of gas in the contract, so there is no need to use gas from alternatives sources. Just in case, there is always a chance of using UOG, which is by far the most expensive choice. The set of constraints are similar to the previous ones except for the first one in (36), as shown here: gdT−TGN ≤ gdR−GAA + gdR−AG +
3
UOGi g1dTGN
˜ ∀d ∈ D.
(37)
i=1
• Delivery deficiency usage: The Delivery Deficiency (DD) can only be used in those periods where it is allowed by the transportation company, i.e., DD DD gdk = 0 if Ddk =0 DD DD gdk ≥ 0 if Ddk = 1
(38) (39)
for all d ∈ D˜ and k ∈ T˜ , where T˜ = {TGN, GAA, GAC}. • Delivery deficiency nomination: Total delivery deficiency cannot exceed the maximum available to the corresponding transportation company, i.e., DD gdk ≤ G DD ∀k ∈ T˜ . (40) k d∈ D˜
• Daily level of linepack unbalance: Positive or negative daily linepack unbalances are subject to fines, which depend upon the section in the pipeline where the unbalance occurs. The positive unbalance cannot exceed a threshold which corresponds to a fraction of the MDQ. Any unbalance above it will be subject to a fine.
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
53
Thus, LP−DP MDQ LP ≤ Mdk G dk + gdk LP−DP1 0 ≤ gdk ≤ LP−DP2 0 ≤ gdk ≤ LP−DP3 0 ≤ gdk ≤
4
LP−DPi gdk
(41)
i=1 LP−DP1 MDQ Mdk G dk MDQ LP−DP2 LP−DP1 G dk Mdk − Mdk LP−DP3 LP−DP2 Mdk − Mdk G MDQ dk
LP−DP4 0 ≤ gdk
for all d ∈ D˜ and transportation company k ∈ T˜ . For the negative daily linepack unbalance case we have analogous conditions: LP−DN MDQ LP −gdk ≤ Mdk G dk + LP−DN1 0 ≤ gdk ≤ LP−DN2 0 ≤ gdk ≤ LP−DN3 0 ≤ gdk ≤
4
LP−DNi gdk
(42)
i=1 LP−DN1 MDQ Mdk G dk LP−DN2 MDQ LP−DN1 Mdk − Mdk G dk MDQ LP−DN3 LP−DN2 G dk Mdk − Mdk
LP−DN4 0 ≤ gdk
for all d ∈ D˜ and k ∈ T˜ . • Cumulative level of linepack unbalance: Monthly linepack unbalances are also considered. This constraint is pretty similar to the previous one. There are two changes. First, instead of LP-DP or LP-DN we have LP-CP or LP-CN respectively. Second, the left hand side of (41) considers the cumulative linepack until day d, i.e., ˘ d≤d, ˘ ˘ D} ˜ {d: d∈
LP gdk ˘
≤
LP−CP MDQ Mdk G dk
+
4
LP−CPi gdk
(43)
i=1
for all d ∈ D˜ and k ∈ T˜ .
3.4. Boundary conditions Information from previous days has to be maintained because of the boundary conditions I1 I2 R of the model. The injected-gas levels gdu and gdu , the recovered gas gdu , the additional A D gas gdu , and the deficit gas gdu , are gathered from the database for all producers and all days prior to the current day when the model is being optimized (for all u ∈ U˜ and d ∈ D˜ P ).
54
CONTESSE, FERRER AND MATURANA
Analogously, on the transportation side, the received gas gdR−k , the transported UOGi gas gdT−k , the linepack gas gdLP−k , and the unauthorized overrun gas g·dk , have to be P ˜ ˜ gathered from the database for all k ∈ T and d ∈ D . 4.
Implementation at Metrogas
The model described above was the basis for a DSS for Metrogas, an LDC formed in 1994 for distributing natural gas to residential, commercial, and industrial customers in Chile. Since it began operations in 1997, it has grown very fast. At the end of 2000 it distributed natural gas to over 200.000 residential customers, which makes it the largest LDC in Chile. The DSS we implemented for Metrogas, was designed to support the daily decision of how much to request from each of the gas producers and how to transport it. This decision was transmitted by fax in the eve of the day when the injection was to be carried out. This fax (see Appendix A) also took into account any adjustment that were necessary due to differences between the amounts requested and those effectively delivered. The amount of information required to support these decisions is very large, and handling the corresponding data was one of the main problems for the decision makers. Therefore, it was important that the model design supported data management as much as possible. Although the mixed-integer programming model that needed to be solved had 224,881 variables, 80 of which were integer, and 80,379 constraints, it was solved to optimality in less than 2 hours in a personal computer, which was acceptable to the decision-makers. The size of the problem resulted from having daily decision variables over a planning horizon of five years. We considered the alternative of using monthly decision variables for more distant periods, in order to reduce the total number of continuous decision variables. In addition, some auxiliary daily decision variables required by the decision-makers could be aggregated at a monthly level. However, reducing the total number of continuous variables had little impact on the solution time, compared to the impact of the total number of integer variables. Since the solution time was reasonably short, we focused instead on making the operation and maintenance of the DSS as easy as possible. Periodically updating a significant amount of data, as better estimates became available and operational conditions changed, was a nontrivial task for the daily operation of the DSS. In order to test the model, we solved it with different data sets. Since checking the validity of the solution was quite difficult for the complete data set, we used smaller versions of the model. For example, we used a 16 period data set, with 4 periods per month, in order to see how the model handled contracts with different levels of TOP. Figure 4 shows the main decision variables, assuming a relatively low level of TOP and given an initial level of generated makeup of 4000. VINY1M was the variable for the level of gas injected under the TOP level, VINY2M was the variable for the gas
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
55
Figure 4. Solution for Take-or-Pay of 5000.
Figure 5. Solution for Take-or-Pay of 7000.
injected over the TOP level, and VMUPRM was the variable for makeup recovered gas. The solution shows how the model first uses the injection under TOP until the level of 5000 is achieved, then it makes use of previously generated makeup, and lastly of injection of gas over TOP. In figure 5, it can be seen that with a higher level of TOP,
56
CONTESSE, FERRER AND MATURANA
Figure 6. Monthly makeup generation and recovery.
the model drastically reduces the amount of gas over the TOP level, which is more expensive. In an another test, we studied how the model handled the aging of generated makeup. The results shown in figure 6 correspond to a data set with only one day per month, where the generated makeup expires after 4 months. The planning horizon was 4 years plus 1 year of historic data. The figure shows the solution for the first 18 months, which is the most relevant part. Note that as the makeup stock gets older, it is shown in a darker color. In month 4 the model makes use of the makeup generated the previous month. In month 6, more makeup is generated and kept for 4 months until it expires. The same happens with the makeup generated in month 8, which is also lost. However, the makeup generated in month 13 is entirely used during the next three months. The solution generated by the system, using real data, minimized the cost of supplying the required gas to residential customers and interruptible service. The solution optimizes the use of linepack unbalances and make-up generation of the different types of contracts. Seasonal patterns were clearly discernible. During the summer, when residential demand diminishes, interruptible service increases. Also, since we assumed a strong growth in demand, the solution tends to generate make-up in the first part of the planning horizon so it can be recovered in the latter part. During the first part of the planning horizon, almost no additional gas was required. However, towards the end of the planning horizon, there is significant purchase of additional gas, especially during the winter. The model was specified in SML (Geoffrion, 1992), which is a modeling language based on the structured modeling approach developed by Geoffrion (1989). SML turned out to be a very good choice considering the complexity of the model and the need for
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
57
many revisions. We used WIN/SM to build the OBDSS. WIN/SM is a software that has a specialized editor for specifying the model in SML, tools for managing data, and an interface to interact with a commercial solver. This system is described in more detail in Maturana et al. (2004). The use of WIN/SM enabled us to generate, in a very short time, many versions of the system. This allowed us to quickly test the model and verify the solutions. We developed and tested twelve different versions of the model, not counting minor variations.
5.
The robust optimization extension
The deterministic gas purchasing and transportation optimization model described above can be used to analyze different future demand scenarios. For example, it can be solved for every scenario we wish to consider, generating a different optimal solution for each one. If these optimal solutions are similar, at least for the first few days in the rolling planning horizon, decision makers can use them as a basis for their decisions. Otherwise, they can either choose the solution from one of the scenarios or generate a different one by combining several of these solutions, in which case they can evaluate it under the different scenarios. They can also apply classical sensitivity analysis to this solution. According to Avery et al. (1992), scenario analysis gives good results in practice and its use is also well accepted by the LDC’s. However, since the approach described above may not work very well in some cases, we explored using a robust optimization model for dealing with demand uncertainty. The robust optimization approach can be described as finding a solution whose objective value is sufficiently close to that of the optimal solution for each scenario (Mulvey et al., 1995). Each of these scenarios has a certain probability of occurrence. In the model we analyzed Ortiz (2001), the here and now decision variables are the daily gas purchase decision variables over the entire planning horizon. The recourse variables, which depend on the scenarios, are make-up generation and recovery, linepack unbalances, unsatisfied interruptible demand, and the 0-1 integer variables, which prevent, at each period, the recovery of make-up gas generated in the same period, over the entire planning horizon. The objective of the robust optimization model is to maximize the difference between the total income and the total expected recourse cost, which is the expected value of the costs associated to recourse variables for each scenario. To explore the usefulness of implementing a robust optimization model of the real problem, we analyzed a model with a reduced number of scenarios. We used variations of the historic weather and temperature records to generate twenty eight demand scenarios over a time horizon of three years, considering only two seasons per year. Based on these scenarios, we computed the Wait and See value (WS) and the Expected Expected Value (EEV). WS is obtained by solving the deterministic model for each scenario and computing the expected value of the optimal values of these models. EEV is obtained by solving the robust model, with the here and now variables fixed
58
CONTESSE, FERRER AND MATURANA
at the values of the optimal solution of the deterministic model solved for the average scenario. For the given scenarios, we obtained an EEV of $39,765,915 and a WS of $42,799,682. Since the optimal value of the robust optimization model must fall within the interval defined by these two values, the difference (WS-EEV) gave us an upper bound of $3,033,767 on the additional benefit that may be obtained by solving the robust model instead of the deterministic one. However, it was not possible to solve the robust model within a reasonable solution time, even for this reduced number of scenarios. In order to solve a more realistic model we require a more efficient solution method, such as a scenario decomposition approach, in order to take advantage of the deterministic MIP structure, for example using Augmented Lagrangean Relaxation techniques (Contesse and Guignard, 1995). 6.
Concluding remarks
In this work we presented a mixed-integer programming model that is the basis for an OBDSS we developed for a Chilean local natural gas distribution company. The model takes into account all the complexities of the purchasing and transportation contracts to help optimize the company’s daily decisions in the absence of local storage facilities. The model is quite large in order to represent the daily, monthly, quarterly, and yearly conditions specified in the contracts. We also discuss an extension for the case when demand scenarios are used to deal with demand uncertainty. The model we developed is one of the largest and most detailed mixed-integer programming model we have seen that has been solved to optimality. It includes several innovations, such as the treatment of make-up generation and recovery, the aging of generated make-up, the use of linepack to handle demand fluctuation, and the inclusion of fines for different types of deficits and overruns. Despite the size and complexity of the model, it turned out to be relatively easy to solve, thanks to the relatively small number of integer variables and its particular structure. The main difficulties for developing the model were validating it and collecting all the data it required. In the validation, the use of the tools based on structured modeling (Maturana et al., 2004) was very helpful, since it allowed us to quickly generate and run new versions of the model. We had to develop and test many versions of the model before we were satisfied that the conditions of the contracts were adequately taken into account. The use of SML was also important in dealing with many versions of a very large and complex model. Although the model was developed to support operational decisions, it can also be used to help in negotiating new contracts by helping to quantify the effect that certain conditions, such as the amount of TOP, will have on the profits of the company. Appendix A: Daily gas nomination form
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
59
60
CONTESSE, FERRER AND MATURANA
Appendix B: Glossary B.1 Abbreviations AOG Authorized overrun gas BDC Basic demand charge CDC Maximum daily consumption DD Delivery deficiency GAA Gas Andes Argentina GAC Gas Andes Chile
GPC: Gas pipeline company LDC: Local distribution company MDQ: Maximum daily quantity SDD: Scheduled daily delivery TOP: Take-or-pay UOG: Unauthorized overrun gas
B.2 Indices and sets d m k u c D˜ D˜ m D˜ P ˜ M U˜ T˜ C˜
Index for the days. Index for the months. Index to identify the GPCs. Index to identify monthly gas producers. Index to identify LDC’s customers. Set of days in the planning horizon. Set of days in month m. Set of past days prior to the planning horizon. Set of months in the planning horizon. Set of gas producers with monthly basis contracts. Set of gas transportation companies or GPCs. Set of LDC’s end customers.
B.3 Parameters PdAG I Pdc I Pdc I Ddc P C C TOP G Cdu CA A Cdu CD D Cdu CT BDC Cdk G MDQ dk
Sale price to the Agent on day d. Sale price for interruptible demand from customer c on day d. Sale price for firm demand from customer c on day d. Firm demand from customer c on day d. Total purchase cost. Fixed total take-or-pay cost. Cost of one m 3 of gas for a monthly contract producer. Cost for the additional gas. Cost for an additional m 3 of gas. Cost of deficit of gas. Cost for a m 3 when there is deficit of gas. Total transportation cost. Cost of each m 3 of firm gas. Quantity of firm gas to be transported.
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION PSP Cdk C TF UOGi UOGi , M1dk M0dk LF C LP−DP Mdk LP−DN Mdk LP−CP Mdk LP−CN Mdk LP−·i Cdk G TOP mu A· Dd· MIN· G d· D· Dd· M Dmu M2BIG α Dmu
M B−k G AG d I−MAX Ddc INT Ddc M TOL DdVTX G AOG dk UOG−i M0dk DD Ddk DD Gk LP−DPi Mdk LP−CPi Mdk
61
Cost of each m 3 of interruptible gas (spot price). Total transportation fine. Percentage of BDC to compute the fine per m 3 . Total linepack unbalance fine % of BDC to compute the daily-linepack positive unbalance fine. % of BDC to compute the daily-linepack negative unbalance fine. % of BDC to compute the cumulative-linepack positive unbalance fine. % of BDC to compute the cumulative-linepack negative unbalance fine. Associated fine of one m 3 in section i. Take-or-pay volume of gas on period m or t, for each producer. Dummy parameter when additional gas can be requested in day d. Minimum gas level to be used on day d. Dummy parameter if it is possible to request deficit of gas on day d. Dummy variable if it is possible to use make-up in that period. A very big number relative to the nominated amount of gas. Dummy parameter of past decision of recovering or generating make-up. Proportion of received gas by GPC k used as fuel to transport the gas. Agent’s demand for day d. Maximum demand of customer c on day d. Dummy to indicate when interruptible gas can be sold. % of GAC’s MDQ as the threshold for transportation capacity. Transportation capacity cases, 0 or 1. Authorized overrun gas on day d on GPC k ’s pipeline. % of the delivered gas that can be UOG in section level i. Dummy to indicate when delivery deficiency gas can be used. Total delivery deficiency by GPC k. % of GPC k s MDQ for sectioni of DP linepack gas on day d. % of GPC k s MDQ for sectioni of CP linepack gas on day d.
B.4 Decision variables Most of the decision variables have a corresponding parameter (capitalized) which is used to store data prior to the day when the optimization is being carried out. For inR stance, the recovered gas gdu has the parameter G Rdu . I ddc I2 gdu
Interruptible fulfilled demand to customer c on day d. Volume of injected gas above the monthly take-or-pay threshold.
62 A gdu D gdu I gdk UOGi UOGi , g1dk g0dk LP−DPi gdk LP−DNi gdk LP−CPi gdk LP−CNi gdk I1 gdu R gdu G gmu αmu Ri gdu gdR−k gdR−AG gdR−MG gdT−k LP gdk R−AG gdu DD gdk UOGi UOGi , g·dk g·dk LP−DPi gdk
CONTESSE, FERRER AND MATURANA
Volume of additional gas. Volume of deficit gas. Interruptible gas to be transported. Unauthorized overrun gas in section i. Volume of daily-linepack positive unbalance. Volume of daily-linepack negative unbalance. Volume of cumulative-linepack positive unbalance. Volume of cumulative-linepack negative unbalance. Gas injected under the take-or-pay contract on day d by producer u. Recovered gas from make-up, on day d from producer u. Generated make-up on period m. Binary variable equal to 1 when it is allowed to recover gas. Recovered gas on day d from make-up of the i-th previous period. Gas received by GPC k on day d. Gas received by the Agent on day d. Gas received by the Metrogas on day d. Gas transported by GPC k on day d. GPC k s linepack on day d, positive or negative volume of gas. Gas received by the Agent on day d from producer u. Delivery deficiency gas by GPC k on day d. Unauthorized overrun gas in section level i on day d GPC k. Section i s DP linepack gas on day d from GPC k.
Acknowledgment The authors are grateful for the research support provided by Conicyt (grant number FONDEF 2-55) and for the valuable help received from Eliseo Lopez, from Metrogas and Cristian Villena, Allan Gubbins, Alejandro Ortiz, and the rest of the GESCOPP team in developing this model. We also thank the two anonymous referees for their valuable suggestions and the editors for their effort in handling the process. References Avery, W., G. Brown, J. Rosenkranz, and K. Wood. (1992). “Optimization of Purchase, Storage, and Transmission Contracts for Natural Gas Utilities.” Operations Research 40(3), 446–462. Chin, L. and T. Vollmann. (1992). “Decision Support Models for Natural Gas Dispatch.” Transportation Journal 32(2), 38–45. Contesse, L. and M. Guignard. (1995). “A Proximal Augmented Lagrangean Relaxation for Linear and Nonlinear Integer Programming.” Tech. rept. 95-03-06. Dept. of OPIM, The Wharton School, University of Pennsylvania. De Wolf, D. and Y. Smeers. (2000). “The Gas Transmission Problem Solved by an Extension of the Simplex Algorithm.” Management Science 46(11), 1454–1465.
A MIXED-INTEGER PROGRAMMING MODEL FOR GAS PURCHASE AND TRANSPORTATION
63
Gazmuri, P. and S. Maturana. (2001). “Developing and Implementing a Production Planning DSS for CTI Using Structured Modeling.” Interfaces 31(4), 22–36. Gazmuri, P., S. Maturana, F. Vicu˜na, and L. Contesse. (1993). Dise˜no de un Generador de Sistemas Computacionales para la Optimizaci´on de Procesos Productivos. FONDEF Proposal. Pontificia Universidad Cat´olica de Chile. Geoffrion, A. (1989). “The Formal Aspects of Structured Modeling.” Operations Research 37(1), 30–51. Geoffrion, A. (1992). “The SML Language for Structured Modeling.” Operations Research 40(1), 38– 75. Guldmann, J. and F. Wang. (1999). “Optimizing the Natural Gas Supply Mix of Local Distribution Utilities.” European Journal of Operational Research 112, 598–612. Knowles, T. and John Wirick, Jr. (1998). “The Peoples Gas Light and Coke Company Plans Gas Supply.” Interfaces 28(5), 1–12. Levary, R. and B. Dean. (1980). “A Natural Gas Flow Model Under Uncertainty in Demand.” Operations Research 28(6), 1360–1374. Maturana, S., J. Ferrer, and F. Bara˜nao. (2004). “Design and Implementation of an Optimization-Based Decision Support System Generator.” European Journal of Operational Research 154(1), 170–183. Mulvey, J., R. Vanderbei, and S. Zenios. (1995). “Robust Optimization of Large-scale Systems.” Operations Research 43(2), 264–281. Murphy, F., R. Sanders, S. Shaw, and R. Trasker. (1981). “Modeling Natural Gas Regulatory Proposals Using the Project Independence Evaluation System.” Operations Research 29(5), 876–902. O’Neill, R., M. Willard, B. Wilkins, and R. Pike. (1979). “A Mathematical Programming Model for Allocation of Natural Gas.” Operations Research 27(5), 857–872. Ortiz, A. (2001). “Optimizaci´on bajo Condiciones de Incertidumbre: Aplicaci´on en la Compra de Gas Natural.” M.Sc. thesis, Engineering School, Pontificia Universidad Cat´olica de Chile. Sun, C. K., V. Uraikul, C. Chan, and P. Tontiwachwuthikul. (2000). “An Integrated Expert System/Operations Research Approach for the Optimization of Natural Gas Pipeline Operations.” Engineering Applications of Artificial Intelligence 13, 465–475.