Page 1 of 1

Summing in GAMS

Posted: Wed May 29, 2019 6:43 pm
by boloness
Hello everyone I am new to gams and I have some very prozaic issue.

So, in my MILP model I have defined a variable : D(s,t)
and I want to write an equation that will make something like :
(for t=4) : D(s,1)+D(s,2)+D(s,3)+D(s,4) =g=30
(for t=96) : D(s,1)+D(s,2)+D(s,3)+D(s,4)+...D(s,96) =g= 30
but what I receive is not what I want.
I receive
(for t=4) : D(s,4) =g= 30
(for t=96): D(s,96)=g= 30

How to change this equation to obtain a sum of the all elements ?

limitP1(s,t)$(P1(s)).. sum((tt), D(state,time))=g=30 ;

Re: Summing in GAMS

Posted: Wed May 29, 2019 11:59 pm
by boloness
Problem solved.