The Description and Formulation of the Natural Gas Planning Problem

Description of the natural gas planning problem

You run a very small natural gas company. At the beginning of each year you decide how much gas to purchase to sell to your customers and how much to store for the following year. In this example, you know the demand for the entire year at the beginning of the year when you make the purchase.

It is currently the beginning of Year 1. You know that demand for natural gas will be 10 units and will cost $1 per unit.

Your board of directors is tired of short-term planning and would like you to optimize the gas purchases for a two-year time frame. You can buy extra natural gas and store it for next year. Storing 1 unit of natural gas costs $0.05. Your board feels that it may be wise to store natural gas for the following year if the price and demand are expected to be high in the following year.

If the demand and price of natural gas were known for Year 2, it would be possible to form a linear program and optimize the gas purchase. Without this information, it is not possible to optimize the problem beforehand. Even so, the decision must be made and must be made in some "optimal" way.

Since one year does not vary too much from previous years, it is possible to generate some likely scenarios for the price and demand in Year 2. Even though we will not know which scenario actually takes place, being able to plan for the different scenarios should assist in our planning problem.

What does one do with the scenarios? There are a few ways of using the information:

The interactive part of the case study allows you to

The computer will formulate and solve a linear program for each two-period problem, one for each scenario. The computer will also solve the "average" scenario problem. Given the optimal first-period purchase amount for all of these cases, you must decide how much gas to purchase in Year 1.

The computer will compare your strategy with

Good luck!


Verbal formulation of the natural gas planning problem

Minimize the "cost of the strategy" 

subject to the requirements: 
   -Meet demand in each time period by purchasing gas or using 
        it from storage
   -Store gas that is not used in the current time period
   -Storage can never be less than 0 (no borrowing)
In order to create a mathematical version of this model, we need to define some variables:
 
  Buy[year]    = amount of gas purchased in year
  Use[year]    = amount of gas used from storage in year
  Store[year]  = amount of gas to store in year

and some parameters:

 
  Cost[year]   = price per unit of natural gas in year
  Demand[year] = demand for gas during year
  StorageCost  = cost to store 1 unit of gas for one year


Mathematical Formulation

Minimize (sum Price[t] * Buy[t]) + (sum Store[t] * StorageCost)

subject to:
  Buy[t] + Use[t] >= Demand[t],               t in (1,2)
  Store[t] = Store[t-1] + Buy[t] - Demand[t], t in (1,2)
  Use[t] <= Store[t-1],                       t in (1,2)


The AMPL code actually used is provided below.


param LastPeriod > 0;            # Number of periods in the model

param PurchasePrice{0..LastPeriod} >= 0;
param Demand       {0..LastPeriod} >= 0;
param Probability  {0..LastPeriod} >= 0;

param StorageCost > 0;

# VARIABLES #

var Purchase       {0..LastPeriod} >= 0;
var UseFromStorage {0..LastPeriod} >= 0;
var Storage        {-1..LastPeriod} >= 0;

# OBJECTIVE FUNCTION #

minimize TotalCost:
  sum{t in 0..LastPeriod} 
    (PurchasePrice[t] * Purchase[t] + StorageCost * Storage[t]);

# CONSTRAINTS #

subject to MeetDemand{t in 0..LastPeriod}:
  Purchase[t] + UseFromStorage[t] >= Demand[t];

subject to StorageBalance{t in 0..LastPeriod}:
  Storage[t] = Storage[t-1] + Purchase[t] - Demand[t];

subject to UseLessThanHave{t in 0..LastPeriod}:
  UseFromStorage[t] <= Storage[t-1];

subject to InitialStorage:
  Storage[-1] = 0;