Mixed Integer Linear Programming Optimization of Gas Supply to a Local Market

Remote or stranded areas that cannot be supplied by natural gas through transmission pipelines can access gas through terminals for liquefied natural gas (LNG), from where LNG is distributed by trucks or compressed and regasified into regional distribution networks. The gas supply may be further augmented by local biogas or synthetic natural gas. A model for optimization of such regional gas supply chains is presented in the paper, considering a combination of pipeline and truck delivery to a set of customers with given energy demands. After linearization, the task is formulated as a mixed integer linear programming (MILP) problem and is solved by state-of-the-art software. The model is illustrated on a regional energy supply problem considering seasonal variations in the demands. The results of the study demonstrate the role of the price of the local and alternative fuels and the price margins at which it is feasible to build an extensive pipeline network instead of supplying the fuel by trucks to storages connected to pipeline islands. The findings also give information about the influence on investment versus operation costs on the optimal design of the supply chain. The sensitivity of the optimal supply chain on the price of local and alternative fuels as well as on the unit price of pipes and storage tanks is studied to illustrate how optimization can be used to shed light on the feasibility of investment in new infrastructure and to support the decision making processes in the energy sector.


INTRODUCTION
The Paris Agreement on the reduction of the emissions causing climate change, which entered into force in November 2016, prompted the 155 signatories to be active in the process of the global warming mitigation. 1 Even though the USA, one of the major players, withdrew in June 2017, the majority of the global policyholders committed themselves to adopting future strategies that would lead to the reduction of emissions causing climate change. Global CO 2 emissions related to fossil fuel combustion and industrial processes increased by 78% from 1970 to 2010. Since the energy sector contributes substantially to these emissions, the development of new sustainable and renewable technologies substituting those using fossil fuels is crucial. 2 Extensive research of new renewable technologies has been encouraged by setting the climate goals. Meanwhile, to decrease the CO 2 emissions in a shorter perspective, the use of natural gas, seen as a more environmentally friendly fossil fuel compared to coal and oil, has been promoted. 3 Although disputed by some, the present shift from the use of coal in conventional coal powered power plants toward natural gas combined cycle (NGCC) power generation can be seen as a "bridge technology". 4,5 The growing interest in the technologies using natural gas and their competitiveness with renewable energy production technologies explains the higher demand of natural gas in Europe. 6 The necessity to also supply remote areas and regions far away from existing natural gas infrastructure or sources will lead to even higher demand, especially for liquefied natural gas (LNG) in Asia. 7 It is anticipated that the consumption of natural gas together with LNG will grow in the future, partly due to the interest of EU to diversify the gas sourcing to increase the security of energy supply by investing in gas pipeline infrastructure and LNG terminals. 8 Changes in the energy production and the transportation sectors can promote the increase in the gas consumption in Europe even more. 9,10 Biogas (BG), a more environmentally friendly fuel compared to fossil fuels, 11 can be seen as an alternative to natural gas. Sectors such as power and heat production 12 or transportation 13 may profit from the use of biogas, and an injection of upgraded biogas into existing natural gas networks is an attractive way to diversify the gas supply. Furthermore, a gas pipeline is not only a means of gas transportation, but also can serve as a storage of surplus energy produced from, for example, renewable energy sources such as wind and solar power. The excess electricity (and heat) can be used in the production of synthetic methane, which is injected into the gas pipeline. 14 It is estimated that a considerable amount of surplus electricity can be stored in the form of bio-SNG (synthetic natural gas made from biomass). 15 The above trends exert pressure on the existing energy systems and their future development with the aim to reach higher energy efficiency and degree of sustainability. The diverse gas sources and many demand points make the gas distribution system very complex. Fluctuations in the supply and demand caused by the variations of the fuel and utilities price, in the availability of the fuel, and by seasonal temperature changes contribute to this complexity, as seen in Figure 1, which depicts the domestic consumption of natural gas in EU 28 during the years 2013−2016.
An efficient operation of the gas distribution system, including the use of BG and LNG, promotes the security of the fuel supply and the energy independence. Designing an optimal gas transportation network requires a thorough analysis of the system, which will, in turn, form the basis of a profound decision-making process.
In the use of natural gas and its alternatives (biogas, Bio-SNG, LNG, etc.), the transportation along the supply chain starting from the production/drilling site through processing to the customers or storage is an important issue. Optimal design and operation of gas transportation networks have been a matter of research interest for long and the literature presents a broad spectrum of tools that can be used to optimize and simulate the gas transportation within a pipeline network. With the development of computer technology, the complexity of the formulation of natural gas transportation problems has increased, while the computational time has decreased considerably. Individual components, such as active compressors or valves that can be switched on and off, and passive pipe extensions that can be optimized through the selection of their size and length, may be included as variables in the problem formulation.
Cost minimization has often been the main objective in gas transportation problems, taking into account the inherent components of the pipeline network. 17 The tools used for the purpose can be characterized as either deterministic or stochastic. The deterministic approach is often used in the case of a linear formulation of the problem, as it is possible to reach the global optimum within reasonable time with current algorithms. However, the nonlinearities related to the description of compressible gas flow cannot be described accurately by these methods. This problem can be addressed with the help of a nonlinear programming problem (NLP). NLP formulations were often applied in early studies of gas transportation problems, such as in the work of Wong and Larson on the compression minimization problem published already in 1968. 18 More recently, NLP formulations have been significantly extended, for example, by taking into consideration compressibility of the gas 19 or networks on undulating landscapes. 20 A feature that is missing in the LP and NLP formulations is the possibility to switch pipe components on or off. With the addition of binary or integer variables, the linear problem can be extended to a mixed integer linear programming problem (MILP). Martin et al. 21 used an MILP formulation to minimize the gas compression cost. Alves et al. 22 applied an MILP formulation in a multiobjective optimization framework to find the minimum transportation cost while maximizing the gas flow. A further step in the problem formulation is to combine the above features in a mixed integer nonlinear programming formulation (MINLP). Mikolajkováet al. 23 applied MINLP in solving an optimal gas transportation problem. Because of the large computational complexity of MINLP problems, stochastic tools have often been used. Kashani and Molaei 24 used a genetic algorithm (GA) to optimize a gas transportation network written in MILP form, tabu search was applied by Borraz-Sańchez and Ríos-Mercado, 25 and a GA combined with neural networks was suggested by Mohamadi-Baghmolaei et al. 26 Optimal gas network operation is mainly discussed when a pipeline network is present or an optimal network extension has already been found. The flow within such a pipeline is then optimized in more detail, posed as, for example, a pipe capacitation problem 27 or a gas-pooling problem. 28 Even though the largest group of investigations considers steadystate flow in the pipes, transient flow has been studied in analysis of the operation of pipeline networks. For instance, pressure fluctuations or the influence of temperature changes on the gas flow may be of significant interest. 29 The work in the field of transient flow in pipelines has yielded new tools for solving this type of problem. 30 Some authors base their

