Jsun Yui Wong
Based on the computer program in Wong [6], the following computer program seeks to solve the nonlinear system of five equations on page 660 of Floudas [1]. The problem is to solve simultaneously
X(1) * X(2) * X(3) *X(4) *X(5) -1 =0
2* X(1) + X(2) + X(3) + X(4) +X(5) -6=0
X(1) +2*X(2) + X(3) + X(4) +X(5) -6=0
X(1) + X(2) + 2* X(3) + X(4) +X(5) -6=0
X(1) + X(2) + X(3) + 2*X(4) +X(5) -6=0.
“It is a difficult problem to solve because it involves two distinct solutions which are very close to each other,” Floudas [1, p. 660].
The following computer program uses qb64v1000-win [4, 5].
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 5
94 A(KK) = -10 + RND * 20
95 NEXT KK
128 FOR I = 1 TO 20000
129 FOR K = 1 TO 5
131 X(K) = A(K)
132 NEXT K
155 FOR IPP = 1 TO FIX(1 + RND * 3)
181 B = 1 + FIX(RND * 5)
183 R = (1 – RND * 2) * A(B)
187 IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))
191 NEXT IPP
195 X(1) = -2## * X(2) – X(3) – X(4) – X(5) + 6##
222 N1 = 2 * X(1) + X(2) + X(3) + X(4) + X(5) – 6
224 N3 = X(1) + X(2) + 2 * X(3) + X(4) + X(5) – 6
225 N4 = X(1) + X(2) + X(3) + 2 * X(4) + X(5) – 6
227 N5 = X(1) * X(2) * X(3) * X(4) * X(5) – 1##
1230 P = -ABS(N1) – ABS(N3) – ABS(N4) – ABS(N5)
1451 IF P <= M THEN 1670
1657 FOR KEW = 1 TO 5
1658 A(KEW) = X(KEW)
1659 NEXT KEW
1661 M = P
1670 NEXT I
1890 IF M < -.000001 THEN 1999
1912 PRINT A(1), A(2), A(3), A(4), A(5), M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [4, 5]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -30119 is shown below:
1 1 1 1 1
0 -31865
1 1 1 1 1
0 -31744
1 1 1 1 1
0 -31660
1 1 1 1 1
0 -31604
1 1 1 1 1
0 -31500
1 1 1 1 1
0 -31458
1 1 1 1 1
0 -31435
1 1 1 1 1
0 -30994
1 1 1 1 1
0 -30920
1 1 1 1 1
0 -30902
1 1 1 1 1
0 -30843
1 1 1 1 1
0 -30821
1 1 1 1 1
0 -30717
1 1 1 1 1
0 -30512
-.5790430487746544 -.579043073198508 -.5790430041757131
-.5790431556500615 8.895215354996445 -3.103844449232722D-07
-30465
1 1 1 1 1
0 -30308
1 1 1 1 1
0 -30279
1 1 1 1 1
0 -30156
-.5790430913488978 -.5790430352155872 -.5790431362376748
-.5790430703411057 8.895215368358873 -2.36591180039034D-07
-30119
Above there is no rounding by hand; it is just straight copying by hand from the screen.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [4, 5], the wall-clock time for obtaining the output through JJJJ= -30119 was one minute.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] C. A. Floudas, Deterministic Global Optimization. Kluwer Academic Publishers, 2000.
[2] 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.
[3] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flannery. Numerical recipes: the art of scientific computing, third ed. Cambridge University Press, 2007.
[4] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY! issue70/#galleoninterview
[5] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
[6] Jsun Yui Wong (February 21, 2013). Testing the Domino Method of General Integer Nonlinear Programming with Brown’s Almost Linear System of Equations.