I keep getting error 149 whenever I use set i. Why is this happening?
free variable cost;
set
i/1*12/;
Parameter
demand(i) /1 1000, 2 2000, 3 1500, 4 800, 5 2500, 6 2000, 7 1750, 8 2900, 9 900, 10 3500, 11 4000, 12 2000/;
NonNegative Variables Inv(i), W(i), H(i), L(i), C(i), S(i), PR(i), POT(i), PS(i);
equations obj, c1,c2,c3,c4,c5,c6,c7;
obj…
cost =e= 50PR(i) + 52PS(i) + 58POT(i) + 2C(i) + 3S(i) + 300H(i) + 400*L(i);
c1…
40*W(i) =e= PR(i);
c2…
2.5*W(i) =e= POT(i);
c3…
W(“1”) =e= 50;
c4…
W(i) - W(i-1) + H(i) - L(i) =e= 0;
c5…
Inv(“12”) =g= 700;
c6…
S(“12”) =e= 0;
c7…
PR(i) + PS(i) + POT(i) + S(i) - S(i-1) - Inv(i) + Inv(i-1) + 1000 =e= demand(i);
model number5 /all/;
solve number5 using lp minimizing cost;