Industrial & Engineering Chemistry Research
Article optimization on simulation. A tool is applied to simulate the system under different structural and operational parameters, that is, in many different scenarios until an "ideally" working network structure is found. This approach was adopted by the SINTEF group in their GasOpt simulation tool for the pooling problem, 31 by Fasihizadeh et al. 32 in the simulation of stochastic demand, and by Szoplik 33 simulating the gas flow and pressure. Clear drawbacks of such a manual approach are that it can never ensure that the best solution is found, and finding the solution becomes extremely time-consuming in systems with many unknowns.
Linearization of a nonlinear gas transportation problem makes it possible to use deterministic tools and can decrease the computational complexity and ensure global optimality while still considering the essential features of the task. De Wolf and Smeers 34 proposed a simplex algorithm using linearization to minimize the gas compression cost. 34 More recently, Schweiger suggested a linearization of a gas transportation problem under uncertainty. 35 A linearization was also incorporated in the simulation of the pooling problem by van der Hoeven. 36 Recently, Wang et al. 37 proposed a piece-wise linearization in the solution of the natural gas transmission network. Ríos-Mercado and Borraz-Sańchez 38 have presented a nice review on gas distribution problems.
To summarize, deterministic formulations have generally been used in the optimization of less computationally demanding gas distribution problems, mostly LP, NLP, or MILP formulations, while stochastic approaches or simulation have been used in more complex formulations. However, most problem formulations on the design of a new gas networks assume fixed energy demands that are fully satisfied by gas from the network. The work of the present paper designs an optimal gas pipeline and also optimizes a potential supply of gas by trucks from local sources or from sources outside of the system boundary. Therefore, local deliveries and possible storages have to be optimized simultaneously with the pipeline structure and supply, which is a strategic planning problem. 39 We consider a local gas distribution problem, where the goal is to find the most efficient supply to a number of distributed customers with respect to economy. The main gas source is an LNG terminal, which allows for regasification, injecting the gas into a regional pipeline network or loading LNG on trucks supplying the gas in liquid state to the customers. Smaller local biogas producers can also supply gas to the network and thus partly satisfy the energy demand of the region. Work focusing on the optimal integration of gas networks, biomass logistics, and district heating, addressing the planning and operational problems in detail, were presented by Pantaleo et al. 40,41 Other alternative LNG suppliers from farther locations satisfy the demand not covered by the local suppliers. A customer has the possibility to store LNG in a tank, which is built if there is no pipeline connected to a supplier. It is possible to supply customers with gas by pipe from neighboring storages to decrease the supply and storage costs. The problem is written in MINLP form and linearized to obtain an MILP problem that can be solved more efficiently. Linearization allows preserving all the important aspects of the problem but decreasing the computational load. A linearized model using relatively few (e.g., 3−5) segments was found to provide a high accuracy of approximation, and the solutions found in the optimization task based on it did not substantially differ from those obtained by solving the MINLP problem using the nonlinear model. 42 The solution provides information about the optimal pipe connections including length and diameter, gas mass flow and pressures in the pipe, storage locations and size, and numbers of truck trips in a multiperiod formulation. The optimization model can be used as a tool, for example, for planning of regional gas supply systems when future scenarios of energy supply are evaluated.

