## Reservoir Operation Topic is solved

Problems with modeling
zby
User
Posts: 2
Joined: 9 months ago

### Reservoir Operation

Hello ,
I am intending to find the solution which maximizes the total annual power production of the single reservoir, the variables are:
VARIABLES h(i) waterlevel
s(i) storage
h_t(i) tail waterlevel
h_shuitou(i);
POSITIVE VARIABLES
q(i) outflow
abandon(i)
n_power(i);
VARIABLE obj;
and the equations including:
balance(i).. s(i) =e= initial_s\$(ord(i) eq 1)+s(i-1)\$(ord(i) gt 1)
+in(i)-q(i)*24*3600*30/10000-abandon(i)*24*3600*30/10000;

*compare_s(i)..s(i)\$(s.l(i) gt s_max) =e= s_max;
*compare_aban(i)..abandon(i)\$(s.l(i) eq s_max) =e= 0;
compare_q(i).. q(i)\$(s.l(i) eq s_max) =e= (in(i)+initial_s\$(ord(i) eq 1)+s(i-1)\$(ord(i) gt 1)-s(i))*10000/(24*3600*30)-abandon(i);

insert1(i,k).. h(i)\$((s.l(i)>=capacity(k))\$(s.l(i)<=capacity(k+1))) =e=
(h_up(k+1)-h_up(k))*(s(i)-capacity(k))/(capacity(k+1)-capacity(k))+h_up(k);
insert2(i,k1).. h_t(i)\$((q.l(i)>=release(k1))\$(q.l(i)<=release(k1+1))) =e=
(h_down(k1+1)-h_down(k1))*(q(i)-release(k1))/(release(k1+1)-release(k1))+h_down(k1);

s_upper_limit(i)..s(i) =l= s_max ;
s_lower_limit(i)..s(i) =g= s_min ;
h_upper_limit(i)..h(i) =l= z_max ;
h_lower_limit(i)..h(i) =g= z_min ;

shuitou(i)..h_shuitou(i) =e= h(i)-h_t(i);
power(i)..n_power(i) =e= a*h_shuitou(i)*q(i)/10000;

power2(i)..n_power(i)\$(n_power.l(i) > ns) =e= ns;
release2(i)..q(i)\$(n_power.l(i) > ns =e= ns*10000/(a*h_shuitou(i));
abandon2(i)..abandon(i)\$(n_power.l(i) > ns) =e= (in(i)*10000+initial_s\$(ord(i) eq 1)*100000000+s(i-1)\$(ord(i) gt 1)*100000000-s(i)*100000000)/(24*3600*30)-q(i);

objective..obj =e= sum(i,n_power(i));

and the GAMS gives me an error saying:"
**** THE MODEL EXCEEDS THE DEMO LIMITS
**** MAX MATRIX ROWS 300
**** MAX MATRIX COLUMNS 300
**** MAX NON ZERO ELEMENTS 2000
**** MAX NON LINEAR N-Z 1000
**** MAX DISCRETE VARIABLES 50
**** Terminated due to a licensing error"