23 Importing Energy (import)

Run LPL Code  ,  PDF Document

Problem

Coal, gas and nuclear fuel can be imported in order to satisfy the energy demands of a country. Three grades of gas and coal (low, medium, high) and one grade of nuclear fuel may be imported. The costs are known. Furthermore, there are upper and lower limits in the imported quantities from a country. What quantities should be imported if the import cost have to be minimized? (The model is from [10]). In addition, three additional conditions must be fulfilled:

  1. A supply condition: Each country can supply either up to three (non-nuclear) low or medium grade fuels or nuclear fuel and one high grade fuel.

  2. Environmental restriction: Environmental regulations require that nuclear fuel can be used only if medium and low grades of gas and coal are excluded.

  3. Energy mixing condition: If gas is imported then either the amount of gas energy imported must lie between 40-50 percent and the amount of coal energy must be between 20-30 percent of the total energy imported or the quantity of gas energy must lie between 50-60 percent and coal is not imported.

Modeling Steps

Three index-set define are defined: i I = {low, medium, high} the grade fuel, j J = {coal, gas} the non-nuclear energy sources, and k K = {GR, FR, IC} the countries from where to import. Nuclear energy is treated apart because it come only in one grade.

  1. The data are defined and explained in the model code (see parameter section).

  2. We first introduce two continuous variables: the quantity of non-nuclear fuel (xi,j,k) and the quantity of nuclear fuel (yk).

  3. The sum of all imports must be the desired energy amount e. Hence we have

    ∑          ∑
    xi,j,k +    yk = e
i,j,k         k
  4. The import costs are to be minimized. Hence:

         ∑              ∑
min      ci,j,kxi,j,k +     nckyk)
     i,j,k            k
  5. The three logical requirements are modeled as follows. Boolean predicates (binaries) are introduced to link the mathematical with the logical part of the model. Let Pi,j,k be a predicate with the definition: “If at least li,j,k or at most ui,j,k of non-nuclear energy is imported then Pi,j,k”. For the nuclear energy a similar definition is introduced: “If at least nlk or at most nuk of nuclear energy is imported then Nk”. We have:

    Pi,j,k  ←  (li,j,k ≤ xi,j,k ≤ ui,j,k)   forall i,j,k
Nk    ←  (nlk ≤ yk ≤ nuk )      forall k
  6. In condition 3, two other predicates are needed: “If the total amount of non-nuclear imported fuel, lays between 40-50% for gas and 20-30% for coal of the total imported non-nuclear fuel then Qj”, and “if imported gas is between 50-60% of the total imported non-nuclear fuel then R”. Hence:

                  ∑
Qj  ←  (eLj ≤    i,k xi,j,k ≤ eUj)  forall j
R   ←  (eA ≤  ∑    x ′  ′ ≤  eB )
                i,k  i,gas,k
  7. Using these predicates, the three conditions are formulated as follows:

    1. “For each country k, either at most 3 of Pi,j,k (with i = high) are true or Nk is true and exactly one Phigh,j,k is true”

    2. “At least one Nk is true, only if none of Pi,j,k is true (with i = high)” and

    3. “If any of Pi,gas,k is true, then either Qj is true or R is true and none of Pi,coal,k is true.

Some remarks on the formulations

  1. The first condition has the form: “for each k, either A or B”. Normally, “either ... or” is translated as exclusive or, but sometimes we just mean or (non-exclusive). It depends on the context. Here we want to say that A and B cannot both be true at the same time. Therefore we have: A∨˙B.

  2. The second condition has the form: “A only if B” which is simply A B.

  3. The third condition has the form: “If A then (either B or (C and D))”, which is A (B  ˙
∨ (C D)).


Listing 16: The Complete Model implemented in LPL [13]
model ImportEnergy "Importing Energy"; 
  set 
    i   := [low med high] "Quality grades of energy"; 
    j   := [gas, coal]    "Non-nuclear energy sources"; 
    k   := [GB FR IC]     "Countries exporting energy"; 
  parameter 
    c{i,j,k} "Non-nuclear energy cost"; 
    l{i,j,k} "Lower bound on the quantity of non-nuclear energy"; 
    u{i,j,k} "Upper bound on the quantity of non-nuclear energy"; 
    nc{k}    "Nuclear energy cost"; 
    nl{k}    "Lower bound on the quantity of nuclear energy"; 
    nu{k}    "Upper bound on the quantity of nuclear energy"; 
    e        "Desired energy amount to import"; 
    L{j}     "Min percent of energy if coal and gas are imported"; 
    U{j}     "Max percent of energy if coal and gas are imported"; 
    A        "Min percent of gas if gas energy only is imported"; 
    B        "Max percent of gas if gas energy only is imported"; 
  variable 
    x{i,j,k} [0..u] "Quantity of non-nucl energy imported"; 
    y{k} [0..nu]    "Quantity of nucl energy imported"; 
  binary variable 
    P{i,j,k} <- l<=x; 
    N{k}     <- nl<=y; 
    Q{j}     <- e*L <= sum{i,k} x <= e*U; 
    R        <- e*A <= sum{i,k} x[i,'gas',k] <= e*B; 
  constraint 
    ImportReq : sum{i,j,k} x + sum{k} y = e; 
    C1{k}: atmost(3){i,j|i<>'high'} P xor (N and 
           xor{j} P['high',j,k]); 
    C2: or{k} N  -> nor{i,j,k|i<>'high'} P; 
    C3: or{i,k}P[i,'gas',k] -> and{j}Q xor R and 
        nor{i,k}P[i,'coal',k]; 
  minimize Cost: sum{i,j,k} c*x + sum{k} nc*y; 
  Writep(Cost,x,y,P,N,Q,R); 
  model data; 
    e        := 12000; 
    c{i,j,k} := Rnd(1,4);     nc{k}    := Rnd(1,3); 
    l{i,j,k} := Rnd(10,40);   u{i,j,k} := Rnd(1000,2000); 
    nl{k}    := Rnd(20,30);   nu{k}    := Rnd(1000,5000); 
    L{j}     := [0.20 0.40];  U{j}     := [0.30 0.50]; 
    A        := 0.50;         B        := 0.60; 
  end 
end