 Ekran Alıntısı.JPG (8.75 KiB) Viewed 129 times
Inventory problem

 User
 Posts: 1
 Joined: 1 month ago
Inventory problem
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 (8.75 KiB) Viewed 129 times
Re: Inventory problem
This is a very common problem for this type of constraint.
eq(i,j).. y(i,j) =e= y(i, j1)$(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, j1).
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
eq(i,j).. y(i,j) =e= y(i, j1)$(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, j1).
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