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.