OPTIMIZATION PROBLEM DESCRIPTION
Natural gas is traditionally transported in Europe by large longdistance transmission pipelines. The pipeline transportation from the source to very remote consumers or to areas that are not easily accessible is not always economic or technically possible. After cooling of the natural gas below −160°C (at atmospheric pressure), it becomes liquid, LNG, and the strongly increased energy density makes it is possible to transport LNG by ships to customers even on a different continent. Because of this, LNG is a viable option for regions too distant from a pipeline and with a relatively small natural gas consumption. The LNG stored in a tank or terminal can after regasification be injected into a local pipeline network. Such a network can also transport locally produced upgraded biogas. Both gas sources may contribute to the energy independence of the region. The pipeline system can be expanded over the time and be adapted to the demand and conditions. Furthermore, local pipeline networks can in the future be used to store synthetic natural gas (SNG) produced using energy surplus from renewable sources. For customers with lower gas demands, truck transportation of LNG may be an option. The model for optimization described in this paper is applied on a case to find an optimal fuel distribution network, including network layout, pipe lengths and diameters, gas quantities transported to each consumer by pipeline or by a truck, storage locations and sizes, etc. The model also considers a potential supply of an alternative fuel to some or all of the customers from a more distant region to satisfy the energy demand. The model can be used to optimally design a new network, to study how to improve an existing network infrastructure to accommodate the demands of new customers and suppliers accessing the supply chain, or to enhance the operation efficiency of a network, for example, by optimization of the compressing stages.
2.1. Basic Assumptions. To study the feasibility of the network and its operation, the model must consider a number of technical and physical constraints. The gas transported is assumed to behave as an ideal gas and its chemical composition and physical characteristics, such as specific heat, c p , and higher heating value, H, remain constant. For nonideal gases, the model may be easily extended to considering compressibility factors that depend on temperature and pressure. However, since the temperature was fixed and the pressure range studied in this work was relatively limited, this option was not used. For simplicity, we further assume that the H and c p values are the same even though a gas from a different source is injected into the pipeline or delivered to the customer by truck. The flow rate of the gas is optimized during discrete periods of time e ∈ E, long enough (days, months) to consider the flow of the gas between the nodes (i,j ∈ I) to be at steady state. The transportation of the gas in the pipeline is driven by the pressure difference between the ends of each pipe, forcing the gas to flow from a node with a higher pressure to a node with a lower one. The mathematical expression of the pressure drop along the pipeline is nonlinear, which contributes to the complexity of the problem. However, we present a linearized formulation of the MINLP problem to enhance the solution. 42

Article
The pressure of the gas can be influenced externally by the active elements of the network, the compressors, which not only maintain an adequate pressure level to supply the gas to all the customers along the pipeline, but also yield a pressure within the given limits where the pipeline can operate. Restrictions of the maximum and minimum permitted pressure are applied to the compressor stations or in the nodes with customers demanding a contracted pressure level. In large transmission pipeline networks, the pressure drop is considerable so compressor stations usually appear along the pipeline, but in the local pipeline network model considered here, the compressors are only placed at each source node, where the gas is injected into the pipeline. The pressure of the regasified LNG and of the upgraded biogas is increased from atmospheric pressure to the pressure needed to meet the demands of all the customers connected to the pipeline. The gas leaving the discharge of the compressor is assumed to be cooled to the temperature of the surroundings, T amb , and the pipeline operates isothermally. The fuel supply chain is built to satisfy the needs of all the customers by supplying fuel through a pipe connection or by truck. In each case, a cost for the transportation of the gas, consisting of investment and operation costs, is imposed. In case the fuel is supplied by truck, a sufficiently large storage (corresponding to a demand of a given number of days) must be built at the consumer's node. Such storages can also be used as a source for smaller distributed pipeline networks, so the customers can cut the costs for building their own storage. As a result, a cost function to be optimized determines whether a pipeline network is viable and to which extent and how it should be combined with the truck transportation. The main constraints limiting the optimization model can be summarized as follows.
(1) The whole fuel demand must be covered by supply.
(2) The gas delivered by pipe must meet the contractual pressure demands. (3) If the gas is supplied by truck, the customer must build a storage.

