Lp status () infeasible

Problems with syntax of GAMS
Post Reply
giorgos k.
User
User
Posts: 1
Joined: 2 years ago

Lp status () infeasible

Post by giorgos k. »

hello everyone, i am trying to write down a problem in gams and i am dealing with infeasible issues.
The program is this:
Any idea what i am doing wrong?

*$Title Joint operation Selling and Buying LP Wind farm and pumped-storage units
Sets
h period of time /H1*H24/
s number of scenarios /S1*S5/
;
Parameter
pDATA(s,h) expected market price in period h in Euro
WDATA(s,h) wind generation forecast in period h in MW
N number of identical pumped-storage units associated in the same pond /3/
pen /0.36/
prob(s) probability of scenario s
/
S1 0.2
S2 0.2
S3 0.2
S4 0.2
S5 0.2
/
efi efficiency of the pumpturbine cycle /0.7/
gpmax generation power limit for each pumped-storage unit in MW /384/
gpmin /0/
gpdownmax/116/
dpmax max power limit for each pumped-storage unit in MW /330/
dpmin min power limit for each pumped-storage unit in MW /0/
gmaxw maximum installed power of the wind farm in MW /73.2/
uupmax max capacity limit of upper reservoir in MWh /237102/
uupmin min capacity limit of upper reservoir in MWh /0/
ulomax max capacity limit of lower reservoir in MWh /5035/
ulomin min capacity limit of lower reservoir in MWh /0/
uou initial level in the upper reservoir in MWh/123364/
ufu final level in the upper reservoir in MWh/123364/
uol initial level in the lower reservoir in MWh/3900/
ufl final level in the lower reservoir in MWh/3900/
;
*pdata import
$call gdxxrw.exe indata.xlsx par=pDATA rng=pDATA!A1:Y6
$gdxin indata.gdx
$load pDATA

*WDATA import
$call gdxxrw.exe indata.xlsx par=WDATA rng=WDATA!A1:Y6
$gdxin indata.gdx
$load WDATA
$gdxin

display pDATA,WDATA,uol;

Variables
z objective function variable
xwp(h) Energy bid to DAM dy the wind farm in period h in MWh
;
positive variable
check(s,h)
*Wind farm*
gw(s,h) power output of the wind farm at period h in MW
*Pumpedstorage plant*
uu(s,h) energy stored in the upper reservoir at the end of period h in MWh
ul(s,h) energy stored in the lower reservoir at the end of period h in MWh
dp(s,h) pumping power output of the pumpedstorage plant in period h in MW
gp(s,h) discharge power output of the pumpedstorage plant in period h in MW
*both
;
Equations
Bid obj function
eq1(s,h)
eq2(s,h)
*wind farm
eq3(s,h)
eq4(s,h)
eq5(h)
eq6(h)
*pumbed storage plant
eq7(s,h)
eq8(s,h)
eq9(s,h)
eq10(s,h)
eq11(s,h)
eq12(s,h)
eq13(s,h)
eq14(s,h)
eq15(s,h)
eq16(s,h)
eq17(s,h)
eq18(s,h)
eq19(s,h)
eq20(s,h)
;

Bid.. z=e=SUM(s,prob(s)*SUM(h,[pDATA(s,h)*(gw(s,h)+gp(s,h)-dp(s,h))]-[pen*pDATA(s,h)*check(s,h)]));
eq1(s,h)..check(s,h)=g=(gw(s,h)+gp(s,h))-(dp(s,h)+xwp(h));
eq2(s,h)..check(s,h)=g=(dp(s,h)+xwp(h))-(gw(s,h)+gp(s,h));

*Wind farm
*(30)
eq3(s,h).. gw(s,h)=g=0;
eq4(s,h).. gw(s,h)=l=WDATA(s,h);
*(31)
eq5(h).. xwp(h)=g=-dpmax;
eq6(h).. xwp(h)=l=gmaxw+gpmax;

*Pumpedstorage plant
*(19)
eq7(s,h)$(ord(h) eq 1)..uu(s,h)=e=uou+[efi*dp(s,h)]-gp(s,h);
eq8(s,h)$(ord(h) gt 1)..uu(s,h)=e=uu(s,h-1)+[efi*dp(s,h)]-gp(s,h);
*(20)
eq9(s,h)$(ord(h) eq 1)..ul(s,h)=e=uol+gp(s,h)-[efi*dp(s,h)];
eq10(s,h)$(ord(h) gt 1)..ul(s,h)=e=uu(s,h-1)+gp(s,h)-[efi*dp(s,h)];
*(21)
eq11(s,h).. uu(s,h)=g=uupmin;
eq12(s,h).. uu(s,h)=l=uupmax;
*(22)
eq13(s,h).. ul(s,h)=g=ulomin;
eq14(s,h)..ul(s,h)=l=ulomax;
*(23)
eq15(s,h)$(ord(h) eq 24)..uu(s,h)=e=ufu;
*(24)
eq16(s,h)$(ord(h) eq 24)..ul(s,h)=e=ufl;
*(25)
eq17(s,h).. gp(s,h)=l=gpmax;
eq18(s,h).. gp(s,h)=g=gpmin;
*(26)
eq19(s,h).. dp(s,h)=l=dpmax;
eq20(s,h).. dp(s,h)=g=dpmin;


model JOSB /ALL/;
SOLVE JOSB USING lp MAXIMIZING z;
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Lp status () infeasible

Post by bussieck »

Please don't paste code as regular text. Use attachments or the code tags. Moreover, we can't really help because we don't have the data. So you would need to attach the GDX file. BTW, infeasible models are an okay outcome of optimization models. Bruce McCarl has nicely written up how to deal with infeasible models. You might want to study this: https://www.gams.com/newsletter/mccarl/ ... _no_40.pdf (section 3).

Good luck.

-Michael
Post Reply