A standard formulation to deal with inventory in GAMS can look like:
set t /t1*t5/;
Note: GAMS will automatically discard inv(t-1) for the first time period t=t1 (or putting it differently it will set inv(t-1) =0 in that case).
In a project I have to deal with aging of inventory. This looks like a production/inventory model I did for a large cheese manufacturer that had a similar structure: having the cheese stored for a period causes it to age and actually becoming a different (more expensive) product.
The inventory balance equation becomes a little bit more complicated in that case. In its simplest form it can be something like:
a 'age classes' /a1*a3/
a1(a) 'first age class' /a1/
inv(t,a) 'inventory at end of period t'
parameter init_inv(t,a) 'initial inventory' /
* Note: for any t > t1 init_inv(t,a)=0
inv_bal(t,a) 'inventory balance';
inv(t,a) =e= inv(t-1,a-1)
Unsold items are in inv(t,’a3’).