2011年6月4日星期六

GEM General Expansion Model



When to build new plant, when to  retire, how to transmiss between different regions, how to transfer between islands during each sub-period of a year



sets
  g                     
'Existing and (potentially) new generation plant'
  y                     
'Modelled calendar years'
  r                     
'Regions'
  p                     
'Transmission paths (or branches)'
  ps                    
'Transmission path states'

  t                     
'Time periods (within a year)'
  ild                   
'Islands'                           / ni       'North Island'
                                                              
si       'South Island'  /
  dlb                   
'Load blocks - before aggregating'
  lb                    
'Load blocks'
  hd                    
'Hydrology domain for multiple hydro years'
;

Alias (mds,mdss), (y,yy), (ild,ild1), (lb,lbb), (r,rr), (ps,pss), (i,ii), (g,gg), (colours,red,green,blue) ;

Binary Variables
** g: plants y: years
  BGEN(g,y)                        
'Binary variable to identify build year for new generation plant'
  BRET(g,y)                        
'Binary variable to identify endogenous retirement year for the eligble generation plant'
  ISRETIRED(g)                     
'Binary variable to identify if the plant has actually been endogenously retired (0 = not retired, 1 = retired)'
  BTX(r,rr,ps,y)                    
'Binary variable indicating the current state of a transmission path'
  NORESVTRFR(ild,ild1,y,t,lb,hd)   
'Is there available capacity on the HVDC link to transfer energy reserves (0 = Yes, 1 = No)'


* Reserve energy transfer - Constraint 4.
resvtrfr4(interild(ild1,ild),y,t,lb,h
)$useresv..
 
sum(arc, RESVTRFR(arc,ild1,ild,y,t,lb,h) )
  =l= hrsperblk(t,lb) *
sum((r,rr,ps)$(paths(r,rr) * mapild_r(ild1,r) * mapild_r(ild,rr)) , txcap(r,rr,ps)) * ( 1 - NORESVTRFR(ild1,ild,y,t,lb,h) ) ;

* Constraint that defines the reserve transfer capability.
resvtrfrdef(interild(ild1,ild),y,t,lb,h)$useresv..
 
sum((r,rr)$( paths(r,rr) * mapild_r(ild1,r) * mapild_r(ild,rr) ), TX(r,rr,y,t,lb,h) ) -
 
sum((r,rr,ps)$( paths(r,rr) * mapild_r(ild1,r) * mapild_r(ild,rr) ), txcapPO(r,rr,ps) * BTX(r,rr,ps,y) )
  =l= NORESVTRFR(ild1,ild,y,t,lb,h) * bigm(ild1,ild) ;


** RunGEM.gms
$setglobal   QDsolSecs       100000      ! CPU seconds available for solver to spend solving GEM for solve goal QDsol.
$setglobal   VGsolSecs       720000      ! CPU seconds available for solver to spend solving GEM for solve goal VGsol.
$setglobal   MinGapSecs      1080000     ! CPU seconds available for solver to spend solving GEM for solve goal MinGap.
$setglobal   Threads         2         ! Number of threads your MIP solver is licensed to use.
$setglobal   PolishTime      20000       ! Seconds available for the polishing routine - see GEMcplex.gms.



没有评论:

发表评论