Model Constraints. 2.2.1. Energy Demand.
A simplified scheme of the important features of the mathematical model of the local gas supply is presented in Figure 2. The energy demand, D i,e , in the consumer nodes must be covered by a supply of fuel during each period. The fuel can be supplied as regasified LNG from a pipe, O i,e , and alternatively, by truck: where H denotes the higher heating value of the respective fuel supplied.

Pipe
Transportation. If a node, i, is connected by a pipe of type r with another node j, the binary variable, y i,j,r = 1. Gas flows through a pipe during a given time period e only if the pipe is installed. A mass balance controls the flow through each node, ensuring that what flows into the node flows out of the node. The inflow to the node is a gas flow from another node, m j,i,r , or gas injected into the network at the node, S i,e . The gas outflow from the node is gas consumed at the node, O i,e , or gas flowing further along the network, m i,j,r : The flow of gas supplied from the main LNG source by pipe, S LNG,e , or by truck, L LNG, e , is limited by the capacity of the storage, expressed here as the maximum mass flow from an LNG storage: Furthermore, it is necessary to deliver the contracted gas pressurized to the level the customers require. Since the gas is compressed only at the source nodes where the gas is injected, the pressure drop in the pipes along the network must be considered. The pressure in the end node, p j , can be obtained as a function of the pressure in the start node, p i , the length of the pipe, l i,j , diameter, d i,j , the gas density, ρ i , and the friction factor, ζ, which is calculated with the help of the Haaland approximation of the Colebrook-White equation, 43 yielding

Industrial & Engineering Chemistry Research
This expression can be linearized for each pipe diameter separately with the help of a piecewise linearization procedure, 42 giving a new set of linear equations determining the squared pressure values in each node: , R g is the universal gas constant, and M denotes a large ("big M") number. The squared pressure term Π i,e = p i,e 2 is linearized further to obtain the values of the pressures in each node. In case multiple pipes enter the same node, the pressures at the entering point must be the same. The gas can only flow in one direction during a period e. With information about the pressure in the nodes, the energy needed for compression, P comp,i,e , can be determined. Compressing the gas from ambient temperature T amb,e in an ideal compressor in n stages yields the temperature: where the M̅ is the molar mass of the gas. The real temperature of the gas leaving the compressor is then where η ad is the adiabatic efficiency factor. The energy needed for compression is proportional to the duration of the time period, t e , to the amount of gas supplied at the injection site, and to the difference between the temperature of the gas entering and leaving the compression stage: The nonlinear expression of eq 6 can be tackled by piecewise linearization, but special attention should be given to eq 8, as it contains two inseparable continuous variables, making it more difficult to linearize. An alternative would be linearization with the help of triangulation of a rectangle as proposed by Martin et al. 21 for higher dimensional functions, but it considerably increases the computational complexity. Therefore, bilinear interpolation that approximates the value of the bilinear term to a good accuracy without adding a large number of binary values to the model was applied. 42 The value of the bilinear function was defined within a rectangular segment z by fitting the discretized data points within each segment to linear functions by least-squares. The selection among the segments was realized through a binary variable k z . The approximated value of the bilinear term h = S i,e × T i,e is then obtained with the help of the parameters, ψ, of the linearized model from An active segment is defined by the real temperature after compression, T i,e , and by the compressed gas supply, S i,e : where superscripts "high" and "low" denote the highest and lowest values of the segment. The approximated value can only be found in a single active segment, so The cost of compression, C comp,i,e , is the product of the power of compression, P comp,i,e , and the unit price of power, v pow . Gas supplied from an LNG storage by a pipe must be regasified and compressed before it is injected into the network. If the gas is transported from a storage by pipe, a gasification unit must be installed, considered by the constraint where g i is a binary variable, which is active (g i = 1) if a gasification unit is installed and an investment cost for the gasification unit, C gasif,i , is introduced. The amount of gas supplied cannot exceed a limit set by the capacity of the regasification unit.
2.2.3. Truck Supply. If a customer is not supplied with gas by pipe, the gas is transported to the node by truck. It can be supplied from the main LNG storage, with the amount L LNG, e , or from a more remote supplier (amount L Alt, e ), or a combination of both, yielding Alt, LNG, If the gas is supplied from the alternative supplier, a transportation cost, C truck dist , is considered. Additionally, a cost is put on the time needed for the transportation itself and for the loading and unloading times, C truck hour . The amount of gas a truck can transport is limited by its capacity, U truck . The number of trucks transporting the gas during each time period to a node is therefore , truck truck (12) If the trucks are loaded at the main LNG storage, there is a need for an adequate number of tanking lines, s, at the site. The capacity of a tanking line is limited by a given maximum number of trucks that it can accept during a day, N max , yielding the condition The truck supply cost to a node i is thus where the time required is obtained as distance traveled an average velocity. The cost of the tanking lines is C tank = sv tank , where v tank is the unit cost of constructing a tanking line. Because of space limitations at the site, a maximum number of tanking lines s max is specified. In the receiving nodes, there can only be gas supply by pipe, activated by y i,j,r or by a truck, so where f i,w is a binary variable determining whether a truck supplies gas from a source w (local LNG or the remote alternative source).

