DEDESS : Cost based Dynamic Economic Dispatch integrated with Energy Storage

Reference

  • Alireza Soroudi, Power System Optimization Modelling in GAMS, Model DEDESS (Gcode7.1) in chapter Energy Storage Systems, 2017

Category : GAMS PSOPT library


Mainfile : DEDESS.gms

$title Cost based Dynamic Economic Dispatch integrated with Energy Storage

$onText
For more details please refer to Chapter 7 (Gcode7.1), of the following book:
Soroudi, Alireza. Power System Optimization Modeling in GAMS. Springer, 2017.
--------------------------------------------------------------------------------
Model type: QCP
--------------------------------------------------------------------------------
Contributed by
Dr. Alireza Soroudi
IEEE Senior Member
email: alireza.soroudi@gmail.com
We do request that publications derived from the use of the developed GAMS code
explicitly acknowledge that fact by citing
Soroudi, Alireza. Power System Optimization Modeling in GAMS. Springer, 2017.
DOI: doi.org/10.1007/978-3-319-62350-4
$offText

Set
   t 'hours'         / t1*t24 /
   g 'thermal units' / p1*p4  /;

Table gendata(g,*) 'generator cost characteristics and limits'
       a     b      c    d     e     f     Pmin  Pmax  RU0  RD0
   p1  0.12  14.80  89   1.2  -5     3     28    200   40   40
   p2  0.17  16.57  83   2.3  -4.24  6.09  20    290   30   30
   p3  0.15  15.55  100  1.1  -2.15  5.69  30    190   30   30
   p4  0.19  16.21  70   1.1  -3.99  6.2   20    260   50   50;

Table data(t,*)
        lambda  load  wind
   t1   32.71   510   44.1
   t2   34.72   530   48.5
   t3   32.71   516   65.7
   t4   32.74   510   144.9
   t5   32.96   515   202.3
   t6   34.93   544   317.3
   t7   44.9    646   364.4
   t8   52      686   317.3
   t9   53.03   741   271
   t10  47.26   734   306.9
   t11  44.07   748   424.1
   t12  38.63   760   398
   t13  39.91   754   487.6
   t14  39.45   700   521.9
   t15  41.14   686   541.3
   t16  39.23   720   560
   t17  52.12   714   486.8
   t18  40.85   761   372.6
   t19  41.2    727   367.4
   t20  41.15   714   314.3
   t21  45.76   618   316.6
   t22  45.59   584   311.4
   t23  45.56   578   405.4
   t24  34.72   544   470.4;
* -----------------------------------------------------

Variable
   OBJ    'objective (revenue)'
   cost   'cost of thermal units'
   p(g,t) 'power generated by thermal power plant'
   SOC(t)
   Pd(t)
   Pc(t);

p.up(g,t) = gendata(g,"Pmax");
p.lo(g,t) = gendata(g,"Pmin");

Scalar
   SOC0   / 100  /
   SOCmax / 300  /
   eta_c  / 0.95 /
   eta_d  / 0.9  /;

SOC.up(t)     =     SOCmax;
SOC.lo(t)     = 0.2*SOCmax;
SOC.fx('t24') =     SOC0;

Pc.up(t) = 0.2*SOCmax;
Pc.lo(t) = 0;
Pd.up(t) = 0.2*SOCmax;
Pd.lo(t) = 0;

Equation Genconst3, Genconst4, costcalc, balance, constESS1;

costcalc..       cost =e= sum((t,g), gendata(g,'a')*power(p(g,t),2)
                                   + gendata(g,'b')*p(g,t) + gendata(g,'c'));

Genconst3(g,t).. p(g,t+1) - p(g,t) =l= gendata(g,'RU0');

Genconst4(g,t).. p(g,t-1) - p(g,t) =l= gendata(g,'RD0');

constESS1(t)..   SOC(t) =e= SOC0$(ord(t)=1) + SOC(t-1)$(ord(t)>1) + Pc(t)*eta_c - Pd(t)/eta_d;

balance(t)..     sum(g, p(g,t)) + Pd(t) =g= data(t,'load')+Pc(t);

Model DEDESScostbased / all /;
solve DEDESScostbased using qcp minimizing cost;

Parameter rep(t,*);
rep(t,'Pth')  = sum(g,p.l(g,t));
rep(t,'SOC')  = SOC.l(t);
rep(t,'Pd')   = Pd.l(t);
rep(t,'Pc')   = Pc.l(t);
rep(t,'Load') = data(t,'load');

$ifI %system.fileSys%==Unix $exit
$call MSAppAvail Excel
$ifThen not errorLevel 1
   execute_unload "DEDESScostbased.gdx" P.l
   execute 'gdxxrw.exe DEDESScostbased.gdx var=P rng=Pthermal!a1'
   execute_unload "DEDESScostbased.gdx" rep
   execute 'gdxxrw.exe DEDESScostbased.gdx par=reP rng=rep!a1'
$endIf