In this instance, x is the variable and y is the equation I am using for my model. The following code doesn’t work as it simply sums all the way until the ith value of x

y(i).. sum(i,x(i)) =l= 15

i.e y(1) = x(1) + x(2) + x(3) … x(i) <= 15

I have also tried using a loop but GAMS does not allow equations in loops.

What is the correct syntax to go about this problem? Thanks in advanced for your help.

The equation as you wrote it should actually lead to a compilation error because you cannot sum over i in the equation body if i is already the controlling index of the equation.