## Unit Comittment with Variable Generation Constrains

Problems with modeling
tfkLSTM
User
Posts: 1
Joined: 10 months ago

### Unit Comittment with Variable Generation Constrains

Dear Gams users,

I am trying to solve the unit commitment problem according to the formulation proposed at [1] but I have a question related with the lower and upper bounds of the generators. According to [2] and basic knowledge of thermodynamics the output power of a thermal generator depends on several conditions as: humidity, compressor inlet temperature, degradation of the machine, fuel quality etc... Because of this behavior the maximum capacity of the generator is usually far from the one available in the manufacturer cheat sheet and of course not constant. However, this capacity can be estimated with good accuracy using ISO-derating algorithms that take into account the future values of the variable mentioned above. My question is, how can I implement that this limits are changing depending of the time step?

My first approach was think that I can use another table with index i an t with the maximum available capacity but the problem is that modifying this limits will also change the linearization of the cost curves. Anyone has an idea of how to implement that?

Being the code:

Code: Select all

``````Sets t time / t1t24 / ,
i generators / g1g10 / ,
k cost segments / sg1sg20 / ,
char / ch1ch2 / ;
Alias (t ,h) ;
Table gendata (i ,) generator cost characteristics and limits
a b c CostsD c o s t s t RU RD UT DT SD SU Pmin Pmax U0 Uin i S0
g1 0.014 12.1 82 42.6 42.6 40 40 3 2 90 110 80 200 1 0 1
g2 0.028 12.6 49 50.6 50.6 64 64 4 2 130 140 120 320 2 0 0
g3 0.013 13.2 100 57.1 57.1 30 30 3 2 70 80 50 150 3 0 3
g4 0.012 13.9 105 47.1 47.9 104 104 5 3 240 250 250 520 1 1 0
g5 0.026 13.5 72 56.6 56.9 56 56 4 2 110 130 80 280 1 1 0
g6 0.021 15.4 29 141.5 141.5 30 30 3 2 60 80 50 150 0 0 0
g7 0.038 14.0 32 113.5 113.5 24 24 3 2 50 60 30 120 0 1 0
g8 0.039 13.5 40 42.6 42.6 22 22 3 2 45 55 30 110 0 0 0
g9 0.039 15.0 25 50.6 50.6 16 16 0 0 35 45 20 80 0 0 0
g10 0.051 14.3 15 57.1 57.1 12 12 0 0 30 40 20 60 0 0 0;
Parameter data (k, i ,) ;
d a t a ( k , i , ’DP ’ ) =( g e n d a t a ( i , " Pmax " )gendata ( i ," Pmin ") ) / card ( k ) ;
data (k , i , ’ Pini ’)= ( ord (k)1)d a t a ( k , i , ’DP ’ ) + g e n d a t a ( i , " Pmin " ) ;
d a t a ( k , i , ’ P f i n ’ ) = d a t a ( k , i , ’ P i n i ’ ) + d a t a ( k , i , ’DP ’ ) ;
data (k, i , ’Cini ’)=gendata (i ,"a")power ( data (k , i , ’ Pini ’ ) ,2)
+gendata (i ,"b")data (k, i , ’Pini ’)+gendata (i ,"c") ;
data (k, i , ’Cfin ’)=gendata (i ," a")power ( data (k , i , ’ Pfin ’ ) ,2)
+gendata (i ,"b")data (k, i , ’Pfin ’)+gendata (i ,"c") ;
data (k, i , ’s ’)= ( data (k, i , ’Cfin ’)d a t a ( k , i , ’ C i n i ’ ) ) / d a t a ( k , i , ’DP ’ ) ;
gendata ( i , ’Mincost ’)=gendata (i , ’a ’)power ( gendata ( i ," Pmin ") ,2)
+gendata (i , ’b’)gendata ( i ," Pmin ")+gendata ( i , ’c ’ ) ;
Table dataLP ( t ,)
t1 14.72 883
t2 15.62 915
t23 20.50 915
t24 15.62 834;
Parameter unit (i , char ) ;
unit ( i , ’ch1 ’ ) =24;
u n i t ( i , ’ ch2 ’ ) =( g e n d a t a ( i , ’UT ’ )g e n d a t a ( i , ’U0 ’ ) )gendata (i , ’Uini ’) ;
parameter unit2 ( i , char ) ; unit2 ( i , ’ch1 ’ ) =24;
u n i t 2 ( i , ’ ch2 ’ ) =( g e n d a t a ( i , ’DT ’ )gendata ( i , ’S0 ’ ) )(1gendata (i , ’Uini ’) ) ;
gendata ( i , ’Lj ’ )=smin ( char , unit ( i , char ) ) ; gendata ( i , ’Fj ’ )=smin ( char , unit2 ( i , char ) ) ;
v a r i a b l e c o s t T h e r m a l ; p o s i t i v e v a r i a b l e s pu ( i , t ) , p ( i , t ) , StC ( i , t ) ,SDC( i , t ) , Pk ( i , t , k ) ;
Binary variable u(i , t ) ,y(i , t ) ,z(i , t ) ;
p . up ( i , t ) = g e n d a t a ( i , " Pmax " ) ; p . l o ( i , t ) = 0 ; Pk . up ( i , t , k ) = d a t a ( k , i , ’DP ’ ) ;
Pk . lo ( i , t , k ) =0; p . up ( i , t ) = gendata ( i , " Pmax " ) ; pu . up ( i , h ) = gendata ( i , " Pmax " ) ;
E q u a t i o n s Uptime1 , Uptime2 , Uptime3 , Dntime1 , Dntime2 , Dntime3 , Ramp1 , Ramp2 ,
Ramp3 , Ramp4 , s t a r t c , shtdnc , genconst1 , Genconst2 , Genconst3 , Genconst4 , balance ;
Uptime1 ( i )\$( gendata ( i ," Lj ") >0) . .
sum ( t\$ ( ord ( t ) < ( gendata ( i , " Lj " ) +1) ) ,1U( i , t ) )=e=0;
Uptime2 ( i ) \$ ( g e n d a t a ( i , " UT" ) >1) . .
sum ( t \$ ( ord ( t )>24g e n d a t a ( i , " UT" ) +1) ,U( i , t )y( i , t ) )=g=0;
Uptime3 ( i , t ) \$ ( ord ( t ) > g e n d a t a ( i , " Lj " ) and ord ( t )<24g e n d a t a ( i , " UT" ) +2 and
n o t ( g e n d a t a ( i , " Lj " )>24g e n d a t a ( i , " UT" ) ) ) . . sum( h\$ (( ord (h)>ord ( t )1) and
( ord ( h ) < ord ( t ) + g e n d a t a ( i , " UT" ) ) ) ,U( i , h ) ) =g= g e n d a t a ( i , " UT" )y(i , t);
Dntime1 ( i )\$( gendata ( i ," Fj ") >0) . . sum( t\$ ( ord ( t )< ( gendata ( i , " Fj ") +1) ) ,U( i , t ) )=e =0;
Dntime2 ( i ) \$ ( g e n d a t a ( i , " DT" ) >1) . .
sum ( t \$ ( ord ( t )>24g e n d a t a ( i , " DT" ) +1) ,1U( i , t )z ( i , t ) )=g=0;
Dntime3 ( i , t ) \$ ( ord ( t ) > g e n d a t a ( i , " Fj " ) and ord ( t )<24g e n d a t a ( i , " DT" ) +2
and n o t ( g e n d a t a ( i , " Fj " )>24g e n d a t a ( i , " DT" ) ) ) . . sum( h\$ (( ord (h)>ord ( t )1)
and ( ord ( h ) < ord ( t ) + g e n d a t a ( i , " DT" ) ) ) ,1U( i , h ) ) =g= g e n d a t a ( i , " DT" )z(i ,t);
s t a r t c ( i , t ) . . StC ( i , t )=g=gendata ( i ," costst ")y(i , t);
s h t d n c ( i , t ) . . SDC( i , t ) =g= g e n d a t a ( i , " CostsD " )z(i , t);
Genconst1 ( i , h) . . p( i , h)=e=u( i , h)gendata ( i ," Pmin ")+sum(k , Pk ( i , h , k ) ) ;
Genconst2 ( i , h ) \$ ( ord ( h ) >0) . . U( i , h ) =e=U( i , h1)\$ ( ord ( h ) >1)+ g e n d a t a ( i , " Uini " ) \$ ( ord ( h )=1)+y( i , h)z(i ,h);
Genconst3 ( i , t , k ) . . Pk ( i , t , k ) = l =U( i , t )d a t a ( k , i , ’DP ’ ) ;
Genconst4 . ..
costThermal=e=sum ( ( i , t ) , StC ( i , t ) +SDC( i , t ) ) +sum ((t , i) ,
u(i , t)gendata ( i , ’Mincost ’)+sum (k, data (k, i , ’s ’)pk ( i , t , k) ) ) ;
Ramp1 ( i , t ) . . p ( i , t 1)p ( i , t ) = l =U( i , t )g e n d a t a ( i , ’RD’ ) +z ( i , t )g e n d a t a ( i , " SD " ) ;
Ramp2 ( i , t ) . . p ( i , t ) = l =pu ( i , t ) ;
Ramp3 ( i , t ) \$ ( ord ( t ) <24) . . pu ( i , t ) = l =( u ( i , t )z( i , t +1) )gendata ( i , " Pmax " )
+z( i , t +1)g e n d a t a ( i , " SD " ) ;
Ramp4 ( i , t ) \$ ( ord ( t ) >1) . . pu ( i , t ) = l =p ( i , t 1)+U( i , t 1)g e n d a t a ( i , ’RU’ )
+y( i , t )g e n d a t a ( i , " SU " ) ;
Balance ( t ) .. sum( i , p( i , t ) )=e= dataLP ( t , ’ load ’ ) ;
Model UCLP / all / ;
Option optcr =0.0;
Solve UCLP minimizin gcostThermal using mip ;
``````
[1] Power Systems Optimization Modelling with GAMS - Chapter 5 section 5.1.4
[2] ISO 18888:2017(en) Gas turbine combined cycle power plants — Thermal performance tests