Errors 654, 409, 148,125

Problems with syntax of GAMS
Post Reply
ikeato
User
User
Posts: 10
Joined: 6 years ago

Errors 654, 409, 148,125

Post by ikeato »

Hi,

Working a some codes and I keep getting these errors 654, 409,148,125 on these equations:

objectivefunction.. z =e= (sum(i,j), Ah * LD(i,j) * x(i,j)+ Bh * DL(j,i)*
y(j,i));

cograde(i).. gl =l= (sum(i,j), g(i) * P * x(i,j))/(sum(i,j) ,P * x(i,j))=l= gu;

This is my full codes:

Sets
i loading index /1*10/

j dump index /1*5/



parameters

O(i) available ore at shovel i / 1 9.4,2 10.5,3 10,4 10.5,5 11,6 12.5,7 10.5,8 13,9 13.5,10 12.5/

W(i) available waste at shovel i / 1 12.5,2 11,3 13.5,4 10.5,5 11.5,6 13.5,7 10.5,8 11.5,9 13.5,10 12.5/

g(i) Grade of ore at shovel i / 1 30,2 28,3 29,4 32,5 31,6 33,7 32,8 31,9 33,10 31/

k(j) Product demand at Dump j / 1 12,2 13,3 13,4 12,5 12/


table LD(i,j)
1 2 3 4 5

1 5.26 1.9 4.42 5.89 0.64


2 1.9 0.99 3.86 5.61 1.76



3 4.21 1.90 3.72 5.61 1.27



4 4 1.13 3.16 4.56 1.83



5 2.95 1.27 2.25 3.51 2.74



6 2.74 2.25 2.81 3.65 2.6



7 2.46 1.48 0.78 2.46 4.21



8 1.9 2.04 1.62 2.46 3.72



9 0.64 3.09 1.27 1.06 5.05




10 1.27 3.51 0.5 0.57 6.10;



table DL (j,i)
1 2 3 4 5 6 7 8 9 10

1 5.26 5.19 4.21 4.00 2.95 2.74 2.46 1.90 0.64 1.27

2 1.90 0.99 1.90 1.13 1.27 2.25 1.48 2.04 3.09 3.51

3 4.42 3.86 3.72 3.16 2.25 2.81 0.78 1.62 1.27 0.50

4 5.89 5.61 5.61 4.56 3.51 3.65 2.46 2.46 1.06 0.57

5 0.64 1.76 1.27 1.83 2.74 2.60 4.21 3.72 5.05 6.10



Scalar T shift period at i and j /8/;

Scalar Vs Average Loading Speed at Shovel /1.848/;

Scalar Vd Average dumping speed of truck /3.078/;

Scalar P Payload capacity /0.154/;

Scalar Ah Haulage cost of loaded truck /1.283/;

Scalar gl Lower grade at shovel i /28/;

Scalar gu Max grade at shovel i /33/;

Scalar Bh Haulage cost of empty truck /1/;

variables

Z

integer variable x(i,j)

integer variable y(j,i);

equations

objectivefunction

codemand(j)
cosupplyore(i)
cosupplywst(i)
cograde(i)
cotimeload(i)
cotimedump(j)
cobalload(j)
cobaldump(i);

objectivefunction.. z =e= (sum(i,j), Ah * LD(i,j) * x(i,j)+ Bh * DL(j,i)*
y(j,i));

codemand(j).. sum(i,P * x(i,j))=g=k(j);

cosupplyore(i).. sum(j,P * x(i,j))=g=O(i);

cosupplywst(i).. sum(j,P * x(i,j))=g=w(i);

cograde(i).. gl =l= (sum(i,j), g(i) * P * x(i,j))/(sum(i,j) ,P * x(i,j))=l= gu;

cotimeload(i).. sum(j,P * x(i,j)/Vs)=l=T;

cotimedump(j).. sum(i,P * x(i,j)/Vd)=l=T;

cobalload(j).. sum(i,x(i,j))=e= sum(i,y(j,i));

cobaldump(i).. sum(j,x(i,j))=e= sum(j,y(j,i));

model jo/all/;

solve jo using mip minimizing z;

display z.l,x.l,y.l;

Kindly assist
cladelpino
User
User
Posts: 108
Joined: 7 years ago

Re: Errors 654, 409, 148,125

Post by cladelpino »

First. Read https://www.gams.com/products/simple-example/, you've got all your sum() operators syntax wrong. (this is your 148)

Second. In equation cograde, it is written for every " i ". So, when you mean sum( (i,j), ... ) do you really mean " i " again, or do you mean sum(j,... (for the fixed " i " that you're writing the equation for) ? (this is your 125)
ikeato
User
User
Posts: 10
Joined: 6 years ago

Re: Errors 654, 409, 148,125

Post by ikeato »

Thanks for the insight.
Am sorted.
Post Reply