GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 10/22/14 09:17:59 Page 1
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
C o m p i l a t i o n


   1  Sets
   2   
   3  G in dex of generators /g1*g2/
   4  N index of buses /n1*n3/
   5  MAP(G,N) indicates in what bus are the generators connected /g1.n1, g2.n2/
   6   
   7  Parameters
   8  load(n)   load at bus N   /N3 0.85/
   9   
  10  Table Gdata(G,*) Generator input data
  11                     Pmin         Pmax         cost
  12  *                  (KW)         (KW)         ($/MWh)
  13  g1                 0.15         0.6          6
  14  g2                 0.10         0.4          7       ;
  15   
  16  Table Ldata(N,N,*)    line input data
  17                     Sus          Limit
  18  *                  (S)          (KW)
  19  n1.n2              2.5          0.3
  20  n1.n3              3.5          0.5
  21  n2.n1              2.5          0.3
  22  n2.n3              3.0          0.4
  23  n3.n1              3.5          0.5
  24  n3.n2              3.0          0.4   ;
  25   
  26  Variables
  27   
  28  z                 objective function
  29  p(g)              output power of generator g
  30  d(n)              angle at bus n ;
  31  p.lo(g)= gdata(g,'pmin');
  32  p.up(g)= gdata(g,'pmax');
  33  d.fx('n3')=0;
  34   
  35  Equations
  36   
  37  cost             objective function
  38  Maxpow(n,n)      maximum line power limit
  39  Minpow(n,n)      minimum line power limit
  40  Loadbal(n)       load balance equation ;
  41  Alias(n,np);
  42   
  43   
  44  cost..              z=e=sum(g,gdata(g,'cost')*p(g));
  45   
  46  Maxpow(n,np)..      ldata(n,np,'sus')*(d(n)-d(np))=l=ldata(n,np,'limit');
  47   
  48  Minpow(n,np)..      ldata(n,np,'sus')*(d(n)-d(np))=g=-ldata(n,np,'limit');
  49   
  50  Loadbal(n).. sum(g $ map(g,n), p(g))+sum(np,ldata(n,np,'sus')*(d(n)-d(np))
      )=e=load(n);
  51   
  52  Model ED /all/;
  53   
  54  solve ed  using lp minimizing z;
  55   
  56  display p.l, d.l, z.l;


COMPILATION TIME     =        0.016 SECONDS      3 MB  24.3.3 r48116 WEX-WEI
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 10/22/14 09:17:59 Page 2
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Equation Listing    SOLVE ED Using LP From line 54


---- cost  =E=  objective function

cost..  z - 6*p(g1) - 7*p(g2) =E= 0 ; (LHS = -1.6, INFES = 1.6 ****)
     

---- Maxpow  =L=  maximum line power limit

Maxpow(n1,n2)..  2.5*d(n1) - 2.5*d(n2) =L= 0.3 ; (LHS = 0)
     
Maxpow(n1,n3)..  3.5*d(n1) - 3.5*d(n3) =L= 0.5 ; (LHS = 0)
     
Maxpow(n2,n1)..  - 2.5*d(n1) + 2.5*d(n2) =L= 0.3 ; (LHS = 0)
     
REMAINING 3 ENTRIES SKIPPED


---- Minpow  =G=  minimum line power limit

Minpow(n1,n2)..  2.5*d(n1) - 2.5*d(n2) =G= -0.3 ; (LHS = 0)
     
Minpow(n1,n3)..  3.5*d(n1) - 3.5*d(n3) =G= -0.5 ; (LHS = 0)
     
Minpow(n2,n1)..  - 2.5*d(n1) + 2.5*d(n2) =G= -0.3 ; (LHS = 0)
     
REMAINING 3 ENTRIES SKIPPED


---- Loadbal  =E=  load balance equation

Loadbal(n1)..  p(g1) + 6*d(n1) - 2.5*d(n2) - 3.5*d(n3) =E= 0 ;
     
      (LHS = 0.15, INFES = 0.15 ****)
     
Loadbal(n2)..  p(g2) - 2.5*d(n1) + 5.5*d(n2) - 3*d(n3) =E= 0 ;
     
      (LHS = 0.1, INFES = 0.1 ****)
     
Loadbal(n3)..  - 3.5*d(n1) - 3*d(n2) + 6.5*d(n3) =E= 0.85 ;
     
      (LHS = 0, INFES = 0.85 ****)
     
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 10/22/14 09:17:59 Page 3
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Column Listing      SOLVE ED Using LP From line 54


---- z  objective function

z
                (.LO, .L, .UP, .M = -INF, 0, +INF, 0)
        1       cost


---- p  output power of generator g

p(g1)
                (.LO, .L, .UP, .M = 0.15, 0.15, 0.6, 0)
       -6       cost
        1       Loadbal(n1)
        0       (OLD LEVEL ****)

p(g2)
                (.LO, .L, .UP, .M = 0.1, 0.1, 0.4, 0)
       -7       cost
        1       Loadbal(n2)
        0       (OLD LEVEL ****)


---- d  angle at bus n

d(n1)
                (.LO, .L, .UP, .M = -INF, 0, +INF, 0)
        2.5     Maxpow(n1,n2)
        3.5     Maxpow(n1,n3)
       -2.5     Maxpow(n2,n1)
       -3.5     Maxpow(n3,n1)
        2.5     Minpow(n1,n2)
        3.5     Minpow(n1,n3)
       -2.5     Minpow(n2,n1)
       -3.5     Minpow(n3,n1)
        6       Loadbal(n1)
       -2.5     Loadbal(n2)
       -3.5     Loadbal(n3)

