A Computer Program Solving a Nonlinear System of Equations with Continuous Variables

Jsun Yui Wong

The computer program listed below seeks to solve the following nonlinear system of equations from El-Emary and El-Kareem [3, p. 287].
See http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.388.158&rep=rep1&type.=pdf.

W(1)+W(2) – 2 = 0

W(1)*X(1)+W(2)*X(2) = 0

W(1)*X(1)^2+W(2)*X(2)^2 – 2/3 = 0

W(1)*X(1)^3+W(2)*X(2)^3 = 0.
0 DEFDBL A-Z
1 DEFINT J, K
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
89 RANDOMIZE JJJJ
90 M = -3D+30
111 FOR J44 = 1 TO 4
112 A(J44) = -10 + RND * 20
115 NEXT J44

128 FOR I = 1 TO 100000

129 FOR KKQQ = 1 TO 4
130 X(KKQQ) = A(KKQQ)
131 NEXT KKQQ
139 FOR IPP = 1 TO FIX(1 + RND * 3)
140 B = 1 + FIX(RND * 4)
150 R = (1 – RND * 2) * A(B)
155 REM IF RND < .5 THEN 160 ELSE GOTO 167

160 X(B) = (A(B) + RND ^ 3 * R)
168 NEXT IPP
195 X(3) = 2 – X(4)

215 N(6) = -ABS(X(3) * X(1) + X(4) * X(2))
216 N(7) = -ABS(X(3) * X(1) ^ 2 + X(4) * X(2) ^ 2 – 2 / 3)
217 N(8) = -ABS(X(3) * X(1) ^ 3 + X(4) * X(2) ^ 3)

322 PD1 = N(6) + N(7) + N(8)
1111 IF PD1 <= M THEN 1670
1452 M = PD1
1454 FOR KLX = 1 TO 4
1455 A(KLX) = X(KLX)

1456 NEXT KLX
1557 GOTO 128
1670 NEXT I

1889 IF M < -.00001 THEN 1999
1904 PRINT A(1), A(2), A(3), A(4)

1905 PRINT M, JJJJ
1999 NEXT JJJJ

This computer program was run with qb64v1000-win [18]. Copied by hand from the screen, the computer program’s complete output through JJJJ=-31974 is shown below:

-.5773549463311843       .5773455920859565      .9999918989859991
1.000008101014001
-6.236163485953182D-06          -31995

.577350912241483       -.5773496261384886       .9999988862020528
1.000001113797947
-8.574020639171893D-07          -31990

-.5773502949987083       .5773502433804245       .9999999552970431
1.000000044702957
-3.441249075542658D-08          -31974

Above there is no rounding by hand; it is just straight copying by hand from the screen.

On a personal computer using a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and using qb64v1000-win [18], the wall-clock time for obtaining the output through JJJJ= -31974 was 28 seconds, not including “Creating .EXE file…” time–the total time was 40 seconds.

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] I.M.M. El-Emary, M.M.Abd El-Kareem, Towards Using Genetic Algorithmfor Solving Nonlinear Equation System. World Applied Sciences Journal 5 (3):282-289, 2008.
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.388.158&rep=rep1&type.=pdf.

[4] Martin Gardner (1979), Mathematical Games. Scientific American, 241 (3), Page 25.

[5] 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

[6] Angel Fernando Kuri-Morales, Solution of Simultaneous Non-Linear Equations Using Genetic Algorithm. http://www.wseas.us/e-library/conferences/brazil2002/papers/449-158.pdf.

[7] 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.

[8] 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.

[9] 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.

[10] 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.

[11] 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.

[12] Tito Piezas III, Euler Bricks and Quadruples. http://sites.google.com/site/tpiezas/0021

[13] Anton Schigur, Solving a System of Diophantine Equations. Mathematics Stack Exchange. http://math.stackexchange.com/questions/398364/solving-a-system-of-diophantine-equations.

[14] W. Sierpinski, A Selection of Problems in the Theory of Numbers. New York: The McMillan Company, 1964.

[15] E.K. Virtanen (2008-05-26). “Interview With Galleon”.
http://www.basicprogramming.org/PCOPY!issue70/#galleoninterview.

[16] Michel Waldschmidt, Open Diophantine Problems. Moscow Mathematical Journal, Volume 4, Number 1, January-March 2004, Pages 245-305.

[17] Wikipedia, Euler Brick. en.wikipedia.org/wiki/Euler_brick.

[18] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64.

[19] Jsun Yui Wong (2014, February 8), Testing the Nonlinear Integer Programming Solver with Lander and Parkin’s Counterexample to Euler’s Conjecture on Sums of Like Powers. https://computerprogramsandresults.wordpress.com/2014/02/08/testing.