Stock Balance
Posted: Mon Jul 09, 2018 2:25 pm
Hi everyone... I'm having some problems about the logic to define the stock balance in a production planning problem...
the equation of the balance is: Ii, t-1 + Xit – Iit = dit i = 1, …, N, t = 0,1, …, T (2), in which i are the items and t the periods of time.
The thing is... I try to write it on GAMS like this: balancoestoquenormal(i,t).. E(i,t-1) + X(i,t) - E(i,t) =e= demanda(i,t) , which already has a problem when t=0, that's why I made an specific equation for the period 0 (as the initial stock is 0): balancoestoqueinicial(i).. X(i,'1') - E(i,'1') =e= demanda(i,'1');
with that being said, I want to know how can I define the set "t" to be greater or equal than 2 in the first equation balancoestoquenormal(i,t)..
How do I write it? would it be balancoestoquenormal(i,t=g=2)?? because I want it to count from 2....
thank you!
the equation of the balance is: Ii, t-1 + Xit – Iit = dit i = 1, …, N, t = 0,1, …, T (2), in which i are the items and t the periods of time.
The thing is... I try to write it on GAMS like this: balancoestoquenormal(i,t).. E(i,t-1) + X(i,t) - E(i,t) =e= demanda(i,t) , which already has a problem when t=0, that's why I made an specific equation for the period 0 (as the initial stock is 0): balancoestoqueinicial(i).. X(i,'1') - E(i,'1') =e= demanda(i,'1');
with that being said, I want to know how can I define the set "t" to be greater or equal than 2 in the first equation balancoestoquenormal(i,t)..
How do I write it? would it be balancoestoquenormal(i,t=g=2)?? because I want it to count from 2....
thank you!