2.2.4.
Storage. The customers supplied by truck have to store the gas in their own storage, b i , of a type, a, which defines the capacity of the storage, U a stor . Constraints ensure that the appropriate storages are built. A tank offers the customers a possibility to store the gas for a longer period. Since the gas is mainly used for heat and power production, which are strongly influenced by the weather conditions, the size of the storage must be adequately chosen for the period with the highest demand. Therefore, the storage constructed must be able to accumulate a sufficient amount of gas for a multiple-day consumption during a cold period. This also applies to the case where the storage in a node is used as a source of a local gas network supplying neighboring nodes. For the sake of notational clarity, we will differentiate between the gas supplied to the node by truck to be consumed there, m i,e truck , and the gas that is injected and distributed further by the local pipeline, S i . The capacity of the storages to be built must therefore satisfy where q is the number of days for which the tank should be able to store the needed amount of gas. Using a unit price of the storage construction, v a stor , the investment in the storage is

Objective Function.
The objective is to minimize the sum of the investment and operation cost, where the operation cost includes the cost of the fuel supplied to the customers. The fuel supplied from the LNG port has a unit cost, v LNG so the resulting cost is The cost of the fuel supplied from other local producers can be expressed in a similar way. For the biogas, we have cost Bio, Bio (20) where the injected amount of biogas is S Bio,e and its unit cost is v Bio . The fuel supplied by truck from a remote source outside the region, with a unit fuel price, v LNG , gives the cost

LNG
Alt, The total cost of the fuel for period e is now Together with the cost of compression, C comp,i,e , and the cost of the truck supply, C truck,i,e , this gives the overall operational cost: A major cost of the infrastructure is the investment in the gas pipeline. The pipe cost, C pipe , is a cost calculated based on the unit pipe cost given for each type r of pipe, v r pipe , and the length of the realized pipeline network: The total investment cost over a year of operation, C invest , is obtained after discounting the cost of the gasification unit, of

Industrial & Engineering Chemistry Research
The objective function to be minimized is finally formulated considering the investment and operational cost for the whole network over a year of operation: 2.4. Numerical Solution. The MILP problem was solved with AIMMS implementing the Gurobi 6.5 solver. 44 AIMMS provides a flexible user interface through which one can represent graphically the nodes and connections included in the network. This facilitates the interpretation and organization of the optimization results.

CASE STUDY
The model developed will next be illustrated on an example of a small coastal region (Pori in southwest Finland) that is supplied by LNG to a terminal located close to a port. A number of potential customers are scattered in a nearby city and along a main highway leading to the city were identified, including larger industrial sites, smaller companies, and heat and power plants. The roads are seen as light pink lines in Figure 3, and the road network is thus existing. The options considered are to supply the consumers by regasified LNG from the terminal by pipeline, by LNG transported by truck to individual consumers, or to clusters of consumers connected by a local gas network. The trucked LNG comes from the terminal or from a distant supplier about 250 km from the consumers. A consumer supplied by truck needs a storage tank of an adequate size. Four different pipe sizes and three different storage tank sizes are considered, as presented in Table 1, and the storages were required to be sufficient for the 12 days of consumption. h Because there is no established market for LNG supply in Finland, these costs are rough estimates that consider the specific features of the cryogen liquid transported. The investment was projected for K = 30 years and was discounted with an interest rate of 5% (u = 0.05). In the linearization of the nonlinear terms, five segments are used as this was found to give a very accurate approximation. 42 The energy consumption of the consumers varies during the year and was treated by the procedure outlined in section 3.1. The higher heating value of the LNG

Industrial & Engineering Chemistry Research
Article and therefore also of the regasified natural gas is assumed to be constant. The upgraded biogas should be of a comparable quality and its heating value was also assumed to be H = 50 MJ/kg. The maximum number of tanking lines at the local terminal was N max = 10 and the average truck speed was 60 km/ h.

