Lindo Systems

MODEL:
! Choosing which processes and plants to use to meet steel demand,
  The Mexican Steel problem;
! Keywords: Inventory, Production,  Product management, Sales, Steel industry;
! Ref: Kendrick, D, Meeraus, A, and Alatorre, J, 
    The Planning of Investment Programs in the Steel Industry. 
    The Johns Hopkins University Press, Baltimore and London, 1984; 
 SETS:
   ! Steel plants;
  PLANT :
   RD2, MUE;
   ! Markets;
  MARKET : DD, RD3, MUV;
   ! Final products;
  CF : PV, PE, EB;
   ! Intermediate products;
  CI;
   ! Raw materials;
  CR: PD;
   ! Processes;
  PR ;
   ! Productive units;
  UNIT ;
   ! ;
  CRXP( CR, PR) : A1;
  CIXP( CI, PR) : A2;
  CFXP( CF, PR) : A3; 
  UXP( UNIT, PR) : B;
  UXI( UNIT, PLANT) : K; 
  PXM( PLANT, MARKET) : RD1, MUF;
  PXI( PR, PLANT) : Z; 
  CFXPXM( CF, PLANT, MARKET) : X;
  CRXI( CR, PLANT) : U;
  CFXI( CF, PLANT) : E;
  CFXM( CF, MARKET) : D, V;
 ENDSETS
 ! Variables:
   z(p,i) = tons for process p, plant i,
   x(c,i,j) = tons shipped of final product c, plant i, market j,
   u(c,i) = tons purchased of raw matl c, plant i,
   v(c,j) = tons imported of matl c, market j,             
   e(c,i) = tons exported matl c, plant i,                        
   phi  = US$ total cost,                      
   phipsi = US$ of raw material cost,               
   philam = US$  of transport cost,                  
   phipi  = US$  of import cost,                            
   phieps = US$  of export revenue ;

  ! Demand equations;
   @FOR( CFXM( C, J):
     D( C, J) = DMDBASE * ( 1 + DMDREQU/ 100) * DD( J)/ 100);

  ! Compute Transport rates, final products;
   @FOR( PXM( I, J)| RD1( I, J) #GT# 0:
      MUF( I, J) =  TRBASE + RRDR * RD1( I, J));
   @FOR( PXM( I, J)| RD1( I, J) #LE# 0: 
      MUF( I, J) = 0);

  ! Compute Transport rates, exports;
   @FOR( PLANT( I)| RD2( I) #GT# 0:
     MUE( I) = TRBASE + RRDR * RD2( I));
   @FOR( PLANT( I)| RD2( I) #LE# 0: MUE( I) = 0);

  ! Compute Transport rates, imports;
   @FOR( MARKET( J)| RD3( J) #GT# 0:
      MUV( J) = TRBASE + RRDR * RD3( J));
   @FOR( MARKET( J)| RD3( J) #LE# 0: MUV( J) = 0);

  ! For each plant I1;
   @FOR( PLANT( I1):
    ! Sources >= uses, final products;
     @FOR( CF( CF1): [MBF]
       @SUM( PR( P1): A3( CF1, P1) * Z( P1, I1)) >=
       @SUM( MARKET( J1): X( CF1, I1, J1)) 
     + E( CF1, I1));
    ! Intermediate products;
     @FOR( CI( CI1): [MBI]
      @SUM( PR( P1): A2( CI1, P1) * 
       Z( P1, I1)) >= 0);
    ! Raw materials, material balance;
     @FOR( CR( CR1): [MBR]
        @SUM( PR( P1): A1( CR1, P1) * Z( P1, I1))
      + U( CR1, I1) >= 0);
    ! Capacity of each productive unit M1;
     @FOR( UNIT( M1): [CC]
      @SUM( PR( P1): B( M1, P1) * Z( P1, I1)) <=
       K( M1, I1));
   );

  ! For each final product CF1;
   @FOR( CF( CF1):
    ! Demand requirements for each market J1;
     @FOR( MARKET( J1): [MR]
      @SUM( PLANT( I1): X( CF1, I1, J1)) + V( CF1, J1)
       >= D( CF1, J1));
    ! Upper limit on exports ;
     [ME] @SUM( PLANT( I1): E( CF1, I1)) <= EB( CF1);
   );
  ! Components of objective;
   PHIPSI = @SUM( CR( CR1): 
    @SUM( PLANT( I1): PD(CR1) * U(CR1, I1)));  ! RM cost;
   PHILAM = @SUM( CF( CF1):
               @SUM( PLANT(I1): 
                  @SUM( MARKET(J1):MUF(I1,J1)* X( CF1, I1, J1)))
             + @SUM( MARKET( J1): MUV( J1) * V( CF1, J1)) 
             + @SUM( PLANT( I1): MUE( I1) * E( CF1, I1))); ! Transport cost;
   PHIPI = @SUM( CFXM( CF1, I1):  
    PV( CF1) * V( CF1, I1));       ! Import cost;
   PHIEPS = @SUM( CFXP( CF1, I1): 
    PE( CF1) * E( CF1, I1));       ! Export revenue;
   [OBJROW] MIN = PHIPSI + PHILAM + PHIPI - PHIEPS;
 DATA:
   DMDBASE = 5.209; ! Base total demand;
   DMDREQU = 40;    ! Raw steel equivalence;
   TRBASE = 2.48;   ! Transport base rate;
   RRDR = 0.0084;   ! Rail rate per distance;
  ! Plants available to us;
  PLANT = AHMSA FUNDIDA SICARTSA HYLSA HYLSAP;
  MARKET = MEXICO MONTE GUADA; ! Markets where we can sell stuff; 
 ! Final commodities/productss;
  CF  = STEEL; 
   ! Intermediate products;
  CI = SPONGE PIGIRON;
   ! Raw materials;
  CR = PELLETS COKE NATGAS ELECTRIC SCRAP;
   ! Processes;
  PR = PIGIRON1 SPONGE1 STEELOH STEELEL STEELBOF;
   ! Productive units;
  UNIT = BLASTFUR OPENHEAR BOF DIRECT ELECARC;
  ! For each material and process;
  A1= -1.58, -1.38, 0,    0,    0,
      -0.63,  0,    0,    0,    0,
       0,    -0.57, 0,    0,    0,
       0,     0,    0,   -0.58, 0,
       0,     0,   -0.33, 0,   -0.12;
  ! For each intermediate product and process;
  A2=  1,     0,   -0.77, 0,   -0.95,
       0,     1,    0,   -1.09, 0;
  ! For each final product and process;
  A3=  0,     0,    1,    1,    1;
 ! For each production unit and process;
  B = 1 0 0 0 0
      0 0 1 0 0
      0 0 0 0 1
      0 1 0 0 0
      0 0 0 1 0;
 ! For each unit and plant;
  K = 3.25, 1.40, 1.10, 0,    0,
      1.50, 0.85, 0,    0,    0,
      2.07, 1.50, 1.30, 0,    0,
      0,     0,   0,    0.98, 1,
      0,     0,   0,    1.13, 0.56;
 ! For each plant and market;
  RD1= 1204  218   1125
       1017  0     1030
       819  1305   704
       1017  0     1030
       185  1085   760;
 ! For each plant;
  RD2 = 739, 521,  0, 521, 315;
 ! For each market;
  RD3 = 428, 521,  300;
 ! For each raw material;
  PD = 18.7, 52.17, 14,    24,  105;
 ! For each final product;
  PV = 150;
  PE = 140;
  EB = 1;
 ! For each market;
  DD = 55, 30, 15;
 ENDDATA
END