Jsun Yui Wong
The computer program listed here seeks to solve the following system of simultaneous nonlinear Diophantine equations with
X(i)= 0, 1, 2, 3, 4, 5,..., 998, 999, 1000 for i= 1, 2, 3,..., 25.
X(3)^4+X(5)*X(12)*X(14)+X(9)^2+X(10)-38969017#=0
X(10)^4+X(7)*X(9)*X(20)+X(2)^2+X(19)-870735!=0
X(18)^4+X(1)*X(2)*X(8)+X(10)^2+X(11)-52252086#=0
X(9)^4+X(1)*X(7)*X(25)+X(17)^2+X(20)-2917509!=0
X(21)^4+X(2)*X(6)*X(11)+X(19)^2+X(1)-20527529#=0
X(19)^4+X(3)*X(4)*X(7)+X(8)^2+X(12)-637223!=0
X(25)^4+X(5)*X(8)*X(12)+X(1)^2+X(21)-6773278!=0
X(11)^4+X(6)*X(9)*X(10)+X(11)^2+X(13)-28477325#=0
X(8)^4+X(7)*X(13)*X(14)+X(18)^2+X(2)-917275!=0
X(1)^4+X(5)*X(10)*X(20)+X(21)^2+X(14)-211042!=0
X(17)^4+X(7)*X(8)*X(16)+X(12)^2+X(15)-8110408!=0
X(15)^4+X(17)*X(18)*X(19)+X(20)^2+X(3)-5888631!=0
X(7)^4+X(1)*X(20)*X(23)+X(25)^2+X(4)-47478326#=0
X(16)^4+X(5)*X(22)*X(24)+X(3)^2+X(16)-68597277#=0
X(14)^4+X(10)*X(21)*X(25)+X(13)^2+X(25)-19075249#=0
X(4)^4+X(7)*X(12)*X(20)+X(4)^2+X(9)-176555!=0
X(13)^4+X(3)*X(9)*X(25)+X(14)^2+X(17)-2043759!=0
X(5)^4+X(10)*X(20)*X(21)+X(24)^2+X(23)-98261!=0
X(24)^4+X(5)*X(8)*X(11)+X(15)^2+X(7)-5329953!=0
X(12)^4+X(10)*X(15)*X(19)+X(5)^2+X(24)-745777!=0
X(23)^4+X(16)*X(18)*X(20)+X(23)^2+X(22)-461147!=0
X(2)^4+X(12)*X(15)*X(24)+X(16)^2+X(6)-47534872#=0
X(20)^4+X(22)*X(23)*X(25)+X(22)^2+X(18)-4512876!=0
X(22)^4+X(11)*X(17)*X(22)+X(6)^2+X(5)-2021167!=0
X(6)^4+X(9)*X(19)*X(24)+X(7)^2+X(8)-14836390#=0
X(18)^4+X(7)*X(12)*X(25)+X(6)^2+X(15)-52327275#=0
This nonlinear system is based on line 388 through line 430 of the computer program on pages 872-874 of Wong [3], which is based on Conley [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR KK=1 TO 25
94 A(KK)=FIX(RND*1001)
95 NEXT KK
126 IMAR=10+FIX(RND*10000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 25
131 X(K)=A(K)
132 NEXT K
251 IAP1=1+FIX(RND*25)
252 X(IAP1)=FIX(RND*1001)
321 L1=X(3)^4+X(5)*X(12)*X(14)+X(9)^2+X(10)-38969017#
322 L2=X(10)^4+X(7)*X(9)*X(20)+X(2)^2+X(19)-870735!
323 L3=X(18)^4+X(1)*X(2)*X(8)+X(10)^2+X(11)-52252086#
324 L4=X(9)^4+X(1)*X(7)*X(25)+X(17)^2+X(20)-2917509!
325 L5=X(21)^4+X(2)*X(6)*X(11)+X(19)^2+X(1)-20527529#
326 L6=X(19)^4+X(3)*X(4)*X(7)+X(8)^2+X(12)-637223!
327 L7=X(25)^4+X(5)*X(8)*X(12)+X(1)^2+X(21)-6773278!
328 L8=X(11)^4+X(6)*X(9)*X(10)+X(11)^2+X(13)-28477325#
329 L9=X(8)^4+X(7)*X(13)*X(14)+X(18)^2+X(2)-917275!
330 L10=X(1)^4+X(5)*X(10)*X(20)+X(21)^2+X(14)-211042!
331 L11=X(17)^4+X(7)*X(8)*X(16)+X(12)^2+X(15)-8110408!
332 L12=X(15)^4+X(17)*X(18)*X(19)+X(20)^2+X(3)-5888631!
333 L13=X(7)^4+X(1)*X(20)*X(23)+X(25)^2+X(4)-47478326#
334 L14=X(16)^4+X(5)*X(22)*X(24)+X(3)^2+X(16)-68597277#
335 L15=X(14)^4+X(10)*X(21)*X(25)+X(13)^2+X(25)-19075249#
336 L16=X(4)^4+X(7)*X(12)*X(20)+X(4)^2+X(9)-176555!
337 L17=X(13)^4+X(3)*X(9)*X(25)+X(14)^2+X(17)-2043759!
338 L18=X(5)^4+X(10)*X(20)*X(21)+X(24)^2+X(23)-98261!
339 L19=X(24)^4+X(5)*X(8)*X(11)+X(15)^2+X(7)-5329953!
340 L20=X(12)^4+X(10)*X(15)*X(19)+X(5)^2+X(24)-745777!
341 L21=X(23)^4+X(16)*X(18)*X(20)+X(23)^2+X(22)-461147!
342 L22=X(2)^4+X(12)*X(15)*X(24)+X(16)^2+X(6)-47534872#
343 L23=X(20)^4+X(22)*X(23)*X(25)+X(22)^2+X(18)-4512876!
344 L24=X(22)^4+X(11)*X(17)*X(22)+X(6)^2+X(5)-2021167!
345 L25=X(6)^4+X(9)*X(19)*X(24)+X(7)^2+X(8)-14836390#
346 L26=X(18)^4+X(7)*X(12)*X(25)+X(6)^2+X(15)-52327275#
1220 P1NEWMAY=-ABS(L1)-ABS(L2)-ABS(L3)-ABS(L4)-ABS(L5)-ABS(L6)-ABS(L7)-ABS(L8)-ABS(L9)-ABS(L10)-ABS(L11)-ABS(L12)-ABS(L13)
1222 P1NEWMAZ=-ABS(L14)-ABS(L15)-ABS(L16)-ABS(L17)-ABS(L18)-ABS(L19)-ABS(L20)-ABS(L21)-ABS(L22)-ABS(L23)-ABS(L24)-ABS(L25)-ABS(L26)
1448 P=P1NEWMAY+P1NEWMAZ
1451 IF P<=M THEN 1670
1501 LL1=L1:LL2=L2:LL3=L3:LL4=L4:LL5=L5
1502 LL6=L6:LL7=L7:LL8=L8:LL9=L9:LL10=L10
1503 LL11=L11:LL12=L12:LL13=L13:LL14=L14:LL15=L15
1504 LL16=L16:LL17=L17:LL18=L18:LL19=L19:LL20=L20
1505 LL21=L21:LL22=L22:LL23=L23:LL24=L24:LL25=L25
1506 LL26=L26
1657 FOR KEW=1 TO 25
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1666 GOTO 128
1670 NEXT I
1890 IF M>-3 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5)
1913 PRINT A(6),A(7),A(8),A(9),A(10)
1914 PRINT A(11),A(12),A(13),A(14),A(15)
1915 PRINT A(16),A(17),A(18),A(19),A(20)
1916 PRINT A(21),A(22),A(23),A(24),A(25),M,JJJJ
1923 PRINT LL1,LL2,LL3,LL4,LL5
1924 PRINT LL6,LL7,LL8,LL9,LL10
1925 PRINT LL11,LL12,LL13,LL14,LL15
1926 PRINT LL16,LL17,LL18,LL19,LL20
1927 PRINT LL21,LL22,LL23,LL24,LL25
1928 PRINT LL26
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its output from JJJJ=-32000 through JJJJ=-31738 is presented below. (What immediately follows is a manual copy from the computer screen.)
21 83 79 16 9
62 83 29 41 29
73 29 37 66 49
91 53 85 27 46
67 37 18 48 51
0 -31998
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0
21 83 79 16 9
62 83 29 41 29
73 29 37 66 49
91 53 85 27 46
67 37 18 48 51
0 -31994
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0
21 83 79 16 9
62 83 29 41 29
73 29 37 66 49
91 53 85 27 46
67 37 18 48 51
0 -31930
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0
21 83 79 16 9
62 83 29 41 29
73 29 37 66 49
91 53 85 27 46
67 37 18 48 51
0 -31766
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0
21 83 79 16 9
62 83 29 41 29
73 29 37 66 49
91 53 85 27 46
67 37 18 48 51
0 -31738
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0
Interpreted in accordance with line 1912 through line 1928, the output above was obtained in one hour by running only through JJJJ=-31738 on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
References
[1] Conley, W. (1994, July-September). "A New Approach to Algebra," Computers in Education Journal, IV(3) pp. 65-71.
[2] Mills, W. H. (1953). "A System of Quadratic Diophantine Equations," Pacific J. Math. Vol. 3, pp. 209-220.
[3] Wong, J. Y. (1996). "A Note on Optimization in Integers," International Journal of Mathematical Education in Science and Technology, Vol. 27, No. 6, pp. 865-874.
Tuesday, June 30, 2009
Monday, June 29, 2009
A Computer Program for Integer Nonlinear Programming
Jsun Yui Wong
The computer program listed below seeks to optimize in integers the following problem.
Objective function:
Maximize:
-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)
where
W1=(X(1)+X(2)+X(3)+.03)/(9.000001E-02*X(1)+X(2)+X(3)+.03)
W2=(X(2)+X(3)+.03)/(.07*X(2)+X(3)+.03)
W3=(X(3)+.03)/(.13*X(3)+.03)
Constraints:
X(1)+X(2)+X(3)-1=0
X(1)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
X(2)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
X(3)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
This problem is an adaptation of Problem 347 on page 168 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 3
93 A(K)=+FIX(RND*2001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*3)
1111 X(IJU)=+FIX(RND*2001)
1161 PEN1=X(1)+X(2)+X(3)-1
1163 IF PEN1=0 THEN PEN1=0 ELSE PEN1=PEN1
1411 W1=(X(1)+X(2)+X(3)+.03)/(9.000001E-02*X(1)+X(2)+X(3)+.03)
1422 W2=(X(2)+X(3)+.03)/(.07*X(2)+X(3)+.03)
1433 W3=(X(3)+.03)/(.13*X(3)+.03)
1486 P=-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)-333333!*ABS(PEN1)
1499 PR=-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-18888 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 20 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 1 -17374.6255045664
-17374.6255045664 -31997
1 0 0 -17637.93743737338
-17637.93743737338 -31976
0 0 1 -17374.6255045664
-17374.6255045664 -31936
1 0 0 -17637.93743737338
-17637.93743737338 -31897
0 0 1 -17374.6255045664
-17374.6255045664 -31876
Interpreted in accordance with line 1912, the output above shows the best solutions--at JJJJ=
-31997, JJJJ=-31976, and JJJJ=-31876--produced during the first 20 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to optimize in integers the following problem.
Objective function:
Maximize:
-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)
where
W1=(X(1)+X(2)+X(3)+.03)/(9.000001E-02*X(1)+X(2)+X(3)+.03)
W2=(X(2)+X(3)+.03)/(.07*X(2)+X(3)+.03)
W3=(X(3)+.03)/(.13*X(3)+.03)
Constraints:
X(1)+X(2)+X(3)-1=0
X(1)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
X(2)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
X(3)=0, 1, 2, 3, 4, 5, 6,..., 1998, 1999, 2000
This problem is an adaptation of Problem 347 on page 168 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 3
93 A(K)=+FIX(RND*2001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*3)
1111 X(IJU)=+FIX(RND*2001)
1161 PEN1=X(1)+X(2)+X(3)-1
1163 IF PEN1=0 THEN PEN1=0 ELSE PEN1=PEN1
1411 W1=(X(1)+X(2)+X(3)+.03)/(9.000001E-02*X(1)+X(2)+X(3)+.03)
1422 W2=(X(2)+X(3)+.03)/(.07*X(2)+X(3)+.03)
1433 W3=(X(3)+.03)/(.13*X(3)+.03)
1486 P=-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)-333333!*ABS(PEN1)
1499 PR=-8204.37*LOG(W1)-9008.72*LOG(W2)-9330.46*LOG(W3)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-18888 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 20 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 1 -17374.6255045664
-17374.6255045664 -31997
1 0 0 -17637.93743737338
-17637.93743737338 -31976
0 0 1 -17374.6255045664
-17374.6255045664 -31936
1 0 0 -17637.93743737338
-17637.93743737338 -31897
0 0 1 -17374.6255045664
-17374.6255045664 -31876
Interpreted in accordance with line 1912, the output above shows the best solutions--at JJJJ=
-31997, JJJJ=-31976, and JJJJ=-31876--produced during the first 20 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
Sunday, June 28, 2009
A Computer Program for Integer Nonlinear Programming
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-(1-EXP(-10*X(1)*EXP(-X(3))))-(1-EXP(-10*X(2)*EXP(-X(4))))
Constraints:
X(1)+X(2)-1=0
X(3)+X(4)-1=0
X(1)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
X(2)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
X(3)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
X(4)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
This problem is an adaptation of Problem 265 on page 89 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=FIX(RND*1001)
1151 PEN1=X(1)+X(2)-1
1159 IF PEN1=0 THEN PEN1=0 ELSE PEN1=PEN1
1161 PEN2=X(3)+X(4)-1
1163 IF PEN2=0 THEN PEN2=0 ELSE PEN2=PEN2
1486 P=-(1-EXP(-10*X(1)*EXP(-X(3))))-(1-EXP(-10*X(2)*EXP(-X(4))))-333333!*ABS(PEN1)-33333!*ABS(PEN2)
1499 PR=-(1-EXP(-10*X(1)*EXP(-X(3))))-(1-EXP(-10*X(2)*EXP(-X(4))))
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 20 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
1 0 0 1 -.9999546000702375
-.9999546000702375 -31988
1 0 1 0 -.9747465983043361
-.9747465983043361 -31986
0 1 0 1 -.9747465983043361
-.9747465983043361 -31979
0 1 1 0 -.9999546000702375
-.9999546000702375 -31939
0 1 1 0 -.9999546000702375
-.9999546000702375 -31931
0 1 1 0 -.9999546000702375
-.9999546000702375 -31901
0 1 1 0 -.9999546000702375
-.9999546000702375 -31893
0 1 1 0 -.9999546000702375
-.9999546000702375 -31892
1 0 0 1 -.9999546000702375
-.9999546000702375 -31890
0 1 0 1 -.9747465983043361
-.9747465983043361 -31880
Interpreted in accordance with line 1912, the output above shows two alternative best solutions--at JJJJ=-31986, JJJJ=-31979, and JJJJ=-31880--produced during the first 20 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-(1-EXP(-10*X(1)*EXP(-X(3))))-(1-EXP(-10*X(2)*EXP(-X(4))))
Constraints:
X(1)+X(2)-1=0
X(3)+X(4)-1=0
X(1)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
X(2)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
X(3)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
X(4)=0, 1, 2, 3, 4, 5, 6,..., 998, 999, 1000
This problem is an adaptation of Problem 265 on page 89 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=FIX(RND*1001)
1151 PEN1=X(1)+X(2)-1
1159 IF PEN1=0 THEN PEN1=0 ELSE PEN1=PEN1
1161 PEN2=X(3)+X(4)-1
1163 IF PEN2=0 THEN PEN2=0 ELSE PEN2=PEN2
1486 P=-(1-EXP(-10*X(1)*EXP(-X(3))))-(1-EXP(-10*X(2)*EXP(-X(4))))-333333!*ABS(PEN1)-33333!*ABS(PEN2)
1499 PR=-(1-EXP(-10*X(1)*EXP(-X(3))))-(1-EXP(-10*X(2)*EXP(-X(4))))
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 20 seconds of running is presented below. (What immediately follows is a manual copy from the computer screen.)
1 0 0 1 -.9999546000702375
-.9999546000702375 -31988
1 0 1 0 -.9747465983043361
-.9747465983043361 -31986
0 1 0 1 -.9747465983043361
-.9747465983043361 -31979
0 1 1 0 -.9999546000702375
-.9999546000702375 -31939
0 1 1 0 -.9999546000702375
-.9999546000702375 -31931
0 1 1 0 -.9999546000702375
-.9999546000702375 -31901
0 1 1 0 -.9999546000702375
-.9999546000702375 -31893
0 1 1 0 -.9999546000702375
-.9999546000702375 -31892
1 0 0 1 -.9999546000702375
-.9999546000702375 -31890
0 1 0 1 -.9747465983043361
-.9747465983043361 -31880
Interpreted in accordance with line 1912, the output above shows two alternative best solutions--at JJJJ=-31986, JJJJ=-31979, and JJJJ=-31880--produced during the first 20 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
A Computer Program and Its Output for an Integer Nonlinear Programming Problem
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
+X(1)
Constraints:
X(2)-X(1)^3>=0
X(1)^2-X(2)>=0
X(2)-X(1)^3-X(3)^2=0
X(1)^2-X(2)-X(4)^2=0
X(1)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(2)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(3)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(4)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
This problem is an adaptation of Problem 263 on page 87 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=-1000+FIX(RND*2001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=-1000+FIX(RND*2001)
1131 PEN1=X(2)-X(1)^3
1139 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1141 PEN2=X(1)^2-X(2)
1143 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1151 PEN3=X(2)-X(1)^3-X(3)^2
1159 IF PEN3=0 THEN PEN3=0 ELSE PEN3=PEN3
1161 PEN4=X(1)^2-X(2)-X(4)^2
1163 IF PEN4=0 THEN PEN4=0 ELSE PEN4=PEN4
1486 P=+X(1)-333333!*ABS(PEN1)-333333!*ABS(PEN2)-333333!*ABS(PEN3)-333333!*ABS(PEN4)
1499 PR=+X(1)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 10 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
1 1 0 0 1
1 -31490
1 1 0 0 1
1 -29023
-4 -48 4 -8 -4
-4 -28928
-3 9 6 0 -3
-3 -28695
-4 -48 4 -8 -4
-4 -28148
-4 -48 4 -8 -4
-4 -27189
-3 -27 0 6 -3
-3 -26966
-4 0 8 -4 -4
-4 -25278
-4 -48 4 -8 -4
-4 -24529
1 1 0 0 1
1 -23329
Interpreted in accordance with line 1912, the output above shows the best solution produced at JJJJ=-31490, JJJJ=-29023, and JJJJ=-23329 during the first 10 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski (1987): "More test examples for nonlinear programming codes," Springer-Verlag, Berlin Heidelberg New York.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
+X(1)
Constraints:
X(2)-X(1)^3>=0
X(1)^2-X(2)>=0
X(2)-X(1)^3-X(3)^2=0
X(1)^2-X(2)-X(4)^2=0
X(1)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(2)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(3)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(4)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
This problem is an adaptation of Problem 263 on page 87 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=-1000+FIX(RND*2001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=-1000+FIX(RND*2001)
1131 PEN1=X(2)-X(1)^3
1139 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1141 PEN2=X(1)^2-X(2)
1143 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1151 PEN3=X(2)-X(1)^3-X(3)^2
1159 IF PEN3=0 THEN PEN3=0 ELSE PEN3=PEN3
1161 PEN4=X(1)^2-X(2)-X(4)^2
1163 IF PEN4=0 THEN PEN4=0 ELSE PEN4=PEN4
1486 P=+X(1)-333333!*ABS(PEN1)-333333!*ABS(PEN2)-333333!*ABS(PEN3)-333333!*ABS(PEN4)
1499 PR=+X(1)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 10 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
1 1 0 0 1
1 -31490
1 1 0 0 1
1 -29023
-4 -48 4 -8 -4
-4 -28928
-3 9 6 0 -3
-3 -28695
-4 -48 4 -8 -4
-4 -28148
-4 -48 4 -8 -4
-4 -27189
-3 -27 0 6 -3
-3 -26966
-4 0 8 -4 -4
-4 -25278
-4 -48 4 -8 -4
-4 -24529
1 1 0 0 1
1 -23329
Interpreted in accordance with line 1912, the output above shows the best solution produced at JJJJ=-31490, JJJJ=-29023, and JJJJ=-23329 during the first 10 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski (1987): "More test examples for nonlinear programming codes," Springer-Verlag, Berlin Heidelberg New York.
Saturday, June 27, 2009
A Computer Program for Integer Nonlinear Programming
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-X(1)*X(2)*X(3)*X(4) +3*X(1)*X(2)*X(4)+4*X(1)*X(2)*X(3)-12*X(1)*X(2)+X(2)*X(3)*X(4)-3*X(2)*X(4)-4*X(2)*X(3)+12*X(2)+2*X(1)*X(3)*X(4)-6*X(1)*X(4)
-8*X(1)*X(3)+24*X(1)-2*X(3)*X(4)+6*X(4)+8*X(3)-24-1.5*X(5)^4+5.75*X(5)^3-5.25*X(5)^2
Constraints:
34-X(1)^2-X(2)^2-X(3)^2-X(4)^2-X(5)^2>=0
X(1)=1, 2, 3, 4, 5, 6,...
X(2)=2, 3, 4, 5, 6,...
X(3)=3, 4, 5, 6,...
X(4)=4, 5, 6,...
X(5)=-1000, -999, -998, -997,..., 0, 1, 2, 3,...
This problem is an adaptation of Problem 270 on page 94 of Schittkowski [1]. The adaptation has five general integer variables as shown above.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 5
93 A(K)=4+FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 5
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.8 THEN GOTO 1110 ELSE GOTO 1115
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=IJU+FIX(RND*1001)
1112 GOTO 1151
1115 X(5)=-1000+FIX(RND*2001)
1151 PEN1=34-X(1)^2-X(2)^2-X(3)^2-X(4)^2-X(5)^2
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1486 PON=-X(1)*X(2)*X(3)*X(4) +3*X(1)*X(2)*X(4)+4*X(1)*X(2)*X(3)-12*X(1)*X(2)+X(2)*X(3)*X(4)-3*X(2)*X(4)-4*X(2)*X(3)+12*X(2)+2*X(1)*X(3)*X(4)-6*X(1)*X(4)
1487 PTW=-8*X(1)*X(3)+24*X(1)-2*X(3)*X(4)+6*X(4)+8*X(3)-24-1.5*X(5)^4+5.75*X(5)^3-5.25*X(5)^2
1488 P=PON+PTW-333333!*ABS(PEN1)
1499 PR=PON+PTW
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 5
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first two minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
1 2 3 4 2
1 1 -31973
2 2 3 4 1
-1 -1 -31865
1 2 3 4 0
0 0 -31801
1 2 3 4 2
1 1 -31598
1 2 3 4 0
0 0 -31400
2 2 3 4 1
-1 -1 -31384
1 2 3 4 2
1 1 -31318
Interpreted in accordance with line 1912, the output above shows the best solution produced at JJJJ=-31973, JJJJ=-31598, and JJJJ=-31318 during the first two minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
-X(1)*X(2)*X(3)*X(4) +3*X(1)*X(2)*X(4)+4*X(1)*X(2)*X(3)-12*X(1)*X(2)+X(2)*X(3)*X(4)-3*X(2)*X(4)-4*X(2)*X(3)+12*X(2)+2*X(1)*X(3)*X(4)-6*X(1)*X(4)
-8*X(1)*X(3)+24*X(1)-2*X(3)*X(4)+6*X(4)+8*X(3)-24-1.5*X(5)^4+5.75*X(5)^3-5.25*X(5)^2
Constraints:
34-X(1)^2-X(2)^2-X(3)^2-X(4)^2-X(5)^2>=0
X(1)=1, 2, 3, 4, 5, 6,...
X(2)=2, 3, 4, 5, 6,...
X(3)=3, 4, 5, 6,...
X(4)=4, 5, 6,...
X(5)=-1000, -999, -998, -997,..., 0, 1, 2, 3,...
This problem is an adaptation of Problem 270 on page 94 of Schittkowski [1]. The adaptation has five general integer variables as shown above.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 5
93 A(K)=4+FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 5
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.8 THEN GOTO 1110 ELSE GOTO 1115
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=IJU+FIX(RND*1001)
1112 GOTO 1151
1115 X(5)=-1000+FIX(RND*2001)
1151 PEN1=34-X(1)^2-X(2)^2-X(3)^2-X(4)^2-X(5)^2
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1486 PON=-X(1)*X(2)*X(3)*X(4) +3*X(1)*X(2)*X(4)+4*X(1)*X(2)*X(3)-12*X(1)*X(2)+X(2)*X(3)*X(4)-3*X(2)*X(4)-4*X(2)*X(3)+12*X(2)+2*X(1)*X(3)*X(4)-6*X(1)*X(4)
1487 PTW=-8*X(1)*X(3)+24*X(1)-2*X(3)*X(4)+6*X(4)+8*X(3)-24-1.5*X(5)^4+5.75*X(5)^3-5.25*X(5)^2
1488 P=PON+PTW-333333!*ABS(PEN1)
1499 PR=PON+PTW
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 5
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),A(5),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first two minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
1 2 3 4 2
1 1 -31973
2 2 3 4 1
-1 -1 -31865
1 2 3 4 0
0 0 -31801
1 2 3 4 2
1 1 -31598
1 2 3 4 0
0 0 -31400
2 2 3 4 1
-1 -1 -31384
1 2 3 4 2
1 1 -31318
Interpreted in accordance with line 1912, the output above shows the best solution produced at JJJJ=-31973, JJJJ=-31598, and JJJJ=-31318 during the first two minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
Friday, June 26, 2009
A Computer Program for Nonlinear Programming Problems Involving Integer Variables and Continuous Variables
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
(.0201/10^7)*X(1)^4*X(2)*X(3)^2
Constraints:
675-X(1)^2*X(2)>=0
.419-(X(1)^2*X(3)^2)/10^7>=0
X(1)>=0; X(1)<=36
X(2)>=0; X(2)<=5
X(3)=0, 1, 2, 3,..., 125
This problem is an adaptation of Problem 346 on page 167 of Schittkowski [1]. The adaptation has integer variable X(3) as shown above.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 REM
93 REM
99 REM
101 A(1)=(RND*36)
102 A(2)=(RND*5)
103 A(3)=FIX(RND*126)
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.6666 THEN GOTO 1103 ELSE GOTO 1114
1103 REM
1105 REM
1107 REM
1109 REM
1110 IJU=1+FIX(RND*2)
1111 X(IJU)=A(IJU)+(-1+FIX(RND*3))*(.0025*A(IJU))
1112 GOTO 1151
1114 REM
1115 X(3)=FIX(RND*126)
1151 PEN1=675-X(1)^2*X(2)
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1171 PEN2=.419-(X(1)^2*X(3)^2)/10^7
1179 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1488 P=(.0201/10^7)*X(1)^4*X(2)*X(3)^2-333333!*ABS(PEN1)-333333!*ABS(PEN2)
1499 PR=(.0201/10^7)*X(1)^4*X(2)*X(3)^2
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>5.684 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 37 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
20.26603416299961 1.64339894042904 101
5.684036750728495 5.684036750728495 -28506
16.37551353092925 2.517100061742692 125
5.684552274510146 5.684552274510146 -21646
16.37535405657021 2.517002845367522 125
5.68411129738234 5.68411129738234 -21318
Interpreted in accordance with line 1912, the output above shows the candidate solutions produced during the first 37 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
(.0201/10^7)*X(1)^4*X(2)*X(3)^2
Constraints:
675-X(1)^2*X(2)>=0
.419-(X(1)^2*X(3)^2)/10^7>=0
X(1)>=0; X(1)<=36
X(2)>=0; X(2)<=5
X(3)=0, 1, 2, 3,..., 125
This problem is an adaptation of Problem 346 on page 167 of Schittkowski [1]. The adaptation has integer variable X(3) as shown above.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 REM
93 REM
99 REM
101 A(1)=(RND*36)
102 A(2)=(RND*5)
103 A(3)=FIX(RND*126)
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.6666 THEN GOTO 1103 ELSE GOTO 1114
1103 REM
1105 REM
1107 REM
1109 REM
1110 IJU=1+FIX(RND*2)
1111 X(IJU)=A(IJU)+(-1+FIX(RND*3))*(.0025*A(IJU))
1112 GOTO 1151
1114 REM
1115 X(3)=FIX(RND*126)
1151 PEN1=675-X(1)^2*X(2)
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1171 PEN2=.419-(X(1)^2*X(3)^2)/10^7
1179 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1488 P=(.0201/10^7)*X(1)^4*X(2)*X(3)^2-333333!*ABS(PEN1)-333333!*ABS(PEN2)
1499 PR=(.0201/10^7)*X(1)^4*X(2)*X(3)^2
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>5.684 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 37 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)
20.26603416299961 1.64339894042904 101
5.684036750728495 5.684036750728495 -28506
16.37551353092925 2.517100061742692 125
5.684552274510146 5.684552274510146 -21646
16.37535405657021 2.517002845367522 125
5.68411129738234 5.68411129738234 -21318
Interpreted in accordance with line 1912, the output above shows the candidate solutions produced during the first 37 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
A Computer Program for Nonlinear Programming Problems Involving Integer Variables and Continuous Variables
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
(24.55*X(1)+26.75*X(2)+39!*X(3)+40.5*X(4))
Constraints:
2.3*X(1)+5.6*X(2)+11.1*X(3)+1.3*X(4)-5>=0
12!*X(1)+11.9*X(2)+41.8*X(3)+52.1*X(4)-1.645*Q^.5-12>=0
X(1)+X(2)+X(3)+X(4)-1=0
Q=(.53*X(1))^2+(.44*X(2))^2+(4.5*X(3))^2+(.79*X(4))^2
X(1)=0, 1, 2, 3,..., 999, 1000
X(2)=0, 1, 2, 3,..., 999, 1000
X(3)>=0
X(4)>=0
This problem is an adaptation of Problem 353 on page 173 of Schittkowski [1]. The new problem has integer variables X(1) and X(2) as shown above.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.6666 THEN GOTO 1110 ELSE GOTO 1125
1110 IJUU=1+FIX(RND*2)
1111 X(IJUU)=FIX(RND*1001)
1112 GOTO 1135
1125 X(3)=A(3)+(-1+FIX(RND*3))*(.0025*A(3))
1135 X(4)=1-X(1)-X(2)-X(3)
1151 PEN1=2.3*X(1)+5.6*X(2)+11.1*X(3)+1.3*X(4)-5
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1163 Q=(.53*X(1))^2+(.44*X(2))^2+(4.5*X(3))^2+(.79*X(4))^2
1171 PEN2=12!*X(1)+11.9*X(2)+41.8*X(3)+52.1*X(4)-1.645*Q^.5-12
1179 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1488 P=(24.55*X(1)+26.75*X(2)+39!*X(3)+40.5*X(4))-333333!*ABS(PEN1)-333333!*ABS(PEN2)
1499 PR=(24.55*X(1)+26.75*X(2)+39!*X(3)+40.5*X(4))
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>38 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its best candidate solutions produced during the first 5 seconds of running are presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 .3775832017530801 .6224167982469199
39.93362519737038 39.93362519737038 -31998
0 0 .3775833227110804 .6224166772889196
39.93362501593338 39.93362501593338 -31997
Interpreted in accordance with line 1912, the output above shows the best candidate solutions produced during the first 5 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
(24.55*X(1)+26.75*X(2)+39!*X(3)+40.5*X(4))
Constraints:
2.3*X(1)+5.6*X(2)+11.1*X(3)+1.3*X(4)-5>=0
12!*X(1)+11.9*X(2)+41.8*X(3)+52.1*X(4)-1.645*Q^.5-12>=0
X(1)+X(2)+X(3)+X(4)-1=0
Q=(.53*X(1))^2+(.44*X(2))^2+(4.5*X(3))^2+(.79*X(4))^2
X(1)=0, 1, 2, 3,..., 999, 1000
X(2)=0, 1, 2, 3,..., 999, 1000
X(3)>=0
X(4)>=0
This problem is an adaptation of Problem 353 on page 173 of Schittkowski [1]. The new problem has integer variables X(1) and X(2) as shown above.
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=FIX(RND*1001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.6666 THEN GOTO 1110 ELSE GOTO 1125
1110 IJUU=1+FIX(RND*2)
1111 X(IJUU)=FIX(RND*1001)
1112 GOTO 1135
1125 X(3)=A(3)+(-1+FIX(RND*3))*(.0025*A(3))
1135 X(4)=1-X(1)-X(2)-X(3)
1151 PEN1=2.3*X(1)+5.6*X(2)+11.1*X(3)+1.3*X(4)-5
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1163 Q=(.53*X(1))^2+(.44*X(2))^2+(4.5*X(3))^2+(.79*X(4))^2
1171 PEN2=12!*X(1)+11.9*X(2)+41.8*X(3)+52.1*X(4)-1.645*Q^.5-12
1179 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1488 P=(24.55*X(1)+26.75*X(2)+39!*X(3)+40.5*X(4))-333333!*ABS(PEN1)-333333!*ABS(PEN2)
1499 PR=(24.55*X(1)+26.75*X(2)+39!*X(3)+40.5*X(4))
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>38 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its best candidate solutions produced during the first 5 seconds of running are presented below. (What immediately follows is a manual copy from the computer screen.)
0 0 .3775832017530801 .6224167982469199
39.93362519737038 39.93362519737038 -31998
0 0 .3775833227110804 .6224166772889196
39.93362501593338 39.93362501593338 -31997
Interpreted in accordance with line 1912, the output above shows the best candidate solutions produced during the first 5 seconds of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
Thursday, June 25, 2009
A Computer Program for Nonlinear Programming Problems Involving Integer Variables and Continuous Variables
Jsun Yui Wong
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
X(1)*X(2)*X(3)
Constraints:
48-X(1)^2-2*X(2)^2-4*X(3)^2>=0
X(1)=0, 1, 2, 3,..., 999, 1000
X(2)>=0
X(3)=0, 1, 2, 3,..., 999, 1000
This problem is an adaptation of Problem 342 on page 163 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 3
93 A(K)=FIX(RND*1000)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.6666 THEN GOTO 1103 ELSE GOTO 1114
1103 IF RND<.5 THEN GOTO 1105 ELSE GOTO 1109
1105 X(1)=FIX(RND*1001)
1107 GOTO 1151
1109 X(3)=FIX(RND*1001)
1112 GOTO 1151
1114 X(2)=A(2)+(-1+FIX(RND*3))*(.05*A(2))
1151 PEN1=48-X(1)^2-2*X(2)^2-4*X(3)^2
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1488 P=X(1)*X(2)*X(3)-333333!*ABS(PEN1)
1499 PR=X(1)*X(2)*X(3)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>22.61 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its best candidate solutions produced in the first 3 minutes of running are presented below. (What immediately follows is a manual copy from the computer screen.)
4 2.828408573362359 2 22.62726858689887
22.62726858689887 -30068
4 2.828068220564003 2 22.62454576451202
22.62454576451202 -29711
Interpreted in accordance with line 1912, the output above shows the best candidate solutions obtained in the first 3 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
The computer program listed below seeks to solve the following problem.
Objective function:
Maximize:
X(1)*X(2)*X(3)
Constraints:
48-X(1)^2-2*X(2)^2-4*X(3)^2>=0
X(1)=0, 1, 2, 3,..., 999, 1000
X(2)>=0
X(3)=0, 1, 2, 3,..., 999, 1000
This problem is an adaptation of Problem 342 on page 163 of Schittkowski [1].
0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 3
93 A(K)=FIX(RND*1000)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 3
131 X(K)=A(K)
132 NEXT K
1100 IF RND<.6666 THEN GOTO 1103 ELSE GOTO 1114
1103 IF RND<.5 THEN GOTO 1105 ELSE GOTO 1109
1105 X(1)=FIX(RND*1001)
1107 GOTO 1151
1109 X(3)=FIX(RND*1001)
1112 GOTO 1151
1114 X(2)=A(2)+(-1+FIX(RND*3))*(.05*A(2))
1151 PEN1=48-X(1)^2-2*X(2)^2-4*X(3)^2
1159 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1488 P=X(1)*X(2)*X(3)-333333!*ABS(PEN1)
1499 PR=X(1)*X(2)*X(3)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 3
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>22.61 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),M,MM,JJJJ
1999 NEXT JJJJ
This BASIC computer program was run with the IBM basica/D interpreter, and its best candidate solutions produced in the first 3 minutes of running are presented below. (What immediately follows is a manual copy from the computer screen.)
4 2.828408573362359 2 22.62726858689887
22.62726858689887 -30068
4 2.828068220564003 2 22.62454576451202
22.62454576451202 -29711
Interpreted in accordance with line 1912, the output above shows the best candidate solutions obtained in the first 3 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
Reference
[1] K. Schittkowski, "More Test Examples for Nonlinear Programming Codes," Springer-Verlag, Berlin Heidelberg New York, 1987.
Subscribe to:
Posts (Atom)