Inventory problem

Problems with modeling
Post Reply
xnorwaykitten
User
User
Posts: 1
Joined: 1 month ago

Inventory problem

Post by xnorwaykitten » 1 month ago

Ekran Alıntısı.JPG
Ekran Alıntısı.JPG (8.75 KiB) Viewed 129 times
If i0 is a constant,i is between 1 and 4 and j is between 1 and 10, how can I write this equation in gams?
Attachments
Ekran Alıntısı.JPG
Ekran Alıntısı.JPG (8.75 KiB) Viewed 129 times

abhosekar
Moderator
Moderator
Posts: 190
Joined: 10 months ago

Re: Inventory problem

Post by abhosekar » 1 month ago

This is a very common problem for this type of constraint.

eq(i,j).. y(i,j) =e= y(i, j-1)$(ord(j) ne 1) + initial_inventory $(ord(j) eq 1) + x(i,j);

This way initial_inventory will only be only added when ord(j) is 1 (i.e., for first j) and for all other j's where ord(j) not equal to 1, you add the term y(i, j-1).

This is just the general idea. You may not want this exact constraint but you can use this approach to model what you want.

- Atharv

Post Reply