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.