problem with constraint in a very simple model

Hi everybody!

I made a vary simple model, you can see it below


set
hr hour /1*8782/

loc location /A1,A2,A3,B1,B2,C1,C2,E1,E2,E3,F1,G1,G2,G3,H1,H2,H3,H4,I1,I2/

;


$CALL GDXXRW.EXE C:\Users\Valentina\Documents\gamsdir\projdir\WINDPL_PROJ_NORDEX.xls par=power rng=A1:U8783
Parameter power(hr,loc) produced power in each location in each hour;
$GDXIN WINDPL_PROJ_NORDEX.gdx
$LOAD power
$GDXIN

*scalar CapMax /30000/ ;

variables

TotalElcProduced objective function to maximize ;

integer variables

NRWindTurbine(loc) number of wind turbine to build in the location loc ;

NRWindTurbine.up(loc) = 1500 ;


equations


*MaxCapAdm(hr) maximum produced capacity each hour (less than CapMax)
TotalElc total produced elc in one year mWh;


*MaxCapAdm(hr)… sum(loc, power(hr,loc)*NRWindTurbine(loc)) =l= CapMax ;
TotalElc… TotalElcProduced =e= sum(hr,sum(loc, power(hr,loc)*NRWindTurbine(loc))) ;


model windTurbine /all/ ;
solve windTurbine using mip maximizing TotalElcProduced ;
display NRWindTurbine.l ;



If I run the model as it is above (with ) it works and obvsiouly it put all the var NRWindTurbine at 1500 to maximize the total elc…
But, if I try to remove the '
’ to get works the other parts of the code the program give me in answer value of NRWindTurbine NOT integer such as 0.9 , 2.3 and it give me the number of turbine for each location and for each hour: I have 8782 values of NRWindTurbine for each location. But I want only one value of this variable for each location.
How can I set this constraint?
I want the optimal number of turbine in each location maximizing the total power produced in one year. How can I ask this to gams?

Thank you for your help!

Valentina


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Valentina

I cannot afford to reproduce the behaviour you mention :

since I do not have the GDX source, I assigned powitive random values to the parameter “power”.
I get the obvious solution (1500 for all locations) when I keep the stars.

but when I remove the stars, I get

  • an integer solution for each location
  • a single value of NRWindTurbine for each location – not 8782 values.

Maybe if you could also send the data file ?
But as such I cannot reproduce the problem you describe.

Let me however make a few comments comments :

  • requiring integrality for variables between 0 and 1500 is a little bit harsh – though it works on this simple case. I tend to think it would be wise to consider linear relaxation.
  • the number of hours is a little bit strange. I would expect either 8760 or 8784 (for leap years) but not 8782. How did you come up with that number?
  • what is the economic sense in limiting the total (random) hourly wind production ? I see no obvious economic interpretation for that, so I would be glad if you could comment on this.

Hope this helps
cheers

dax



Le mercredi 6 novembre 2013 15:59:34 UTC+1, vale...@gmail.com a écrit :

Hi everybody!

I made a vary simple model, you can see it below


set
hr hour /1*8782/

loc location /A1,A2,A3,B1,B2,C1,C2,E1,E2,E3,F1,G1,G2,G3,H1,H2,H3,H4,I1,I2/

;


$CALL GDXXRW.EXE C:\Users\Valentina\Documents\gamsdir\projdir\WINDPL_PROJ_NORDEX.xls par=power rng=A1:U8783
Parameter power(hr,loc) produced power in each location in each hour;
$GDXIN WINDPL_PROJ_NORDEX.gdx
$LOAD power
$GDXIN

*scalar CapMax /30000/ ;

variables

TotalElcProduced objective function to maximize ;

integer variables

NRWindTurbine(loc) number of wind turbine to build in the location loc ;

NRWindTurbine.up(loc) = 1500 ;


equations


*MaxCapAdm(hr) maximum produced capacity each hour (less than CapMax)
TotalElc total produced elc in one year mWh;


*MaxCapAdm(hr)… sum(loc, power(hr,loc)*NRWindTurbine(loc)) =l= CapMax ;
TotalElc… TotalElcProduced =e= sum(hr,sum(loc, power(hr,loc)*NRWindTurbine(loc))) ;


model windTurbine /all/ ;
solve windTurbine using mip maximizing TotalElcProduced ;
display NRWindTurbine.l ;



If I run the model as it is above (with ) it works and obvsiouly it put all the var NRWindTurbine at 1500 to maximize the total elc…
But, if I try to remove the '
’ to get works the other parts of the code the program give me in answer value of NRWindTurbine NOT integer such as 0.9 , 2.3 and it give me the number of turbine for each location and for each hour: I have 8782 values of NRWindTurbine for each location. But I want only one value of this variable for each location.
How can I set this constraint?
I want the optimal number of turbine in each location maximizing the total power produced in one year. How can I ask this to gams?

Thank you for your help!

Valentina


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.