Hi everyone,
Could you please help me about the following model?
I don’t understand where the problem is and how to fix it.
Thank you.
GAMS Rev 228 x86/MS Windows 11/10/10
15:55:27 Page 1
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
C o m p i l a t i o n
1 SETS
2 i systems / 1,2,3,4 /
3 j index1 / j1j5/
4 w index2 /150/;
5 PARAMETERS
6 k(i) k value
7 / 1 8
8 2 8
9 3 8
10 4 8 /
11 p(i) k value
12 /
13 1 0.85
14 2 0.85
15 3 0.85
16 4 0.85 /
17 C(i) k value
18 / 1 3000
19 2 1400
20 3 2000
21 4 2250 / ;
22
23
24 Scalar alfa /0/ ;
25
26 Scalar CT /150000/ ;
27 Scalar sonuc1 /1/;
28 Scalar sonuc2 /1/;
29 Scalar sonuc3 /1/;
30
31 Variables
32 z;
33
34 Positive variables
35 M(i)
36 a(i);
37
38 Equations
39 cost define objective function
40 con1
41 con2
42 con3
43 ca;
44
45
46 ca(i) … a(i) =e= prod(w$(ord(w) LE M(i)) , ord(w));
47 cost … z =e=alfa*(prod(i,
48 1-sum(j$(ord(j) LE k(i)-1),
49
50 (a(i))(p(i)**ord(j))((1-p(i))**( M(i)-
ord(j) ))
51
52 )
53 ))+(1-alfa)*(CT-sum(i,M(i)*C(i)))/CT;
54
55 con1(i) … M(i) =G= k(i) ;
56 con2 … sum(i, M(i)*C(i))=L=CT;
57 con3(i) … M(i) =L= 50 ;
58 Model relib /all/ ;
59 solve relib using MINLP maximizing z ;
**** 52,256
**** The following MINLP errors were detected in model relib:
**** 52 equation ca .. VAR -control
60 display M.l ;
GAMS Rev 228 x86/MS Windows 11/10/10
15:55:27 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
52 Endogenous $-control operations not allowed
256 Error(s) in analyzing solve statement. More detail appears
Below the solve statement above
**** 2 ERROR(S) 0 WARNING(S)
COMPILATION TIME = 0.000 SECONDS 3 Mb WIN228-228 Jul
26, 2008
USER: Industrial Systems Engineering Dept. S070730:0749AI-
WIN
Izmir University of Economics
DC6556
License for teaching and research at degree granting
institutions
**** FILE SUMMARY
Input C:\Documents and Settings\htuncel\Desktop\murat_problem-
OO.gms
Output C:\Documents and Settings\htuncel\My Documents\gamsdir
\projdir\murat_
problem-OO.lst
**** USER ERROR(S) ENCOUNTERED
\
Murat,
In your equation ca(i) you have the conditional control (ord(w) LE
M(i)).
This is not allowed since M(i) is a variable.
-control statements should only involve parameters, not variables.
Cheers
dax
On 10 nov, 14:53, Murat Özkut wrote:
Hi everyone,
Could you please help me about the following model?
I don’t understand where the problem is and how to fix it.
Thank you.
GAMS Rev 228 x86/MS Windows 11/10/10
15:55:27 Page 1
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
C o m p i l a t i o n
1 SETS
2 i systems / 1,2,3,4 /
3 j index1 / j1j5/
4 w index2 /150/;
5 PARAMETERS
6 k(i) k value
7 / 1 8
8 2 8
9 3 8
10 4 8 /
11 p(i) k value
12 /
13 1 0.85
14 2 0.85
15 3 0.85
16 4 0.85 /
17 C(i) k value
18 / 1 3000
19 2 1400
20 3 2000
21 4 2250 / ;
22
23
24 Scalar alfa /0/ ;
25
26 Scalar CT /150000/ ;
27 Scalar sonuc1 /1/;
28 Scalar sonuc2 /1/;
29 Scalar sonuc3 /1/;
30
31 Variables
32 z;
33
34 Positive variables
35 M(i)
36 a(i);
37
38 Equations
39 cost define objective function
40 con1
41 con2
42 con3
43 ca;
44
45
46 ca(i) … a(i) =e= prod(w$(ord(w) LE M(i)) , ord(w));
47 cost … z =e=alfa*(prod(i,
48 1-sum(j$(ord(j) LE k(i)-1),
49
50 (a(i))(p(i)**ord(j))((1-p(i))**( M(i)-
ord(j) ))
51
52 )
53 ))+(1-alfa)*(CT-sum(i,M(i)*C(i)))/CT;
54
55 con1(i) … M(i) =G= k(i) ;
56 con2 … sum(i, M(i)*C(i))=L=CT;
57 con3(i) … M(i) =L= 50 ;
58 Model relib /all/ ;
59 solve relib using MINLP maximizing z ;
**** 52,256
**** The following MINLP errors were detected in model relib:
**** 52 equation ca .. VAR -control
60 display M.l ;
GAMS Rev 228 x86/MS Windows 11/10/10
15:55:27 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
52 Endogenous $-control operations not allowed
256 Error(s) in analyzing solve statement. More detail appears
Below the solve statement above
**** 2 ERROR(S) 0 WARNING(S)
COMPILATION TIME = 0.000 SECONDS 3 Mb WIN228-228 Jul
26, 2008
USER: Industrial Systems Engineering Dept. S070730:0749AI-
WIN
Izmir University of Economics
DC6556
License for teaching and research at degree granting
institutions
**** FILE SUMMARY
Input C:\Documents and Settings\htuncel\Desktop\murat_problem-
OO.gms
Output C:\Documents and Settings\htuncel\My Documents\gamsdir
\projdir\murat_
problem-OO.lst
**** USER ERROR(S) ENCOUNTERED
\
Dear Dax,
Is there any method for using the function (i.e. binomial(n,k) ) when
n or k is the decion variable for MINLP or DNPL?
Thanks
Murat
On 11 Kasım, 11:48, Dax wrote:
Murat,
In your equation ca(i) you have the conditional control (ord(w) LE
M(i)).
This is not allowed since M(i) is a variable.
-control statements should only involve parameters, not variables.
Cheers
dax
On 10 nov, 14:53, Murat Özkut wrote:
Hi everyone,
Could you please help me about the following model?
I don’t understand where the problem is and how to fix it.
Thank you.
GAMS Rev 228 x86/MS Windows 11/10/10
15:55:27 Page 1
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
C o m p i l a t i o n
1 SETS
2 i systems / 1,2,3,4 /
3 j index1 / j1j5/
4 w index2 /150/;
5 PARAMETERS
6 k(i) k value
7 / 1 8
8 2 8
9 3 8
10 4 8 /
11 p(i) k value
12 /
13 1 0.85
14 2 0.85
15 3 0.85
16 4 0.85 /
17 C(i) k value
18 / 1 3000
19 2 1400
20 3 2000
21 4 2250 / ;
22
23
24 Scalar alfa /0/ ;
25
26 Scalar CT /150000/ ;
27 Scalar sonuc1 /1/;
28 Scalar sonuc2 /1/;
29 Scalar sonuc3 /1/;
30
31 Variables
32 z;
33
34 Positive variables
35 M(i)
36 a(i);
37
38 Equations
39 cost define objective function
40 con1
41 con2
42 con3
43 ca;
44
45
46 ca(i) … a(i) =e= prod(w$(ord(w) LE M(i)) , ord(w));
47 cost … z =e=alfa*(prod(i,
48 1-sum(j$(ord(j) LE k(i)-1),
49
50 (a(i))(p(i)**ord(j))((1-p(i))**( M(i)-
ord(j) ))
51
52 )
53 ))+(1-alfa)*(CT-sum(i,M(i)*C(i)))/CT;
54
55 con1(i) … M(i) =G= k(i) ;
56 con2 … sum(i, M(i)*C(i))=L=CT;
57 con3(i) … M(i) =L= 50 ;
58 Model relib /all/ ;
59 solve relib using MINLP maximizing z ;
**** 52,256
**** The following MINLP errors were detected in model relib:
**** 52 equation ca .. VAR -control
60 display M.l ;
GAMS Rev 228 x86/MS Windows 11/10/10
15:55:27 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
52 Endogenous $-control operations not allowed
256 Error(s) in analyzing solve statement. More detail appears
Below the solve statement above
**** 2 ERROR(S) 0 WARNING(S)
COMPILATION TIME = 0.000 SECONDS 3 Mb WIN228-228 Jul
26, 2008
USER: Industrial Systems Engineering Dept. S070730:0749AI-
WIN
Izmir University of Economics
DC6556
License for teaching and research at degree granting
institutions
**** FILE SUMMARY
Input C:\Documents and Settings\htuncel\Desktop\murat_problem-
OO.gms
Output C:\Documents and Settings\htuncel\My Documents\gamsdir
\projdir\murat_
problem-OO.lst
**** USER ERROR(S) ENCOUNTERED
\