k-Medoids
Clustering for Multiperiod Treatment. To design an optimal energy supply network, the gas demands must be accurately estimated. In this study, where the true demands are unknown, a period of one year was selected, and the outside temperature was used to estimate the daily energy need of the nodes. As an optimization over all days of a year is computationally demanding, a limited number of periods representing typical consumption states were selected on the basis of ambient temperature data. k-Mediods 45 is like the kmeans algorithm a data clustering technique used to cluster a data set into k distinct clusters. In the algorithm, the distance between a centrally selected point and other data points belonging to the cluster is minimized using an iterative procedure. The method is less sensitive to outliers within the data set than the k-means method, 46 which uses a mean value within a cluster instead of a centroid.
The starting data used were the total daily average consumption of the natural gas in Finland from the years 2009−2011, rescaled to a maximum consumption of 800 MW of natural gas assumed to represent the maximum demand in the region of the study. The temperature profile and the resulting energy consumption are presented in Figure 4.
The k-medoids function was used within Matlab 47 to find 12 clusters, yielding ambient temperature, T amb, and the energy demand, D, for the medoids. These points were considered to be typical data points representing the demand and ambient temperatures in the region studied in a detailed consideration of the supply chain. The supply chain optimization process was divided into two stages. In the first stage, the pipeline network structure was optimized using the medoid characterizing the whole data set. After this, using a fixed pipeline network, the pressure levels, mass flows, and truck transportation were optimized on the conditions of the mediods that resulted when the data set was divided in 12 clusters of equal duration. The results of the k-medoid clustering are illustrated in Figure 5.
In Stage 1, an energy demand of 734 MW (and an ambient temperature of −11.1°C) representing the whole data set (circle in the top panel of Figure 5) is large enough to ensure that the pipeline network will be able to deliver the gas within all of the periods during the year. The difference between the result of the k-medoid algorithm and of the k-means algorithm, which locates the "average" approximately in the center of the data set, is striking. The temperatures and total consumption of the medoids of the data set divided into 12 clusters are represented as circles in the bottom panel of Figure 5. The temperatures vary from approximately −14°C in the coldest period with the largest consumption, 739 MW, to 21°C in the warmest period and an energy consumption of 277 MW.
The two-stage formulation results in a relatively large number of constraints and variables, especially in Stage 2, as can be seen in Table 2. However, the computational time for Stage 1 ranges from a few minutes up to six hours and in Stage 2 only about 20 s.
3.2. Fuel Cost Sensitivity. The supply chain to be optimized is depicted schematically in Figure 7 illustrating

Industrial & Engineering Chemistry Research
Article the location of the 23 nodes. Black dots denote customer nodes and black lines possible pipeline connections. The LNG port is marked by a blue dot. Considering the size of the LNG terminal, 30 000 m 3 , the maximum LNG supply to the region, was limited to 15 kg/s, which corresponds to approximately 1730 t/d or 3840 m 3 /d of LNG. Thus, the maximum supply yields a filling frequency of the LNG port of about 7 days, which is reasonable. The maximum pressure allowed within the pipeline network is 16 bar, and the minimum pressure at the customers is 4 bar, except for the power plant in node 4, which has a requirement of p = 10 bar. The customer energy demands during Stages 1 and 2 during the coldest Period 1 and warmest Period 12 are reported in Table 3. More detailed information about the customer energy demands is provided in Supporting Material 2. The supply chain was optimized under different price levels for the LNG supplied to the local port and the LNG delivered from the distant supplier. The nominal unit price of the fuel, 25 €/MWh, was expressed here as 100%, and the effect of changes around this point on the optimal supply chain was studied. The

