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)24360030/10000-abandon(i)24360030/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/(243600
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= ns10000/(ah_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)/(24360030)-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"
and i don’t know how to solve it. Please help me,thank you.

Hi
It looks like you either didn’t buy a license or you didn’t install the license in Gams root directory. The demo version has constraints on the number of variables and equations.
Cheers
Renger