Dear all,
I’m the new users of GAMs, so I really appreciate for your help.
I define three set tt, w1,w2, such that tt is the subset of w1 and w2, but w1 is not equal to w2. I also define the variables and parameters in w1 and w2. Now, how can I define the equations which only include variables and parameters in tt? Please check my code and error information. It seems that GAMS does not allow me to define the tt as the subset both of w1 and w2.
Thanks a lot.
Regards,
1 *$oninline
2 Set w1 /tt1,tt2,tt3,er/;
3 Set w2 /pt,tt1,tt2,tt3/;
4 Set tt /tt1,tt2,tt3/;
5 Set row /k1,k2/;
6 Table r1(w1,row)
7 k1 k2
8 tt1 1 0
9 tt2 0 2
10 tt3 3 1
11 er 3 0;
12
13 Table r2(w2,row)
14 k1 k2
15 pt 10 -5
16 tt1 1 0.2
17 tt2 -0.9 2
18 tt3 3 1;
19
20 Variables x(w1), y(w2), obj;
21 Positive Variables x, y
22
23 Equations
24
25 balance1(tt)
26
27 Total;
28
29 balance1(tt)… x(tt)*r1(tt,‘k1’)+y(tt)*r2(tt,‘k2’)=g=25;
**** $171 $171 $171 $171
30
31 Total… obj=e=sum(w1, x(w1))+sum(w2, y(w2));
32 Model Ref /all/ ;
33 Solve Ref using lp minimizing obj;
**** $257
GAMS 24.1.3 r41464 Released Jul 26, 2013 WEX-WEI x86_64/MS Windows 12/13/13 11:37:56 Page 2
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Error Messages
171 Domain violation for set
257 Solve statement not checked because of previous errors
**** 5 ERROR(S) 0 WARNING(S)
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.