Industrial & Engineering Chemistry Research
Article influence of the fuel price for 81 different cases is depicted in Figure 6 with circles of different color expressing the different solutions. Each color thus represents a configuration of the optimal network. There are three different solutions, arising for the points above, on, or below the "diagonal" in Figure 6, where the upper left triangle corresponds to a long pipeline network, the diagonal to a network of intermediate size, and the right lower triangle a small network. The results can thus be characterized by three solutions, for example, the ones where the price of the LNG supplied from the local terminal is kept at its nominal value (100%) and the price of the LNG from the remote supplies increases from 72% to 76% and further to 80% of the nominal price (enclosed by a rectangle in Figure 6). For such changes in the LNG price, there was already a clear effect on the optimal supply chain. The main results of the selected scenarios are summarized in Table 4.
For the first point, Case 1, it may be noted that supplying the fuel from the local LNG terminal and transporting it through long pipeline connections is not viable if the price of the LNG from the distant terminal is 28% lower as illustrated by the structure of the optimal supply chain in Figure 7A. Storage tanks in nodes 3, 18, and 21 (red dots), with LNG delivered from the distant terminal, supply the neighboring customers by gas with local pipeline networks. The local LNG terminal in node 1 supplies gas to node 4, a large heat and power plant, but this supply is complemented by regasified LNG from the storage in node 3. Thus, gasification and compression units must be built in these supply nodes. The compression need at the LNG terminal (node 1) is highest, 11.75 bar, in the coldest period (Period 1). Table 5 summarizes the compression pressures for Cases 1− 3 during Period 1 and Period 12. To illustrate the mass flows in such a distributed pipeline network with multiple supplying points during the coldest and warmest period, Figure 8 indicates the directions of the flow, the size of the pipes constructed, and the number and type of storages supplying the gas to the pipeline networks.
In Case 2, where the price of LNG from the distant source is 76% of the nominal price, the optimal supply chain has two separate pipeline networks, one large and one smaller at the farther consumer cluster (nodes 21−23), as seen in Figure 7B. The main supplier to the larger one is the local LNG terminal, while for the smaller network, the gas is supplied from the distant LNG terminal to a storage tank in node 21. This supply requires 196 truck trips during the coldest period. Compared to Case 1, the higher price of the alternative fuel makes the longer pipeline feasible and leads to an increase in the use of local fuel. The gas is compressed in the LNG port compression station to 15.8 bar during the coldest period.
Finally, for Case 3 ( Figure 7C), the pipeline network is extended to all customers, and some of the pipe dimensions have been increased. It is not economical to supply gas from the distant LNG terminal when the price of the LNG from this source is 80% of the nominal price. A pipe between nodes 17 and 21 connects the previously divided parts of the region. In this case, there is no need to supply alternative fuel. The compression need is lower due to the larger pipe diameters. The gas must be compressed to 14.6 bar at node 1 during Period 1.
3.3. Influence of Investment Cost. The system was reoptimized to analyze the consequences of changes in the investment costs on the optimal supply chain. Here, we

Industrial & Engineering Chemistry Research
Article illustrate the impact of storage costs and pipe investment costs on the solution. The model was optimized using costs that represent 50%, 75%, 100%, 125%, and 150% of the nominal costs. This gives 25 cases, which were each run for the fuel prices of Case 1 (100%,72%), Case 2 (100%,76%), and Case 3 (100%, 80%) studied in section 3.2, showing the combined influence of the fuel price level and the investment cost on the realized network structure. The total length of the pipeline network distinguishes the different solutions obtained. Figure 9 illustrates the resulting total length of the pipe network (left panel) together with its total cost (right panel) as calculated in eq 26 for all three cases.  It is evident that the increasing price of the alternative fuel has an impact on the network as it decreases the need for storage tanks supplied by alternative fuel. The length of the pipeline structure increases accordingly. The increasing alternative fuel price decreases the influence of the investment cost on the layout of the distribution. This is seen in the shape of the total cost "surface" in the right panels of Figure 9.
In Case 1, the lower price of alternative fuel (i.e., LNG from the distant terminal) is seen to allow for a delivery of alternative fuel by trucks and further distribution of it along the network. For instance, the solutions (50−75%,125−150%), depicted by light blue circles in Figure 9A, correspond to the network structure of Figure 10A. The high pipe price and low storage price have led to a solution with three storage sites (in addition to the LNG terminal), that is, at nodes 9, 18, and 21, and these supply local pipeline networks. The fourth storage supplies only node 4. Even though the total pipeline for this solution is not short, the length of the pipeline still generally decreases with the pipe price.
In Case 2 ( Figure 9B), LNG is supplied by truck from the alternative source only if the storage unit price is 50% of the base price. The higher alternative fuel price compared to Case 1 still results in solutions favoring truck transportation, as is seen in the (75%, 150%) solution depicted by a violet circle in Figure 9B; here, the alternative fuel covers more than half of the demand. The high price of pipes still leads to the construction  Table 1).

Industrial & Engineering Chemistry Research
Article of multiple storages and to the omission of unnecessary pipe connections, as can be seen in Figure 10B. Along with the increase of the storage cost, the pipeline structure tends to become longer and the clusters bigger until a full-length pipeline is built.
The total cost in Case 3 almost forms a plane (cf. right panel of Figure 9C), which means that it grows linearly with the unit price of storage tanks and pipes. Thus, the structural changes of the supply chain are small: pipeline transportation has become dominant at the higher alternative fuel price, and it is favorable to use the local gas rather than LNG from the distant terminal, and this results in fewer or no storage tanks in the optimal solutions. For Case 3, only two types of network structure are present compared to eight network structures in Case 1 and eight in Case 2. In both of these supply chains, only regasified LNG from the local terminal is supplied to the customers, and there is no truck transport of LNG from the distant terminal.
3.4. Biogas Injection. The option to use biogas was finally studied by making it possible to inject biogas at node 2 (≤2 kg/ s) and at node 3 (≤3 kg/s). The maximum biogas supply thus corresponds to roughly 1/3 of the total fuel demand. The biogas was found to cover the local demand in most of the cases until its price reached the nominal price level. Figure 8 illustrates the mass flows for Periods 1 and 12 in the case where it is possible to incorporate biogas in the supply chain and where its price equals the price of the alternative LNG, but represents 76% of the LNG price in the local LNG terminal. As the biogas price increases, the benefit of using it to substitute regasified LNG decreases. It should be noted that several countries in Europe have subsidies for integration of biogas in the existing energy systems, and such support would naturally make the use of biogas more attractive from an economic point of view. However, such options were considered outside the scope of the present study.

