summation equation with upper and lower limits Topic is solved

Problems with modeling
Post Reply
goktug06
User
User
Posts: 1
Joined: 3 years ago

summation equation with upper and lower limits

Post by goktug06 »

Image


im trying to model this and its give me a Error 154 in Set for 'ord' is not controlled

one_in_europe(j)$(ord(i) < 3).. sum((k,i),w(i,k)) =e= L
Attachments
resim.png
resim.png (7.96 KiB) Viewed 1900 times
abhosekar
Moderator
Moderator
Posts: 295
Joined: 3 years ago

Re: summation equation with upper and lower limits

Post by abhosekar »

It should be
one_in_europe(i)$(ord(i) > 3).. sum(k,w(i,k)) =e= L

The equations are defined over i. There is no j. As a result, when you define one_in_europe(j), GAMS give you an error as i is not defined (controlled).

The other equation would be as follows:
equation(k).. sum(i $(ord(i) < 4), w(i,k)) =e= 1;

Hope this helps.

- Atharv
Post Reply