Inventory problem

Ekran Alıntısı.JPG
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?
Ekran Alıntısı.JPG

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