SUMMARY OF RESULTS
A local gas distribution system consisting of an LNG terminal as main supply and 23 customers with different demands during the year has been studied by optimizing the supply chain. A stage-wise optimization decreased the computational demands considerably, using data for 12 periods instead of daily data for characterizing the changes in the demand and ambient temperature over the year. The optimization problem is still quite large, but the solution time is short enough to make sensitivity analysis possible, for example, to evaluate the effect of the fuel price and costs related to investment in infrastructure (mainly in pipes and storages). The computational complexity and time have been reported in section 3.1. In all the cases studied, truck transportation of LNG from the distant terminal was favored over the use of LNG from the local terminal if the price of the former fuel was substantially (around 25%) lower than that of the latter. Nevertheless, the inclusion of new gas sources, such as biogas plants, in the supply chain decreases the dependence on a single gas supplier and increases the flexibility of the distribution network as it may reduce the need to transport the regasified LNG longer distances.

CONCLUSIONS AND FUTURE WORK
The paper has presented a model for optimization of regional gas supply systems including sources such as LNG terminals and biogas plants and distribution by pipelines or by LNG trucks to storage tanks. The model can be used to study the sensitivity of the optimal supply chain to changes in the prices of fuel and infrastructure (pipes, storage tanks, etc.) or changes in the fuel demand. The network topology can easily be adjusted to describe new regions, and external constraints can be imposed to reflect the local conditions. The optimization is based on a linearized system of equations, and by applying the proposed two-stage optimization process, the computational demand stays reasonable even for multiperiod tasks.
For the cases studied in the paper, the length of the pipeline networks and subnetworks was influenced by the unit price of pipes and tanks. Still, the fuel price was found to have a decisive role for the arising solutions by determining whether alternative fuel is supplied by truck to storages along the network or if it is more beneficial to build a more extensive pipeline. A relatively small and simplified network was studied, but the mathematical formulation can be applied to more general and larger systems that better reflect realistic distribution networks. It is also possible to modify the formulation to minimize other objectives, for example, primary energy use or harmful emissions of the supply chain, or to develop the method to consider multiobjective optimization of conflicting goals. If environmental aspects are part of the optimization, the effect of truck and pipe transportation, installation of infrastructure, and emissions of the fuel supplied and fuel replaced must be considered. This would require reliable estimates of emission factors. Another potential extension of the work would be to consider the LNG supply chain to the terminals. 48 ■ ASSOCIATED CONTENT

* S Supporting Information
The Supporting Information is available free of charge on the ACS Publications website at DOI: 10 Parameters c p = specific heat capacity, kJ/(kg K) C = cost, € d = pipe diameter, m D = energy demand at node, MW e = period, time period H = heating value, MJ/kg K = life length of investment, a l = pipe length, m M = large positive constant ("big M") M̅ = average molar mass of natural gas, kg/kmol n = number of compression steps R g = universal gas constant, J/(mol K) t = duration of a period, d u = interest rate U = capacity, kg v = unit cost, €/kWh or €/m Sets A = storage type a ∈ A I = nodes i ∈ I in E = period e ∈ E J = nodes j ∈ J out R = pipe diameter type r ∈ R W = fuel type w ∈ W Greek η = efficiency factor ζ = friction factor ρ = density, kg/m 3 ψ = parameters of the linearized model γ = parameter of the linearized model Superscripts alt = alternative fuel BIO = biogas dist = distance traveled hour = hourly truck use high = higher limit low = lower limit LNG = liquefied natural gas max = maximum mass flow NG = natural gas pow = power stor = storage tot = total Subscripts a = storage type ad = adiabatic alt = alternative fuel amb = ambient BIO = biogas comp = compressor e = time period gasif = gasification cost i = node invest = investment cost j = node LNG = liquefied natural gas NG = natural gas op = operational cost pipe = pipe investment r = pipe type truck = truck transportation stor = storage sup = supply node w = fuel type used z = segment