Jsun Yui Wong
The computer program listed below seeks to solve the following Moessner (1959) 6.1.20 Diophantine equation from Weisstein [14].
X(1) ^ 6 + X(2) ^ 6 + X(3) ^ 6 + X(4) ^ 6 + X(5) ^ 6 + X(6) ^ 6 + X(7) ^ 6 + X(8) ^ 6 + X(9) ^ 6 + X(10) ^ 6 + X(11) ^ 6 + X(12) ^ 6 + X(13) ^ 6 + X(14) ^ 6 + X(15) ^ 6 + X(16) ^ 6 + X(17) ^ 6 + X(18) ^ 6 + X(19) ^ 6 + X(20) ^ 6 = X(21) ^ 6
While line 177 through line 181 of the preceding paper are as follows:
177 FOR JJ11 = 1 TO 19
178 FOR JN = JJ11 + 1 TO 20
179 IF X(JJ11) = X(JN) THEN 1670
180 NEXT JN
181 NEXT JJ11
line 189 through line 193 of the present paper are as follows:
189 FOR JJ11 = 1 TO 19
190 FOR JN = JJ11 + 1 TO 20
191 IF X(JJ11) = X(JN) THEN 1670
192 NEXT JN
193 NEXT JJ11
The following computer program uses qb64v1000-win [12, 16]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 21
112 A(J44) = 1 + (RND * 40)
113 NEXT J44
128 FOR I = 1 TO 4000
129 FOR KKQQ = 1 TO 21
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 6)
140 B = 1 + FIX(RND * 21)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
185 FOR J44 = 1 TO 21
186 IF X(J44) > 60 THEN X(J44) = 10 + FIX(RND * 30)
187 IF X(J44) < 1 THEN X(J44) = 1 + FIX(RND * 10)
188 NEXT J44
189 FOR JJ11 = 1 TO 19
190 FOR JN = JJ11 + 1 TO 20
191 IF X(JJ11) = X(JN) THEN 1670
192 NEXT JN
193 NEXT JJ11
195 X(21) = ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# + X(8) ^ 6# + X(9) ^ 6# + X(10) ^ 6# + X(11) ^ 6# + X(12) ^ 6# + X(13) ^ 6# + X(14) ^ 6# + X(15) ^ 6# + X(16) ^ 6# + X(17) ^ 6# + X(18) ^ 6# + X(19) ^ 6# + X(20) ^ 6#)) ^ .1666666666666666666666666666666##
211 N(7) = X(21) ^ 6# - X(1) ^ 6# - X(2) ^ 6# - X(3) ^ 6# - X(4) ^ 6# - X(5) ^ 6# - X(6) ^ 6# - X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6# - X(15) ^ 6# - X(16) ^ 6# - X(17) ^ 6# - X(18) ^ 6# - X(19) ^ 6# - X(20) ^ 6#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 21
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M < 0 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), A(7), A(8)
1906 PRINT A(9), A(10), A(11), A(12)
1907 PRINT A(13), A(14), A(15), A(16)
1908 PRINT A(17), A(18), A(19), A(20)
1922 PRINT A(21), M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 16]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -29025.70000004328 is shown below:
8 28 34 38
42 36 39 35
32 15 48 7
18 33 6 30
21 23 27 25
57 0 -29025.70000004328
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 [12, 16], the wall-clock time for obtaining the output through JJJJ= -29025.70000004328 was 22 minutes.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Eric Weisstein. Diophantine Equation--6th Powers.
http://mathworld.wolfram.com/DiophantineEquation6thPowers.html
[15] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[16] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
Tuesday, September 29, 2015
Testing the Nonlinear Integer Programming Solver with Moessner's 6.1.20 Equation
Jsun Yui Wong
The computer program listed below seeks to solve the following Moessner (1959) 6.1.20 Diophantine equation from Weisstein [14].
X(1) ^ 6 + X(2) ^ 6 + X(3) ^ 6 + X(4) ^ 6 + X(5) ^ 6 + X(6) ^ 6 + X(7) ^ 6 + X(8) ^ 6 + X(9) ^ 6 + X(10) ^ 6 + X(11) ^ 6 + X(12) ^ 6 + X(13) ^ 6 + X(14) ^ 6 + X(15) ^ 6 + X(16) ^ 6 + X(17) ^ 6 + X(18) ^ 6 + X(19) ^ 6 + X(20) ^ 6 = X(21) ^ 6
The following computer program uses qb64v1000-win [12, 16]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 21
112 A(J44) = 1 + (RND * 40)
113 NEXT J44
128 FOR I = 1 TO 4000
129 FOR KKQQ = 1 TO 21
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 6)
140 B = 1 + FIX(RND * 21)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
177 FOR JJ11 = 1 TO 19
178 FOR JN = JJ11 + 1 TO 20
179 IF X(JJ11) = X(JN) THEN 1670
180 NEXT JN
181 NEXT JJ11
185 FOR J44 = 1 TO 21
186 IF X(J44) > 60 THEN X(J44) = 10 + FIX(RND * 30)
187 IF X(J44) < 1 THEN X(J44) = 1 + FIX(RND * 10)
188 NEXT J44
195 X(21) = ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# + X(8) ^ 6# + X(9) ^ 6# + X(10) ^ 6# + X(11) ^ 6# + X(12) ^ 6# + X(13) ^ 6# + X(14) ^ 6# + X(15) ^ 6# + X(16) ^ 6# + X(17) ^ 6# + X(18) ^ 6# + X(19) ^ 6# + X(20) ^ 6#)) ^ .1666666666666666666666666666666##
211 N(7) = X(21) ^ 6# - X(1) ^ 6# - X(2) ^ 6# - X(3) ^ 6# - X(4) ^ 6# - X(5) ^ 6# - X(6) ^ 6# - X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6# - X(15) ^ 6# - X(16) ^ 6# - X(17) ^ 6# - X(18) ^ 6# - X(19) ^ 6# - X(20) ^ 6#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 21
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M < 0 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), A(7), A(8)
1906 PRINT A(9), A(10), A(11), A(12)
1907 PRINT A(13), A(14), A(15), A(16)
1908 PRINT A(17), A(18), A(19), A(20)
1922 PRINT A(21), M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 16]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -19140.10000018714 is shown below:
10 2 11 6
40 36 7 26
14 28 32 19
49 5 20 8
29 23 22 35
54 0 -31011.5000000144
17 52 26 28
35 14 10 32
44 25 5 42
38 2 31 22
7 37 20 39
60 0 -19140.10000018714
Above there is no rounding by hand; it is just straight copying by hand from the screen.
These two solutions are different, one with A(21)=54 and the other with A(21)=60.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [12, 16], the wall-clock time for obtaining the output through JJJJ= -19140.10000018714 was one hour and a half.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Eric Weisstein. Diophantine Equation--6th Powers.
http://mathworld.wolfram.com/DiophantineEquation6thPowers.html
[15] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[16] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
The computer program listed below seeks to solve the following Moessner (1959) 6.1.20 Diophantine equation from Weisstein [14].
X(1) ^ 6 + X(2) ^ 6 + X(3) ^ 6 + X(4) ^ 6 + X(5) ^ 6 + X(6) ^ 6 + X(7) ^ 6 + X(8) ^ 6 + X(9) ^ 6 + X(10) ^ 6 + X(11) ^ 6 + X(12) ^ 6 + X(13) ^ 6 + X(14) ^ 6 + X(15) ^ 6 + X(16) ^ 6 + X(17) ^ 6 + X(18) ^ 6 + X(19) ^ 6 + X(20) ^ 6 = X(21) ^ 6
The following computer program uses qb64v1000-win [12, 16]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 21
112 A(J44) = 1 + (RND * 40)
113 NEXT J44
128 FOR I = 1 TO 4000
129 FOR KKQQ = 1 TO 21
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 6)
140 B = 1 + FIX(RND * 21)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
177 FOR JJ11 = 1 TO 19
178 FOR JN = JJ11 + 1 TO 20
179 IF X(JJ11) = X(JN) THEN 1670
180 NEXT JN
181 NEXT JJ11
185 FOR J44 = 1 TO 21
186 IF X(J44) > 60 THEN X(J44) = 10 + FIX(RND * 30)
187 IF X(J44) < 1 THEN X(J44) = 1 + FIX(RND * 10)
188 NEXT J44
195 X(21) = ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# + X(8) ^ 6# + X(9) ^ 6# + X(10) ^ 6# + X(11) ^ 6# + X(12) ^ 6# + X(13) ^ 6# + X(14) ^ 6# + X(15) ^ 6# + X(16) ^ 6# + X(17) ^ 6# + X(18) ^ 6# + X(19) ^ 6# + X(20) ^ 6#)) ^ .1666666666666666666666666666666##
211 N(7) = X(21) ^ 6# - X(1) ^ 6# - X(2) ^ 6# - X(3) ^ 6# - X(4) ^ 6# - X(5) ^ 6# - X(6) ^ 6# - X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6# - X(15) ^ 6# - X(16) ^ 6# - X(17) ^ 6# - X(18) ^ 6# - X(19) ^ 6# - X(20) ^ 6#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 21
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M < 0 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), A(7), A(8)
1906 PRINT A(9), A(10), A(11), A(12)
1907 PRINT A(13), A(14), A(15), A(16)
1908 PRINT A(17), A(18), A(19), A(20)
1922 PRINT A(21), M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 16]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= -19140.10000018714 is shown below:
10 2 11 6
40 36 7 26
14 28 32 19
49 5 20 8
29 23 22 35
54 0 -31011.5000000144
17 52 26 28
35 14 10 32
44 25 5 42
38 2 31 22
7 37 20 39
60 0 -19140.10000018714
Above there is no rounding by hand; it is just straight copying by hand from the screen.
These two solutions are different, one with A(21)=54 and the other with A(21)=60.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [12, 16], the wall-clock time for obtaining the output through JJJJ= -19140.10000018714 was one hour and a half.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Eric Weisstein. Diophantine Equation--6th Powers.
http://mathworld.wolfram.com/DiophantineEquation6thPowers.html
[15] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[16] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
Monday, September 28, 2015
Testing the Nonlinear Integer Programming Solver with the Moessner 6.1.23 Equation
Jsun Yui Wong
The computer program listed below seeks to solve the following Moessner (1959) 6.1.23 Diophantine equation from Weisstein [16].
X(1) ^ 6 + X(2) ^ 6 + X(3) ^ 6 + X(4) ^ 6 + X(5) ^ 6 + X(6) ^ 6 + X(7) ^ 6 + X(8) ^ 6 + X(9) ^ 6 + X(10) ^ 6 + X(11) ^ 6 + X(12) ^ 6 + X(13) ^ 6 + X(14) ^ 6 + X(15) ^ 6 + X(16) ^ 6 + X(17) ^ 6 + X(18) ^ 6 + X(19) ^ 6 + X(20) ^ 6 + X(21) ^ 6 + X(22) ^ 6 + X(23) ^ 6 = X(24) ^ 6
The following computer program uses qb64v1000-win [12, 15]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 24
112 A(J44) = 1 + (RND * 40)
113 NEXT J44
128 FOR I = 1 TO 2500
129 FOR KKQQ = 1 TO 24
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 6)
140 B = 1 + FIX(RND * 24)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
169 REM GOTO 185
171 IF X(1) = X(2) THEN 1670
172 IF X(1) = X(3) THEN 1670
173 IF X(2) = X(3) THEN 1670
174 IF X(3) = X(4) THEN 1670
175 IF X(4) = X(5) THEN 1670
176 IF X(6) = X(7) THEN 1670
177 FOR JJ11 = 1 TO 22
178 FOR JN = JJ11 + 1 TO 23
179 IF X(JJ11) = X(JN) THEN 1670
180 NEXT JN
181 NEXT JJ11
185 FOR J44 = 1 TO 24
186 IF X(J44) > 70 THEN X(J44) = 20
187 IF X(J44) < 1 THEN X(J44) = 5
188 NEXT J44
195 X(24) = ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# + X(8) ^ 6# + X(9) ^ 6# + X(10) ^ 6# + X(11) ^ 6# + X(12) ^ 6# + X(13) ^ 6# + X(14) ^ 6# + X(15) ^ 6# + X(16) ^ 6# + X(17) ^ 6# + X(18) ^ 6# + X(19) ^ 6# + X(20) ^ 6# + X(21) ^ 6# + X(22) ^ 6# + X(23) ^ 6#)) ^ .1666666666666666666666666666666##
211 N(7) = X(24) ^ 6# - X(1) ^ 6# - X(2) ^ 6# - X(3) ^ 6# - X(4) ^ 6# - X(5) ^ 6# - X(6) ^ 6# - X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6# - X(15) ^ 6# - X(16) ^ 6# - X(17) ^ 6# - X(18) ^ 6# - X(19) ^ 6# - X(20) ^ 6# - X(21) ^ 6# - X(22) ^ 6# - X(23) ^ 6#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 24
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M < -1 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), A(7), A(8)
1906 PRINT A(9), A(10), A(11), A(12)
1907 PRINT A(13), A(14), A(15), A(16)
1908 PRINT A(17), A(18), A(19), A(20)
1909 PRINT A(21), A(22), A(23), A(24)
1922 PRINT M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 15]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= 32000 is shown below:
7 1 8 40
13 38 36 22
23 24 11 25
21 17 41 37
15 67 19 16
51 29 58 74
-1 -30625.10000002001
15 21 33 18
13 41 10 35
1 34 40 11
29 38 23 39
19 17 2 31
50 26 25 58
-1 -12465.400000213
40 38 31 6
20 1 26 18
17 32 24 3
37 27 34 35
10 2 22 28
30 25 8 51
-1 -9463.200000202065
38 13 25 24
10 40 28 21
19 20 26 9
34 1 30 39
32 5 4 8
16 36 2 51
-1 -2876.200000018365
39 16 34 28
9 20 5 2
32 4 26 38
21 13 30 40
10 19 1 36
8 25 24 51
-1 15138.59999985237
6 13 12 31
41 18 8 17
5 40 26 28
23 4 14 2
11 1 38 10
9 20 16 49
0 22581.29999976672
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 [12, 15], the wall-clock time for obtaining the output through JJJJ= 32000 was four hours.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[15] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
[16] Eric Weisstein. Diophantine Equation--6th Powers.
http://mathworld.wolfram.com/DiophantineEquation6thPowers.html
The computer program listed below seeks to solve the following Moessner (1959) 6.1.23 Diophantine equation from Weisstein [16].
X(1) ^ 6 + X(2) ^ 6 + X(3) ^ 6 + X(4) ^ 6 + X(5) ^ 6 + X(6) ^ 6 + X(7) ^ 6 + X(8) ^ 6 + X(9) ^ 6 + X(10) ^ 6 + X(11) ^ 6 + X(12) ^ 6 + X(13) ^ 6 + X(14) ^ 6 + X(15) ^ 6 + X(16) ^ 6 + X(17) ^ 6 + X(18) ^ 6 + X(19) ^ 6 + X(20) ^ 6 + X(21) ^ 6 + X(22) ^ 6 + X(23) ^ 6 = X(24) ^ 6
The following computer program uses qb64v1000-win [12, 15]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 24
112 A(J44) = 1 + (RND * 40)
113 NEXT J44
128 FOR I = 1 TO 2500
129 FOR KKQQ = 1 TO 24
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 6)
140 B = 1 + FIX(RND * 24)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
169 REM GOTO 185
171 IF X(1) = X(2) THEN 1670
172 IF X(1) = X(3) THEN 1670
173 IF X(2) = X(3) THEN 1670
174 IF X(3) = X(4) THEN 1670
175 IF X(4) = X(5) THEN 1670
176 IF X(6) = X(7) THEN 1670
177 FOR JJ11 = 1 TO 22
178 FOR JN = JJ11 + 1 TO 23
179 IF X(JJ11) = X(JN) THEN 1670
180 NEXT JN
181 NEXT JJ11
185 FOR J44 = 1 TO 24
186 IF X(J44) > 70 THEN X(J44) = 20
187 IF X(J44) < 1 THEN X(J44) = 5
188 NEXT J44
195 X(24) = ((X(1) ^ 6# + X(2) ^ 6# + X(3) ^ 6# + X(4) ^ 6# + X(5) ^ 6# + X(6) ^ 6# + X(7) ^ 6# + X(8) ^ 6# + X(9) ^ 6# + X(10) ^ 6# + X(11) ^ 6# + X(12) ^ 6# + X(13) ^ 6# + X(14) ^ 6# + X(15) ^ 6# + X(16) ^ 6# + X(17) ^ 6# + X(18) ^ 6# + X(19) ^ 6# + X(20) ^ 6# + X(21) ^ 6# + X(22) ^ 6# + X(23) ^ 6#)) ^ .1666666666666666666666666666666##
211 N(7) = X(24) ^ 6# - X(1) ^ 6# - X(2) ^ 6# - X(3) ^ 6# - X(4) ^ 6# - X(5) ^ 6# - X(6) ^ 6# - X(7) ^ 6# - X(8) ^ 6# - X(9) ^ 6# - X(10) ^ 6# - X(11) ^ 6# - X(12) ^ 6# - X(13) ^ 6# - X(14) ^ 6# - X(15) ^ 6# - X(16) ^ 6# - X(17) ^ 6# - X(18) ^ 6# - X(19) ^ 6# - X(20) ^ 6# - X(21) ^ 6# - X(22) ^ 6# - X(23) ^ 6#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 24
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M < -1 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), A(7), A(8)
1906 PRINT A(9), A(10), A(11), A(12)
1907 PRINT A(13), A(14), A(15), A(16)
1908 PRINT A(17), A(18), A(19), A(20)
1909 PRINT A(21), A(22), A(23), A(24)
1922 PRINT M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 15]. Copied by hand from the screen, the computer program’s complete output through
JJJJ= 32000 is shown below:
7 1 8 40
13 38 36 22
23 24 11 25
21 17 41 37
15 67 19 16
51 29 58 74
-1 -30625.10000002001
15 21 33 18
13 41 10 35
1 34 40 11
29 38 23 39
19 17 2 31
50 26 25 58
-1 -12465.400000213
40 38 31 6
20 1 26 18
17 32 24 3
37 27 34 35
10 2 22 28
30 25 8 51
-1 -9463.200000202065
38 13 25 24
10 40 28 21
19 20 26 9
34 1 30 39
32 5 4 8
16 36 2 51
-1 -2876.200000018365
39 16 34 28
9 20 5 2
32 4 26 38
21 13 30 40
10 19 1 36
8 25 24 51
-1 15138.59999985237
6 13 12 31
41 18 8 17
5 40 26 28
23 4 14 2
11 1 38 10
9 20 16 49
0 22581.29999976672
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 [12, 15], the wall-clock time for obtaining the output through JJJJ= 32000 was four hours.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[15] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
[16] Eric Weisstein. Diophantine Equation--6th Powers.
http://mathworld.wolfram.com/DiophantineEquation6thPowers.html
Friday, September 25, 2015
Testing the Nonlinear Integer Programming Solver with a Diophantine Equation Involving a Sum of Like Powers
Jsun Yui Wong
The computer program listed below seeks to solve the following Diophantine equation from Reference 14 of the case of k=5 and n=5:
X(1)^5+X(2)^5+X(3)^5+X(4)^5+X(5)^5 = X(6)^5.
The following computer program uses qb64v1000-win [12, 15]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 6
112 A(J44) = 5 + (RND * 150)
113 NEXT J44
128 FOR I = 1 TO 3000
129 FOR KKQQ = 1 TO 8
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 3)
140 B = 1 + FIX(RND * 6)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
169 REM GOTO 185
171 IF X(1) = X(2) THEN 1670
172 IF X(1) = X(3) THEN 1670
173 IF X(2) = X(3) THEN 1670
185 FOR J44 = 1 TO 6
186 IF X(J44) > 1000 THEN X(J44) = 120
187 IF X(J44) < 1 THEN X(J44) = 20
188 NEXT J44
195 X(6) = ((X(1) ^ 5# + X(2) ^ 5# + X(3) ^ 5# + X(4) ^ 5# + X(5) ^ 5#)) ^ .2#
215 N(7) = X(6) ^ 5# - X(1) ^ 5# - X(2) ^ 5# - X(3) ^ 5# - X(4) ^ 5# - X(5) ^ 5#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 6
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M <0 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 15]. Copied by hand from the screen, the computer program’s complete output through
JJJJ=-6717.200000192075 is shown below:
46 67 19 47
43 72 0 -29323.00000003896
86 92 94 38
134 144 0 -26774.30000007604
57 100 7 80
43 107 0 -18612.90000019481
46 43 67 19
47 72 0 -10640.70000020635
37 23 21 84
79 94 0 -7769.500000195903
46 47 67 19
43 72 0 -7710.200000195688
84 23 37 79
21 94 0 -7212.700000193878
100 43 57 7
80 107 0 -6717.200000192075 .
Above there is no rounding by hand; it is just straight copying by hand from the screen.
The first solution shown above is the smallest found in 1967 by Lander, Parkin, and Selfridge, and the third solution shown above is the third smallest found in 1934 by Sastry--see Reference 14. The fifth solution shown above is the second smallest.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [12, 15], the wall-clock time for obtaining the output through JJJJ=-6717.200000192075 was fifty minutes.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[15] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
The computer program listed below seeks to solve the following Diophantine equation from Reference 14 of the case of k=5 and n=5:
X(1)^5+X(2)^5+X(3)^5+X(4)^5+X(5)^5 = X(6)^5.
The following computer program uses qb64v1000-win [12, 15]. One notes line 88 below, which is 88 FOR JJJJ = -32000 TO 32000 STEP .1.
0 DEFDBL A-Z
1 DEFINT I, K, A, X
2 DIM B(99), N(99), A(2002), H(99), L(99), U(99), X(2002), D(111), P(111), PS(33), J(99), AA(99), HR(32), HHR(32), PLHS(44), LB(22), UB(22), PX(44), J44(44), PN(22), NN(22)
88 FOR JJJJ = -32000 TO 32000 STEP .1
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 6
112 A(J44) = 5 + (RND * 150)
113 NEXT J44
128 FOR I = 1 TO 3000
129 FOR KKQQ = 1 TO 8
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 3)
140 B = 1 + FIX(RND * 6)
150 R = (1 - RND * 2) * A(B)
155 IF RND < .5 THEN 160 ELSE GOTO 167
160 X(B) = (A(B) + RND ^ 3 * R)
164 REM IF RND<.5 THEN X(B)=(A(B)-RND*10) ELSE X(B)=(A(B) +RND*10)
165 GOTO 168
167 IF RND < .5 THEN X(B) = CINT(A(B) - 1) ELSE X(B) = CINT(A(B) + 1)
168 NEXT IPP
169 REM GOTO 185
171 IF X(1) = X(2) THEN 1670
172 IF X(1) = X(3) THEN 1670
173 IF X(2) = X(3) THEN 1670
185 FOR J44 = 1 TO 6
186 IF X(J44) > 1000 THEN X(J44) = 120
187 IF X(J44) < 1 THEN X(J44) = 20
188 NEXT J44
195 X(6) = ((X(1) ^ 5# + X(2) ^ 5# + X(3) ^ 5# + X(4) ^ 5# + X(5) ^ 5#)) ^ .2#
215 N(7) = X(6) ^ 5# - X(1) ^ 5# - X(2) ^ 5# - X(3) ^ 5# - X(4) ^ 5# - X(5) ^ 5#
322 PD1 = -ABS(N(7))
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 6
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M <0 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)
1905 PRINT A(5), A(6), M, JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [12, 15]. Copied by hand from the screen, the computer program’s complete output through
JJJJ=-6717.200000192075 is shown below:
46 67 19 47
43 72 0 -29323.00000003896
86 92 94 38
134 144 0 -26774.30000007604
57 100 7 80
43 107 0 -18612.90000019481
46 43 67 19
47 72 0 -10640.70000020635
37 23 21 84
79 94 0 -7769.500000195903
46 47 67 19
43 72 0 -7710.200000195688
84 23 37 79
21 94 0 -7212.700000193878
100 43 57 7
80 107 0 -6717.200000192075 .
Above there is no rounding by hand; it is just straight copying by hand from the screen.
The first solution shown above is the smallest found in 1967 by Lander, Parkin, and Selfridge, and the third solution shown above is the third smallest found in 1934 by Sastry--see Reference 14. The fifth solution shown above is the second smallest.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [12, 15], the wall-clock time for obtaining the output through JJJJ=-6717.200000192075 was fifty minutes.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] S. Abraham, S. Sanyal, M. Sanglikar (2013), Finding Numerical Solutions of Diophantine Equations Using Ant Colony Optimization. Applied Mathematics and Computation 219 (2013), pages 11376-11387.
[2] J. L. Brenner, Lorraine L. Foster (1982), Exponential Diophantine Equations. Pacific Journal of Mathematics, Volume 101, Number 2, 1982, Pages 263-301.
[3] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.
[4] Martin Gardner (1983), Diophantine Analysis and Fermat’s Last Theorem, Chapter 2 of Wheels, Life and Other Mathematical Amusements. New York, San Francisco: W. H. Freeman and Company (1983). http://www.labeee.ufsc.br/~luis/ga/Gardner.pdf
[5] L. J. Lander, T. R. Parkin (1966), Counterexample to Euler’s Conjecture on Sums of Like Powers. The Bulletin of American Mathematical Society, Vol. 72, 1966, page 1079.
[6] L. J. Lander, T. R. Parkin (1967), A Counterexample to Euler’s Sum of Powers Conjecture. Mathematics of Computation, Vol. 21, January 1967, pages 101-103.
[7] L. J. Lander, T. R. Parkin, J. L. Selfridge (1967), A Survey of Equal Sums of Like Powers. Mathematics of Computation, Vol. 21, July 1967, pages 446-459.
[8] 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.
[9] O. Perez, I. Amaya, R. Correa (2013), Numerical Solution of Certain Exponential and Non-linear Diophantine Systems of Equations by Using a Discrete Particles Swarm Optimization Algorithm. Applied Mathematics and Computation, Volume 225, 1 December 2013, Pages 737-746.
[10] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021
[11] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.
[12] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[13] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.
[14] Wikipedia, Euler's sum of powers conjecture. https://en.wikipedia.org/wiki/Euler%27s_sum_of_powers_conjecture
[15] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
Monday, September 21, 2015
Solving with QB64 a Large Nonlinear Integer Programming Problem of 32765 General Integer Variables
Jsun Yui Wong
The problem here is Li and Sun's Problem 14.3 but with 32765 unknowns instead of their 100 unknowns; see Li and Sun [4, pp. 414-415]. Their problem is based on Walukiewicz/Schittkowski Test Problem 282 [7, Test Problem 282, page 106 and page 23]. Specifically, the test example here is to minimize
32765-1
(X(1)-1)^2 + ( X(32765)-1)^2 + 32765* SIGMA (32765-i)* ( X(i)^2-X(i+1) )^2
i=1
subject to
-5 <= X(i) <= 5, X(i) integer, i=1, 2, 3,..., 32765.
The following computer program uses qb64v1000-win [8, 9].
0 DEFINT J, K, B, X, A
2 DIM A(32765), X(32765)
81 FOR JJJJ = -32000 TO 32000
85 LB = -FIX(RND * 6)
86 UB = FIX(RND * 6)
87 br = -5 + FIX(RND * 11)
88 REM RND ^ 2
89 RANDOMIZE JJJJ
90 M = -1.5D+38
111 FOR J44 = 1 TO 32765
114 A(J44) = br
117 NEXT J44
128 FOR I = 1 TO 10000
129 FOR KKQQ = 1 TO 32765
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * .3)
140 B = 1 + FIX(RND * 32765)
167 IF RND < .5 THEN X(B) = (A(B) - 1) ELSE X(B) = (A(B) + 1)
169 NEXT IPP
170 FOR J44 = 1 TO 32765
171 IF X(J44) < LB THEN X(J44) = LB
172 IF X(J44) > UB THEN X(J44) = UB
173 NEXT J44
220 GOTO 400
221 SFE = 0
225 FOR J44 = 1 TO 32765
228 SFE = SFE + X(J44)
233 NEXT J44
251 TSL = -32740 + SFE
257 IF TSL < 0 THEN TSL = TSL ELSE TSL = 0
400 SUMNEWZ = 0
403 FOR J44 = 1 TO 32764
405 SUMNEWZ = SUMNEWZ + (32765 - J44) * (X(J44) ^ 2 - X(J44 + 1)) ^ 2
407 NEXT J44
411 SONE = -(X(1) - 1) ^ 2 - (X(32765) - 1) ^ 2 - 32765 * SUMNEWZ
492 PD1 = SONE
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 32765
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1559 GOTO 128
1670 NEXT I
1778 PRINT A(1), A(32765), M, br
1788 PRINT A(11111), A(32757), A(32763), A(32764), JJJJ
1789 REM PRINT A(2222), A(22222), A(22757), A(22763), A(22764)
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [8, 9]. Copied by hand from the screen, the computer program's complete output through JJJJ=-31987 is shown below:
1 1 -8.137876E+09 1
1 1 1 1 -32000
1 1 0 2
1 1 1 1 -31999
0 0 -2 0
0 0 0 0 -31998
1 1 0 2
1 1 1 1 -31997
1 1 -2.205412E+08 1
1 1 1 1 -31996
0 0 -2 -2
0 0 0 0 -31995
0 0 -2 0
0 0 0 0 -31994
0 0 -6.702081E+08 0
0 0 0 0 -31993
0 -3 -4.414478E+12 -4
-1 0 0 -1 -31992
0 0 -2 -4
0 0 0 0 -31991
0 0 -1.351537E+10 -1
0 0 0 0 -31990
0 0 -2 -1
0 0 0 0 -331989
0 0 -1.814791E+10 -2
0 0 0 0 -31988
1 4 -7.050966E+13 5
2 2 3 3 -31987
Above there is no rounding by hand; it is just straight copying by hand from the screen.
At JJJJ=-31999 and JJJJ=-31997, M=0 is optimal. See Li and Sun [4, pp. 414-415].
Of the 32765 A's, only the six A's of line 1778 and line 1788 are shown above.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [8, 9], the wall-clock time for obtaining the output through JJJJ=-31987 was six hours.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] George B. Dantzig, Discrete-Variable Extrenum Problems. Operations Research, Vol. 5, No. 2 (Apr., 1957), pp. 266-277.
[2] W. Hock, K. Schittkowski, Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1981.
[3] M. Junger, T. M. Liebling, D. Naddef, G. L. Nemhauser, W. R. Pulleyblank, G. Reinelt, G. Rinaldi, L. A. Woolsey--Editors, 50 Years of Integer Programming 1958-2008: From the Early Years to the State-of-the-Art. Springer, 2010 Edition. eBook; ISBN 978-3-540-68279-0
[4] Duan Li, Xiaoling Sun, Nonlinear Integer Programming. Springer Science+Business Media,LLC (2006). http://www.books.google.ca/books?isbn=0387329951
[5] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C,Boca Raton, Floridda 33432, 1981.
[6] J. Plummer, L. S. Lasdon, M. Ahmed, Solving a Large Nonlinear Progammming Problem on a Vector Processing Computer, Annals of Operatons Research, Volume 14 (1988), Issue 1, pp.. 291-304.
[7] K. Schittkowski, More Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1987.
[8] E.K. Virtanen (2008-05-26). "Interview With Galleon".
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[9] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
The problem here is Li and Sun's Problem 14.3 but with 32765 unknowns instead of their 100 unknowns; see Li and Sun [4, pp. 414-415]. Their problem is based on Walukiewicz/Schittkowski Test Problem 282 [7, Test Problem 282, page 106 and page 23]. Specifically, the test example here is to minimize
32765-1
(X(1)-1)^2 + ( X(32765)-1)^2 + 32765* SIGMA (32765-i)* ( X(i)^2-X(i+1) )^2
i=1
subject to
-5 <= X(i) <= 5, X(i) integer, i=1, 2, 3,..., 32765.
The following computer program uses qb64v1000-win [8, 9].
0 DEFINT J, K, B, X, A
2 DIM A(32765), X(32765)
81 FOR JJJJ = -32000 TO 32000
85 LB = -FIX(RND * 6)
86 UB = FIX(RND * 6)
87 br = -5 + FIX(RND * 11)
88 REM RND ^ 2
89 RANDOMIZE JJJJ
90 M = -1.5D+38
111 FOR J44 = 1 TO 32765
114 A(J44) = br
117 NEXT J44
128 FOR I = 1 TO 10000
129 FOR KKQQ = 1 TO 32765
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * .3)
140 B = 1 + FIX(RND * 32765)
167 IF RND < .5 THEN X(B) = (A(B) - 1) ELSE X(B) = (A(B) + 1)
169 NEXT IPP
170 FOR J44 = 1 TO 32765
171 IF X(J44) < LB THEN X(J44) = LB
172 IF X(J44) > UB THEN X(J44) = UB
173 NEXT J44
220 GOTO 400
221 SFE = 0
225 FOR J44 = 1 TO 32765
228 SFE = SFE + X(J44)
233 NEXT J44
251 TSL = -32740 + SFE
257 IF TSL < 0 THEN TSL = TSL ELSE TSL = 0
400 SUMNEWZ = 0
403 FOR J44 = 1 TO 32764
405 SUMNEWZ = SUMNEWZ + (32765 - J44) * (X(J44) ^ 2 - X(J44 + 1)) ^ 2
407 NEXT J44
411 SONE = -(X(1) - 1) ^ 2 - (X(32765) - 1) ^ 2 - 32765 * SUMNEWZ
492 PD1 = SONE
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 32765
1455 A(KLX) = X(KLX)
1456 NEXT KLX
1559 GOTO 128
1670 NEXT I
1778 PRINT A(1), A(32765), M, br
1788 PRINT A(11111), A(32757), A(32763), A(32764), JJJJ
1789 REM PRINT A(2222), A(22222), A(22757), A(22763), A(22764)
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [8, 9]. Copied by hand from the screen, the computer program's complete output through JJJJ=-31987 is shown below:
1 1 -8.137876E+09 1
1 1 1 1 -32000
1 1 0 2
1 1 1 1 -31999
0 0 -2 0
0 0 0 0 -31998
1 1 0 2
1 1 1 1 -31997
1 1 -2.205412E+08 1
1 1 1 1 -31996
0 0 -2 -2
0 0 0 0 -31995
0 0 -2 0
0 0 0 0 -31994
0 0 -6.702081E+08 0
0 0 0 0 -31993
0 -3 -4.414478E+12 -4
-1 0 0 -1 -31992
0 0 -2 -4
0 0 0 0 -31991
0 0 -1.351537E+10 -1
0 0 0 0 -31990
0 0 -2 -1
0 0 0 0 -331989
0 0 -1.814791E+10 -2
0 0 0 0 -31988
1 4 -7.050966E+13 5
2 2 3 3 -31987
Above there is no rounding by hand; it is just straight copying by hand from the screen.
At JJJJ=-31999 and JJJJ=-31997, M=0 is optimal. See Li and Sun [4, pp. 414-415].
Of the 32765 A's, only the six A's of line 1778 and line 1788 are shown above.
On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and with qb64v1000-win [8, 9], the wall-clock time for obtaining the output through JJJJ=-31987 was six hours.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] George B. Dantzig, Discrete-Variable Extrenum Problems. Operations Research, Vol. 5, No. 2 (Apr., 1957), pp. 266-277.
[2] W. Hock, K. Schittkowski, Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1981.
[3] M. Junger, T. M. Liebling, D. Naddef, G. L. Nemhauser, W. R. Pulleyblank, G. Reinelt, G. Rinaldi, L. A. Woolsey--Editors, 50 Years of Integer Programming 1958-2008: From the Early Years to the State-of-the-Art. Springer, 2010 Edition. eBook; ISBN 978-3-540-68279-0
[4] Duan Li, Xiaoling Sun, Nonlinear Integer Programming. Springer Science+Business Media,LLC (2006). http://www.books.google.ca/books?isbn=0387329951
[5] Microsoft Corp., BASIC, Second Edition (May 1982), Version 1.10. Boca Raton, Florida: IBM Corp., Personal Computer, P. O. Box 1328-C,Boca Raton, Floridda 33432, 1981.
[6] J. Plummer, L. S. Lasdon, M. Ahmed, Solving a Large Nonlinear Progammming Problem on a Vector Processing Computer, Annals of Operatons Research, Volume 14 (1988), Issue 1, pp.. 291-304.
[7] K. Schittkowski, More Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1987.
[8] E.K. Virtanen (2008-05-26). "Interview With Galleon".
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview
[9] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64
Tuesday, September 1, 2015
Solving General Nonlinear Programming Problems with QB64
Jsun Yui Wong
Based on the computer program in [7], the first of the two computer programs listed below seeks to solve the transformer design problem on pages 258-272 of Papalambros and Wilde [3]. In line 215 and line 217, X(7) and X(8) are the slack variables of the two given constraints, Papalambros and Wilde [3].
The following computer program uses qb64v1000-win [4, 5].
0 REM DEFDBL A-Z
1 REM DEFINT A,X
2 DIM B(99),N(99),A(2002),H(99),L(99),U(99),X(2002),D(111),P(111),PS(33),J44(2002),J(99),AA(99),HR(32),HHR(32),LHS(44),PLHS(44),LB(22),UB(22),PX(22)
4 REM DIM PE(35,35)
5 REM DIM SD(35,35)
61 FOR J44=1 TO 8
62 LB(J44)=0
63 NEXT J44
67 FOR J44=1 TO 8
68 UB(J44)=40
69 NEXT J44
78 UB(7)=150:UB(8)=150
88 FOR JJJJ=-32000 TO 32000
89 RANDOMIZE JJJJ
90 M=-7E+30
91 FOR J44=1 TO 8
92 A(J44)=FIX(RND*UB(J44) )
93 NEXT J44
126 IMAR=10+FIX(RND*1500)
128 FOR I=1 TO IMAR
129 FOR KKQQ=1 TO 8
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
153 B=1+FIX(RND*6)
156 REM IF RND<.25 THEN X(B)=CINT(A(B))-FIX(1+RND*3) ELSE IF RND<.33 THEN X(B)=CINT(A(B))+FIX(1+RND*3) ELSE X(B)=A(B)+(1-RND*2)*(RND^(RND*7) )*A(B)
157 REM IF RND<.25 THEN X(B)=CINT(A(B))-FIX(1+RND*3) ELSE IF RND<.33 THEN X(B)=CINT(A(B))+FIX(1+RND*3) ELSE X(B)=A(B)+(1-RND*2)*(RND^(RND*7) )*(A(B)+.01)
158 IF RND<.5 THEN X(B)=CINT(A(B))-FIX(1+RND*3) ELSE X(B)=CINT(A(B))+FIX(1+RND*3)
215 X(7)= .001*X(1)*X(2)*X(3)*X(4)*X(5)*X(6)-2.07
217 X( 8 )= -.00062*X(1)*X(4)*X(5)^2*(X(1)+X(2)+X(3) )- .00058*X(2)*X(3)*X(6)^2*(X(1)+1.57*X(2)+X(4) ) +1.2
281 FOR J78=1 TO 6
282 IF X(J78)<LB(J78) THEN 1670
283 NEXT J78
311 FOR J79=1 TO 6
312 IF X(J79)>UB(J79) THEN 1670
313 NEXT J79
321 FOR J44=7 TO 8
322 IF X(J44) <0 THEN PX(J44)=999999999#*X(J44) ELSE PX(J44)=0
323 NEXT J44
325 PXT= PX(7 )+PX(8)
328 PDU=-.0204*X(1)*X(4)*( X(1)+X(2)+X(3) )-.0187*X(2)*X(3)*( X(1)+ 1.57*X(2)+X(4) ) -.0607*X(1)*X(4)*X(5)^2*( X(1)+X(2)+X(3) )-.0437*X(2)*X(3)*X(6)^2*(X(1)+1.57*X(2)+X(4) ) + PXT
466 P=PDU
1111 IF P<=M THEN 1670
1452 M=P
1454 FOR KLX=1 TO 8
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M<-134 THEN 1999
1904 PRINT A(1),A(2),A(3),A(4)
1905 PRINT A(5),A(6),A(7),A(8)
1915 PRINT M,JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [4, 5]. The complete output through JJJJ=32000 is shown below. What follows is a hand copy from the computer-monitor screen; immediately below there is no rounding by hand.
4 4 13 10
1 1 .01 .0675552
-133.9285 -28147
4 4 13 10
1 1 .01 .0675552
-133.9285 9740
4 5 8 13
1 1 .01 .0754
-133.718 29479
Above there is no rounding by hand; it is just straight copying by hand from the monitor 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=32000 was two minutes.
Based on the computer program in [6}, the computer program listed below tries to solve the transformer design model on page 258 of Papalambros and Wilde [3] plus the modification that the flux density variable X(5) and the current density variable X(6) are continuous variables; see Papalambros and Wilde [3, page 258]. X(7) and X(8) of line 251 and line 252 are the slack variables of the two given constraints [3, p. 258], respectively.
The following computer program uses qb64v1000-win [4, 5].
0 DEFDBL A-Z
2 DEFINT I,J,K
3 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(111),PS(33)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+37
41 FOR J44=1 TO 6
42 A(J44)=FIX(RND*30)
43 NEXT J44
126 IMAR=10+FIX(RND*5000)
128 FOR I=1 TO IMAR
129 FOR KKQQ=1 TO 6
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
133 FOR IPP=1 TO (1+FIX(RND*5))
181 J=1+FIX(RND*6)
182 IF J>4 THEN 183 ELSE 191
183 R=(1-RND*2)*A(J)
185 REM IF RND<.25 THEN PA=(RND)*R ELSE IF RND<.33 THEN PA=(RND^3)*R ELSE IF RND<.5 THEN PA=(RND^5)*R ELSE PA=(RND^7)*R
187 X(J)=A(J)+ (RND^(RND*10))*R
188 GOTO 192
189 REM X(J)=A(J)+PA
190 REM X(J)=A(J)+FIX(RND*2 )-FIX(RND*2)
191 X(J)=A(J)+FIX(RND*3)-FIX(RND*3)
192 NEXT IPP
228 FOR J44=1 TO 6
230 IF X(J44)<.000001 THEN 1670
231 NEXT J44
251 X(7)=-2.07+.001*(X(1)*X(2)*X(3)*X(4)*X(5)*X(6) )
252 X(8)=1.2-.00062* X(1) *X(4) *X(5)^2 *(X(1)+X(2)+X(3) ) -.00058* X(2) *X(3) *X(6)^2 *( X(1)+1.57*X(2) +X(4) )
331 IF X(7) <0 THEN PS1=ABS(X(7)) ELSE PS1=0
332 IF X(8) <0 THEN PS2=ABS(X(8)) ELSE PS2=0
402 POBA2=-.0204*X(1)*X(4)*( X(1)+X(2)+X(3) ) -.0187*X(2)*X(3)*( X(1) +1.57*X(2) +X(4) ) -.0607*X(1)*X(4)*X(5)^2*( X(1)+X(2)+X(3) )
403 POBA3= -.0437* X(2)*X(3)*X(6) ^2*( X(1) +1.57*X(2)+ X(4) )
411 POBA= POBA2 +POBA3
459 POB1=POBA -999999999999#*( PS1+PS2 )
463 P1NEWMAY=POB1
466 P=P1NEWMAY
1111 IF P<=M THEN 1670
1452 M=P
1453 PPOBA=POBA
1454 FOR KLX=1 TO 8
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M<-131.047 THEN 1999
1900 PRINT A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8),M,JJJJ,PPOBA
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [4, 5]. The complete output through JJJJ=-31814 is shown below. What follows is a hand copy from the computer-monitor screen; immediately below there is no rounding by hand.
5 4 9 10 .9478980563655991
1.213210631963454 4.297391435759135D-13 .0446358570056703
-131.046489365246 -31943 -131.046489365246
5 4 9 10 .9485139585993206
1.212422853216261 7.902118629582455D-13 4.483315721178263D-02
-131.0463261712594 -31845 -131.0463261712594
5 4 9 10 .9492067387089264
1.211537964389303 3.896284083434956D-14 4.505260447459625D-02
-131.0463408943493 -31814 -131.0463408943493
Above there is no rounding by hand; it is just straight copying by hand from the monitor 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=-31814 was one minute.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] George B. Dantzig, Discrete-Variable Extremum Problems. Operations Research, Vol. 5, No. 2 (Apr., 1957), pp. 266-277.
[2] Michael Junger, Thomas M. Liebling, Dennis Naddef, George L. Nemhauser, William R. Pulleybank, Gerhart Reinelt, Giovanni Rinaldi, Lawrence A. Wolsey–Editors, 50 Years of Integer Programming 1958-2008. Berlin: Springer, 2010.
[3] Panos Y. Papalambros, Douglass J. Wilde, Principles of Optimal Design, Second Edition. Cambridge University Press, 2000.
[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 (2012, March 30). The Domino Method of General Integer Nonlinear Programming Applied to a Transformer Design Model Involving Continuous Variables and General Integer Variables, Second Edition. Posted on March 30, 2012. http://computationalresultsfromcomputerprograms.wordpress.com/2012/03/30/the-domino-method-of-general-integer-nonlinear-programming
[7] Jsun Yui Wong (2013, January 3). The Domino Method of General Integer Nonlinear Programming Applied to Transformer Design, Third Edition. http://myblogsubstance.typepad.com/substance/2013/01/the-domino-method-of-general-integer-nonlinear-programming
Based on the computer program in [7], the first of the two computer programs listed below seeks to solve the transformer design problem on pages 258-272 of Papalambros and Wilde [3]. In line 215 and line 217, X(7) and X(8) are the slack variables of the two given constraints, Papalambros and Wilde [3].
The following computer program uses qb64v1000-win [4, 5].
0 REM DEFDBL A-Z
1 REM DEFINT A,X
2 DIM B(99),N(99),A(2002),H(99),L(99),U(99),X(2002),D(111),P(111),PS(33),J44(2002),J(99),AA(99),HR(32),HHR(32),LHS(44),PLHS(44),LB(22),UB(22),PX(22)
4 REM DIM PE(35,35)
5 REM DIM SD(35,35)
61 FOR J44=1 TO 8
62 LB(J44)=0
63 NEXT J44
67 FOR J44=1 TO 8
68 UB(J44)=40
69 NEXT J44
78 UB(7)=150:UB(8)=150
88 FOR JJJJ=-32000 TO 32000
89 RANDOMIZE JJJJ
90 M=-7E+30
91 FOR J44=1 TO 8
92 A(J44)=FIX(RND*UB(J44) )
93 NEXT J44
126 IMAR=10+FIX(RND*1500)
128 FOR I=1 TO IMAR
129 FOR KKQQ=1 TO 8
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
153 B=1+FIX(RND*6)
156 REM IF RND<.25 THEN X(B)=CINT(A(B))-FIX(1+RND*3) ELSE IF RND<.33 THEN X(B)=CINT(A(B))+FIX(1+RND*3) ELSE X(B)=A(B)+(1-RND*2)*(RND^(RND*7) )*A(B)
157 REM IF RND<.25 THEN X(B)=CINT(A(B))-FIX(1+RND*3) ELSE IF RND<.33 THEN X(B)=CINT(A(B))+FIX(1+RND*3) ELSE X(B)=A(B)+(1-RND*2)*(RND^(RND*7) )*(A(B)+.01)
158 IF RND<.5 THEN X(B)=CINT(A(B))-FIX(1+RND*3) ELSE X(B)=CINT(A(B))+FIX(1+RND*3)
215 X(7)= .001*X(1)*X(2)*X(3)*X(4)*X(5)*X(6)-2.07
217 X( 8 )= -.00062*X(1)*X(4)*X(5)^2*(X(1)+X(2)+X(3) )- .00058*X(2)*X(3)*X(6)^2*(X(1)+1.57*X(2)+X(4) ) +1.2
281 FOR J78=1 TO 6
282 IF X(J78)<LB(J78) THEN 1670
283 NEXT J78
311 FOR J79=1 TO 6
312 IF X(J79)>UB(J79) THEN 1670
313 NEXT J79
321 FOR J44=7 TO 8
322 IF X(J44) <0 THEN PX(J44)=999999999#*X(J44) ELSE PX(J44)=0
323 NEXT J44
325 PXT= PX(7 )+PX(8)
328 PDU=-.0204*X(1)*X(4)*( X(1)+X(2)+X(3) )-.0187*X(2)*X(3)*( X(1)+ 1.57*X(2)+X(4) ) -.0607*X(1)*X(4)*X(5)^2*( X(1)+X(2)+X(3) )-.0437*X(2)*X(3)*X(6)^2*(X(1)+1.57*X(2)+X(4) ) + PXT
466 P=PDU
1111 IF P<=M THEN 1670
1452 M=P
1454 FOR KLX=1 TO 8
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M<-134 THEN 1999
1904 PRINT A(1),A(2),A(3),A(4)
1905 PRINT A(5),A(6),A(7),A(8)
1915 PRINT M,JJJJ
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [4, 5]. The complete output through JJJJ=32000 is shown below. What follows is a hand copy from the computer-monitor screen; immediately below there is no rounding by hand.
4 4 13 10
1 1 .01 .0675552
-133.9285 -28147
4 4 13 10
1 1 .01 .0675552
-133.9285 9740
4 5 8 13
1 1 .01 .0754
-133.718 29479
Above there is no rounding by hand; it is just straight copying by hand from the monitor 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=32000 was two minutes.
Based on the computer program in [6}, the computer program listed below tries to solve the transformer design model on page 258 of Papalambros and Wilde [3] plus the modification that the flux density variable X(5) and the current density variable X(6) are continuous variables; see Papalambros and Wilde [3, page 258]. X(7) and X(8) of line 251 and line 252 are the slack variables of the two given constraints [3, p. 258], respectively.
The following computer program uses qb64v1000-win [4, 5].
0 DEFDBL A-Z
2 DEFINT I,J,K
3 DIM B(99),N(99),A(99),H(99),L(99),U(99),X(1111),D(111),P(111),PS(33)
12 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+37
41 FOR J44=1 TO 6
42 A(J44)=FIX(RND*30)
43 NEXT J44
126 IMAR=10+FIX(RND*5000)
128 FOR I=1 TO IMAR
129 FOR KKQQ=1 TO 6
130 X(KKQQ)=A(KKQQ)
131 NEXT KKQQ
133 FOR IPP=1 TO (1+FIX(RND*5))
181 J=1+FIX(RND*6)
182 IF J>4 THEN 183 ELSE 191
183 R=(1-RND*2)*A(J)
185 REM IF RND<.25 THEN PA=(RND)*R ELSE IF RND<.33 THEN PA=(RND^3)*R ELSE IF RND<.5 THEN PA=(RND^5)*R ELSE PA=(RND^7)*R
187 X(J)=A(J)+ (RND^(RND*10))*R
188 GOTO 192
189 REM X(J)=A(J)+PA
190 REM X(J)=A(J)+FIX(RND*2 )-FIX(RND*2)
191 X(J)=A(J)+FIX(RND*3)-FIX(RND*3)
192 NEXT IPP
228 FOR J44=1 TO 6
230 IF X(J44)<.000001 THEN 1670
231 NEXT J44
251 X(7)=-2.07+.001*(X(1)*X(2)*X(3)*X(4)*X(5)*X(6) )
252 X(8)=1.2-.00062* X(1) *X(4) *X(5)^2 *(X(1)+X(2)+X(3) ) -.00058* X(2) *X(3) *X(6)^2 *( X(1)+1.57*X(2) +X(4) )
331 IF X(7) <0 THEN PS1=ABS(X(7)) ELSE PS1=0
332 IF X(8) <0 THEN PS2=ABS(X(8)) ELSE PS2=0
402 POBA2=-.0204*X(1)*X(4)*( X(1)+X(2)+X(3) ) -.0187*X(2)*X(3)*( X(1) +1.57*X(2) +X(4) ) -.0607*X(1)*X(4)*X(5)^2*( X(1)+X(2)+X(3) )
403 POBA3= -.0437* X(2)*X(3)*X(6) ^2*( X(1) +1.57*X(2)+ X(4) )
411 POBA= POBA2 +POBA3
459 POB1=POBA -999999999999#*( PS1+PS2 )
463 P1NEWMAY=POB1
466 P=P1NEWMAY
1111 IF P<=M THEN 1670
1452 M=P
1453 PPOBA=POBA
1454 FOR KLX=1 TO 8
1455 A(KLX)=X(KLX)
1456 NEXT KLX
1557 GOTO 128
1670 NEXT I
1889 IF M<-131.047 THEN 1999
1900 PRINT A(1),A(2),A(3),A(4),A(5),A(6),A(7),A(8),M,JJJJ,PPOBA
1999 NEXT JJJJ
This computer program was run with qb64v1000-win [4, 5]. The complete output through JJJJ=-31814 is shown below. What follows is a hand copy from the computer-monitor screen; immediately below there is no rounding by hand.
5 4 9 10 .9478980563655991
1.213210631963454 4.297391435759135D-13 .0446358570056703
-131.046489365246 -31943 -131.046489365246
5 4 9 10 .9485139585993206
1.212422853216261 7.902118629582455D-13 4.483315721178263D-02
-131.0463261712594 -31845 -131.0463261712594
5 4 9 10 .9492067387089264
1.211537964389303 3.896284083434956D-14 4.505260447459625D-02
-131.0463408943493 -31814 -131.0463408943493
Above there is no rounding by hand; it is just straight copying by hand from the monitor 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=-31814 was one minute.
Acknowledgment
I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.
References
[1] George B. Dantzig, Discrete-Variable Extremum Problems. Operations Research, Vol. 5, No. 2 (Apr., 1957), pp. 266-277.
[2] Michael Junger, Thomas M. Liebling, Dennis Naddef, George L. Nemhauser, William R. Pulleybank, Gerhart Reinelt, Giovanni Rinaldi, Lawrence A. Wolsey–Editors, 50 Years of Integer Programming 1958-2008. Berlin: Springer, 2010.
[3] Panos Y. Papalambros, Douglass J. Wilde, Principles of Optimal Design, Second Edition. Cambridge University Press, 2000.
[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 (2012, March 30). The Domino Method of General Integer Nonlinear Programming Applied to a Transformer Design Model Involving Continuous Variables and General Integer Variables, Second Edition. Posted on March 30, 2012. http://computationalresultsfromcomputerprograms.wordpress.com/2012/03/30/the-domino-method-of-general-integer-nonlinear-programming
[7] Jsun Yui Wong (2013, January 3). The Domino Method of General Integer Nonlinear Programming Applied to Transformer Design, Third Edition. http://myblogsubstance.typepad.com/substance/2013/01/the-domino-method-of-general-integer-nonlinear-programming
Subscribe to:
Posts (Atom)