Monday, July 13, 2009

A Computer Program for Solving Nonlinear Programs with Big Integer Variables and Continuous Variables

Jsun Yui Wong

The computer program listed below seeks to solve Problem 32 on page 430 of Himmelblau (1972) plus the restriction that X(4)= -10000, -9999, -9998,..., 0, 1, 2, 3,..., 9998, 9999, 10000. On page 171 Schittkowski (1987) cites the original Himmelblau problem. (The present paper's X(4) is Himmelblau's X(3).)

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
93 A(1)=-200+RND*400
94 A(2)=-200+RND*400
95 A(3)=-200+RND*400
96 A(4)=-10000+FIX(RND*20001)
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
811 IF RND<.99 THEN 903 ELSE 991
903 IF RND<1/3 THEN 911 ELSE IF RND<.6666 THEN 921 ELSE 931
911 IF RND<.5 THEN X(1)=-200+RND*400 ELSE X(1)=A(1)+(1-2*RND)*.001*A(1)
915 GOTO 1151
921 IF RND>.5 THEN X(2)=-200+RND*400 ELSE X(2)=A(2)+(1-2*RND)*.001*A(2)
925 GOTO 1151
931 IF RND>.5 THEN X(3)=-200+RND*400 ELSE X(3)=A(3)+(1-2*RND)*.001*A(3)
935 GOTO 1151
991 X(4)=-10000+FIX(RND*20001)
1151 PN1=( ( ( (X(1)^2+X(2)^2*0+X(4)^2*0^2)/(1+X(3)^2*0) )-7.391 ) /7.391 )^2
1412 PN2=( ( ((X(1)^2+X(2)^2*.000428+X(4)^2*.000428^2)/(1+X(3)^2*.000428) )-11.18 ) /11.18 )^2
1413 PN3=((((X(1)^2+X(2)^2*.001+X(4)^2*.001^2)/(1+X(3)^2*.001))-16.44)/16.44)^2
1414 PN4=( ( ((X(1)^2+X(2)^2*.00161+X(4)^2*.00161^2)/(1+X(3)^2*.00161) )-16.2 ) /16.2 )^2
1415 PN5=( ( ((X(1)^2+X(2)^2*.00209+X(4)^2*.00209^2)/(1+X(3)^2*.00209) )-22.2 ) /22.2 )^2
1416 PN6=( ( ( (X(1)^2+X(2)^2*.00348+X(4)^2*.00348^2)/(1+X(3)^2*.00348) )-24.02 ) /24.02 )^2
1417 PN7=( (( (X(1)^2+X(2)^2*.00525+X(4)^2*.00525^2)/(1+X(3)^2*.00525) )-31.32 ) /31.32 )^2
1488 P=-10000*(PN1+PN2+PN3+PN4+PN5+PN6+PN7)
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>-318.58 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3)
1915 PRINT A(4),M,JJJJ
1999 NEXT JJJJ

This BASIC computer program was run with the IBM basica/D interpreter, and the output produced in the first 135 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)

2.714237050418973 140.4151258896569 31.49233633228084
-1705 -318.5732852674301 -31298

2.714280115627704 -140.2320246506003 31.42037915619026
1700 -318.5740851107986 -30759

-2.714207738385269 -140.6681589846467 -31.5975277066794
-1713 -318.5729772121449 -30490

2.714219334477566 140.659169951501 31.59590264214858
-1713 -318.5727862195563 -30038

-2.714275982647368 -140.6449146479193 31.5928202101209
-1713 -318.5725422579476 -29577

Interpreted in accordance with line 1912 and line 1915, the output through JJJJ=-29577 was produced in the first 135 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.

References

D. M. Himmelblau (1972): "Applied Nonlinear Programming," McGraw-Hill, New York.

K. Schittkowski (1987): "More Test Problems for Nonlinear Programming Codes," Springer-Verlag, Berlin, Heidelberg, New York.