error 198

Problems with syntax of GAMS
Post Reply
gncd
User
User
Posts: 1
Joined: 1 year ago

error 198

Post by gncd »

Hello,
Can someone solve that pls?

Sets
j /1*11/
t /0*5/
i /1*15/
;

Parameter
p(j)
/ 1 30
2 50
3 30
4 50
5 30
6 30
7 50
8 30
9 50
10 30
11 30 /
;

Parameter
q(j)
/ 1 60
2 30
3 60
4 60
5 20
6 60
7 60
8 30
9 20
10 60
11 60 /
;

Table
D(j,t)
1 2 3 4 5
1 131724 109224 120657 128299 107955
2 3940 1572 0 0 1572
3 7320 5037 4999 6315 4927
4 0 0 475 0 562
5 10306 8032 9414 8971 9050
6 29699 13613 15350 17492 8485
7 3330 3861 2555 21000 2300
8 72443 55000 72000 31752 21510
9 12568 0 0 11042 4225
10 20432 14485 17974 17424 13270
11 14331 8054 8348 8264 9836
;

Parameter
r(j)
/
1 0.3
2 0.6
3 0.3
4 0.6
5 0.3
6 0.3
7 0.6
8 0.3
9 0.6
10 0.3
11 0.3
/
;

Table
c(j,i)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 1925 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 1925 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 1625 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 1643 1017 0 0 0 0 0 0 0 0
5 0 0 0 0 0 1643 0 0 0 0 0 0 0 0
6 0 0 0 0 0 0 1100 525 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 1100 0 0 0 0 0
8 0 0 0 0 0 0 0 0 0 700 0 0 0 0 0
9 0 0 0 0 0 0 0 0 0 0 700 0 0 0 0
10 0 0 0 0 0 0 0 0 0 0 0 700 600 0 0
11 0 0 0 0 0 0 0 0 0 0 0 0 0 750 655
;

Parameter
a(j)
/
1 87816
2 3940
3 10980
4 0
5 3435
6 35638
7 3330
8 50710
9 7000
10 14302
11 14331
/
;

Scalar
alpha /5/;


Variables
Ieksi(j,t)
SC
OC
Iarti(j,t)
Z(j,t)
;

Integer Variable
Y(t,i)
;

Free variable
obj objective function value;

Equations
c1OBJ
c2
c3
c4
c5
c6
c7
;

c1OBJ.. obj =e= alpha*SC + OC;
c2.. SC =e= sum((j,t), p(j)*q(j)*Ieksi(j,t));
c3.. OC =e= sum((j,t), (q(j)*Iarti(j,t)/12)*((1+r(j))**12-1));
c4(j,t)$(ord(t)<5).. Iarti(j,t+1) - Ieksi(j,t+1) =e= Iarti(j,t) + Z(j,t) - D(j,t+1);
c5(j,t)$(ord(t)<5).. Z(j,t) =e= sum((i),Y(t,i)*8*c(j,i));
c6(t)$(ord(t)<5).. sum((i),Y(t,i)) =l= 18;
c7(j).. Iarti(j,'0') =e= a(j);

Model mdckjwenjkwe /all/;
Solve mdckjwenjkwe minimization obj using mip;
option mip=cplex;
Display z.l;
Fred
Posts: 373
Joined: 7 years ago

Re: error 198

Post by Fred »

I guess you are running into a problem with an unordered set. Looking at this example may help.

When sharing code, please use code tags or attach a gms file. Just pasting code as text breaks the alignment which is especially annoying when using table statements.

I hope this helps!

Fred
Post Reply