d(n2)
                (.LO, .L, .UP, .M = -INF, 0, +INF, 0)
       -2.5     Maxpow(n1,n2)
        2.5     Maxpow(n2,n1)
        3       Maxpow(n2,n3)
       -3       Maxpow(n3,n2)
       -2.5     Minpow(n1,n2)
        2.5     Minpow(n2,n1)
        3       Minpow(n2,n3)
       -3       Minpow(n3,n2)
       -2.5     Loadbal(n1)
        5.5     Loadbal(n2)
       -3       Loadbal(n3)

d(n3)
                (.LO, .L, .UP, .M = 0, 0, 0, 0)
       -3.5     Maxpow(n1,n3)
       -3       Maxpow(n2,n3)
        3.5     Maxpow(n3,n1)
        3       Maxpow(n3,n2)
       -3.5     Minpow(n1,n3)
       -3       Minpow(n2,n3)
        3.5     Minpow(n3,n1)
        3       Minpow(n3,n2)
       -3.5     Loadbal(n1)
       -3       Loadbal(n2)
        6.5     Loadbal(n3)

GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 10/22/14 09:17:59 Page 4
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Model Statistics    SOLVE ED Using LP From line 54


MODEL STATISTICS

BLOCKS OF EQUATIONS           4     SINGLE EQUATIONS           16
BLOCKS OF VARIABLES           3     SINGLE VARIABLES            6  2 projected
NON ZERO ELEMENTS            38


GENERATION TIME      =        0.125 SECONDS      4 MB  24.3.3 r48116 WEX-WEI


EXECUTION TIME       =        0.125 SECONDS      4 MB  24.3.3 r48116 WEX-WEI
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 10/22/14 09:17:59 Page 5
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Solution Report     SOLVE ED Using LP From line 54


               S O L V E      S U M M A R Y

     MODEL   ED                  OBJECTIVE  z
     TYPE    LP                  DIRECTION  MINIMIZE
     SOLVER  CPLEX               FROM LINE  54

**** SOLVER STATUS     1 Normal Completion         
**** MODEL STATUS      1 Optimal                   
**** OBJECTIVE VALUE                5.3845

 RESOURCE USAGE, LIMIT          0.421      1000.000
 ITERATION COUNT, LIMIT         0    2000000000

IBM ILOG CPLEX   24.3.3 r48116 Released Sep 19, 2014 WEI x86 64bit/MS Windows 
Cplex 12.6.0.1

Space for names approximately 0.00 Mb
Use option 'names no' to turn use of names off
LP status(1): optimal
Cplex Time: 0.05sec (det. 0.01 ticks)
Optimal solution found.
Objective :           5.384524


                       LOWER     LEVEL     UPPER    MARGINAL

---- EQU cost            .         .         .        1.000      

  cost  objective function

---- EQU Maxpow  maximum line power limit

         LOWER     LEVEL     UPPER    MARGINAL

n1.n2     -INF     -0.065     0.300      .         
n1.n3     -INF     -0.500     0.500      .         
n2.n1     -INF      0.065     0.300      .         
n2.n3     -INF     -0.350     0.400      .         
n3.n1     -INF      0.500     0.500    -2.548      
n3.n2     -INF      0.350     0.400      .         

---- EQU Minpow  minimum line power limit

         LOWER     LEVEL     UPPER    MARGINAL

n1.n2    -0.300    -0.065     +INF       .         
n1.n3    -0.500    -0.500     +INF       .         
n2.n1    -0.300     0.065     +INF       .         
n2.n3    -0.400    -0.350     +INF       .         
n3.n1    -0.500     0.500     +INF       .         
n3.n2    -0.400     0.350     +INF       .         

---- EQU Loadbal  load balance equation

      LOWER     LEVEL     UPPER    MARGINAL

n1      .         .         .        6.000      
n2      .         .         .        7.000      
n3     0.850     0.850     0.850     7.833      

                       LOWER     LEVEL     UPPER    MARGINAL

---- VAR z              -INF      5.385     +INF       .         

  z  objective function

---- VAR p  output power of generator g

      LOWER     LEVEL     UPPER    MARGINAL

g1     0.150     0.565     0.600      .         
g2     0.100     0.285     0.400      .         

---- VAR d  angle at bus n

      LOWER     LEVEL     UPPER    MARGINAL

n1     -INF     -0.143     +INF       .         
n2     -INF     -0.117     +INF       .         
n3      .         .         .         EPS       


**** REPORT SUMMARY :        0     NONOPT
                             0 INFEASIBLE
                             0  UNBOUNDED
GAMS 24.3.3  r48116 Released Sep 19, 2014 WEX-WEI x86 64bit/MS Windows 10/22/14 09:17:59 Page 6
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
E x e c u t i o n


----     56 VARIABLE p.L  output power of generator g

g1 0.565,    g2 0.285


----     56 VARIABLE d.L  angle at bus n

n1 -0.143,    n2 -0.117


----     56 VARIABLE z.L                   =        5.385  objective function


EXECUTION TIME       =        0.000 SECONDS      3 MB  24.3.3 r48116 WEX-WEI


USER: GAMS Development Corporation, Washington, DC   G871201/0000CA-ANY
      Free Demo,  202-342-0180,  sales@gams.com,  www.gams.com   DC0000


**** FILE SUMMARY

Input      C:\Users\Modarres\Documents\gamsdir\projdir\Untitled_2.gms
Output     C:\Users\Modarres\Documents\gamsdir\projdir\Untitled_2.lst
