Jsun Yui Wong
The computer program listed below tries to solve the following problem from pages 572-574 of Goldstein and Price [1].
Minimize EXP(USQ)+(SIN(4*X(1)-3*X(2)))^4+(1/2)*(2*X(1)+X(2)-10)^2
where USQ is ( (1/2)*(X(1)^2+X(2)^2-25) )^2.
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 2
94 A(KK)=RND*5
95 NEXT KK
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 2
131 X(K)=A(K)
132 NEXT K
181 J=1+FIX(RND*2)
183 RC=(1-RND*2)*A(J)
191 IF RND<.17 THEN X(J)=RND*5 ELSE IF RND<.2 THEN X(J)=A(J)+(RC) ELSE IF RND<.25 THEN X(J)=A(J)+(RND*RC) ELSE IF RND<.33 THEN X(J)=A(J)+(RND^2*RC) ELSE IF RND<.5 THEN X(J)=A(J)+(RND^3*RC) ELSE X(J)=A(J)+(RND^4*RC)
1221 USQ=((1/2)*(X(1)^2+X(2)^2-25))^2
1222 IF USQ>88.02969 GOTO 1670
1228 P1NEWMAY=-EXP(USQ)-(SIN(4*X(1)-3*X(2)))^4-(1/2)*(2*X(1)+X(2)-10)^2
1448 P=P1NEWMAY
1451 IF P<=M THEN 1670
1657 FOR KEW=1 TO 2
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1670 NEXT I
1890 IF M>-1.00001 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),M,JJJJ
1999 NEXT JJJJ
The BASIC computer program above was run with Microsoft's GW BASIC 3.11 interpreter, which is not a compiler. The complete output through JJJJ=-31135 is presented below. What immediately follows is a manual copy from the computer screen.
2.999617983186508 4.000793869733004 -1.000004120842557
-31935
2.997184176516209 4.002264407964584 -1.000006155732966
-31858
3.002505007680922 3.998106750081269 -1.000004920671327
-31555
2.996787080731433 4.002527007369667 -1.000008002822571
-31473
2.999477299300685 4.000418875366682 -1.000000207975854
-31262
3.003159982826601 3.997395781740299 -1.000007940510827
-31135
Interpreted in accordance with line 1912, the output through JJJJ=-31135 was produced in forty seconds on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.
References
[1] A. A. Goldstein, J. F. Price, "On Descent from Local Minima," Mathematics of Computation, Vol. 25, No. 115 (Jul. 1971), pp. 569-574.
[2] C. A. Floudas, P. M. Parados, "A collection of test problems for constrained global optimization," Lecture Notes in Computer Science, vol. 455, 1991.
[3] Microsoft Corp. BASIC. Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C, Boca Raton, Florida 33432, 1981.