Hi, I send you my gams code below, I keep getting “148 Dimension different - The symbol is referenced with more/less
indices as declared” error in
eq5(i)… m1sum(j,x(‘1’,j))-m2sum(j,x(‘2’,j))=e=0
eq6(i)… m3sum(j,x(‘2’,j))-m4sum(j,x(‘3’,j))=e=0
I couldn’t find how to solve this problem. I would be very happy if you could help me with this.
Errors:
CODE:
Sets
i/19/
j/13/parameters
p(i)
/
1 1600
2 1200
3 1080
/w(j)
/
1 1600
2 1300
3 900
/
s(j)
/
1 2800
2 2500
3 1600
/
t(j)
/
1 1600
2 1800
3 1200
/
m(i)
/
1 0
2 0
/
scalers
m1/1300/
m2/1600/
m3/900/
m4/1300/;Table n(i,j)
1 2 3
1 1 1 1
2 1 1 1
3 1 1 1
4 5 4 3
5 5 4 3
6 5 4 3
7 1 1 1
8 1 1 1
9 1 1 1
;
Variable
z
x(i);
positive Variable
x;
Equations
eq1
eq2(j)
eq3(j)
eq4(j)
eq5(i)
eq6(i)
;
eq1… z =e= sum(i,p(i)x(i));
eq2(j)… sum(i,n(i,j)x(i)) =L= w(j);
eq3(j)… sum(i,n(i,j)x(i)) =L= s(j);
eq4(j)… sum(i,n(i,j)x(i)) =L= t(j);
eq5(i)… m1sum(j,x(‘1’,j))-m2sum(j,x(‘2’,j))=e=0
eq6(i)… m3sum(j,x(‘2’,j))-m4sum(j,x(‘3’,j))=e=0
;
Model FUY/all/;
Solve FUY Using LP maximazing z;
display Z.L,X.L