Wednesday, August 24, 2016

A Nonlinear Integer Programming Code/Software/Solver Applied to Solving a Nonlinear System of 32500 Simultaneous Diophantine Equations Based on the Brown Almost Linear Function


Jsun Yui Wong

The computer program listed below seeks to solve the following nonlinear system of 32500 Diophantine equations:

            32500
x(i)  +   sigma    x(j)  -  (32500+1)   =  0, for i = 1, 2, 3,..., 32499,
            j=1

32500
pi   x(j)     -1      = 0.
j=1

This present system is based on the Brown almost linear function in La Cruz, Marinez, and Raydan [3, p. 25]; http://www.ime.unicamp.br/~martinez/lmrreport.pdf.  See also Han and Han [2, p. 227, Example 3]; www.SciRP.org/journal/am.

The starting vectors are shown in line 42, which is 42 A(J44) = -3 + FIX(RND * 7).

0 REM DEFDBL A-Z
2 DEFINT J, X

3 DIM B(30999), N(32999), A(32999), H(32999), L(32999), U(32999), X(32999), D(32999), P(32999), PS(32999), J(32999)

12 FOR JJJJ = -32000 TO 32000

    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 32500
        42 A(J44) = -3 + FIX(RND * 7)



    43 NEXT J44
    128 FOR I = 1 TO 400000


        129 FOR KKQQ = 1 TO 32500
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 32503)
            182 IF RND < .5 THEN 183 ELSE GOTO 191



            183 R = (1 - RND * 2) * A(J)


            187 REM IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1



            189 X(J) = A(J) + (RND ^ 3) * R

            190 GOTO 192


            191 IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1
        192 NEXT IPP

        251 SU = 0
        254 FOR J44 = 1 TO 32499


            258 SU = SU + X(J44)


        266 NEXT J44

        311 X(32500) = -X(1) - SU + (32500 + 1)


        351 PR = 1
        353 FOR J45 = 1 TO 32500


            355 PR = PR * X(J45)

        359 NEXT J45


        422 FOR J41 = 2 TO 32499


            439 P(J41) = -ABS(X(J41) + SU + X(32500) - (32500 + 1))


        427 NEXT J41


        441 P(32500) = -ABS(PR - 1)


        451 FOR J77 = 2 TO 32500


            452 IF P(J77) < 0 THEN P(J77) = P(J77) ELSE P(J77) = 0

        454 NEXT J77


        577 SP = 0

        578 FOR J99 = 2 TO 32500


            579 SP = SP + P(J99)
        580 NEXT J99
        595 P = SP

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 32500

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I

    1889 REM IF M < -99 THEN 1999

    1947 PRINT A(1), A(2), A(3), A(4), A(32497), A(32498), A(32499), A(32500), M, JJJJ

1999 NEXT JJJJ

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

0      0      2      -2      1
-3      -2      -32528      -2.129789E+09    
-32000

1      1      1      1      1
1      1      1      0      -31999

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

Thus, through JJJJ=-31999, M=0 was obtained at JJJJ=-31999.  Of the 32500 A's, only the 8 A’s of line 1947 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], the wall-clock time for obtaining the output through JJJJ= -31999 was six hours.        

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

[2] Tianmin Han, Yuhuan Han, Solving large scale nonlinear equations by a new ODE numerical integration method, Applied Mathematics, 2010, 1, pp. 222-229.  www.SciRP.org/journal/am.

[3] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations: Theory and experiments. Technical Report RT-04-08, July 2004.
http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

[4] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations, Mathematics of Computation, vol. 75, no. 255, pp.1429-1448, 2006.

[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, Florida 33432, 1981.

[6] William H. Mills, A System of Quadratic Diophantine Equations, Pacific Journal of Mathematics, 3 (1953), pp. 209-220.

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

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

[9] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

Tuesday, August 23, 2016

A Nonlinear Integer Programming Code/Software/Solver Applied to Solving a Nonlinear System of 20500 Simultaneous Diophantine Equations Based on the Brown Almost Linear Function

Jsun Yui Wong

The computer program listed below seeks to solve the following nonlinear system of 20500 Diophantine equations:

             20500
x(i)  +   sigma    x(j)  -  (20500+1)   =  0, for i = 1, 2, 3,..., 20499,
             j=1

20500
pi   x(j)     -1      = 0.
j=1

This present system is based on the Brown almost linear function in La Cruz, Marinez, and Raydan [3, p. 25]; http://www.ime.unicamp.br/~martinez/lmrreport.pdf.  See also Han and Han [2, p. 227, Example 3]; www.SciRP.org/journal/am.

The starting vectors are shown in line 42, which is 42 A(J44) = -3 + FIX(RND * 7).

0 REM DEFDBL A-Z
2 DEFINT J, X

3 DIM B(20999), N(20999), A(20999), H(20999), L(20999), U(20999), X(20999), D(20999), P(20999), PS(20999), J(20999)

12 FOR JJJJ = -32000 TO 32000

    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 20500
        42 A(J44) = -3 + FIX(RND * 7)

    43 NEXT J44
    128 FOR I = 1 TO 70000

        129 FOR KKQQ = 1 TO 20500
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 20503)

            183 REM R = (1 - RND * 2) * A(J)

            187 IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1


            189 REM X(J) = A(J) + (RND ^ 3) * R


        192 NEXT IPP

        251 SU = 0
        254 FOR J44 = 1 TO 20499


            258 SU = SU + X(J44)


        266 NEXT J44

        311 X(20500) = -X(1) - SU + (20500 + 1)


        351 PR = 1
        353 FOR J45 = 1 TO 20500


            355 PR = PR * X(J45)

        359 NEXT J45


        422 FOR J41 = 2 TO 20499


            439 P(J41) = -ABS(X(J41) + SU + X(20500) - (20500 + 1))


        427 NEXT J41


        441 P(20500) = -ABS(PR - 1)


        451 FOR J77 = 2 TO 20500


            452 IF P(J77) < 0 THEN P(J77) = P(J77) ELSE P(J77) = 0

        454 NEXT J77


        577 SP = 0

        578 FOR J99 = 2 TO 20500


            579 SP = SP + P(J99)
        580 NEXT J99
        595 P = SP

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 20500

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I

    1889 REM IF M < -99 THEN 1999

    1947 PRINT A(1), A(2), A(3), A(4), A(20497), A(20498), A(20499), A(20500), M, JJJJ

1999 NEXT JJJJ

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

0      0      0      0      0
0      0      20501     -1       -32000

1      1      1      1      1
1      1      12      -12      -31999

-1      -1      -1      -1      -1
-1      -1    32767      -8235      -31998

1      1      1      1      1
1      1      4      -4      -31997

-1      0      -1      -1      1
1      -1    32767      -8235      -31996

-1      -1      -1      -1      1
0      -1    32767      -8235      -31995

1      1      1     1     1
1      1      1     0      -31994

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

Thus, through JJJJ=-31994, M=0 was obtained only at JJJJ=-31994.  Of the 20500 A's, only the 8 A’s of line 1947 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], the wall-clock time for obtaining the output through JJJJ= -31994 was ten hours.      

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

[2] Tianmin Han, Yuhuan Han, Solving large scale nonlinear equations by a new ODE numerical integration method, Applied Mathematics, 2010, 1, pp. 222-229.  www.SciRP.org/journal/am.

[3] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations: Theory and experiments. Technical Report RT-04-08, July 2004.
http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

[4] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations, Mathematics of Computation, vol. 75, no. 255, pp.1429-1448, 2006.

[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, Florida 33432, 1981.

[6] William H. Mills, A System of Quadratic Diophantine Equations, Pacific Journal of Mathematics, 3 (1953), pp. 209-220.

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

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

[9] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

Saturday, August 20, 2016

ERRATUM: A Nonlinear Integer Programming Code/Software/Solver Applied to Solving a Nonlinear System of 7500 Simultaneous Diophantine Equations Based on the Brown Function

Jsun Yui Wong

Line 441 of the computer program should 441 P(7500) = -ABS(PR - 1),
not 441 P(4500) = -ABS(PR - 1).

A Nonlinear Integer Programming Code/Software/Solver Applied to Solving a Nonlinear System of 9500 Simultaneous Diophantine Equations Based on the Brown Almost Linear Function


Jsun Yui Wong

The computer program listed below seeks to solve the following nonlinear system of 9500 Diophantine equations:

             9500
x(i)  +   sigma    x(j)  -  (9500+1)   =  0, for i = 1, 2, 3,..., 9499,
             j=1

9500
pi   x(j)     -1      = 0.
j=1

This present system is based on the Brown almost linear function in La Cruz, Marinez, and Raydan [3, p. 25]; http://www.ime.unicamp.br/~martinez/lmrreport.pdf.  See also Han and Han [2, p. 227, Example 3]; www.SciRP.org/journal/am..

The starting vectors are shown in line 42, which is  42 A(J44) = -2 + FIX(RND * 5).

0 REM DEFDBL A-Z
2 DEFINT J, X
3 DIM B(9999), N(9999), A(9999), H(9999), L(9999), U(9999), X(9999), D(9999), P(9999), PS(9999), J(9999)

12 FOR JJJJ = -32000 TO 32000

    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 9500
        42 A(J44) = -2 + FIX(RND * 5)

    43 NEXT J44
    128 FOR I = 1 TO 50000

        129 FOR KKQQ = 1 TO 9500
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 9500)

            183 REM R = (1 - RND * 2) * A(J)

            187 IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1


            189 REM X(J) = A(J) + (RND ^ 3) * R


        192 NEXT IPP

        251 SU = 0
        254 FOR J44 = 1 TO 9499


            258 SU = SU + X(J44)


        266 NEXT J44

        311 X(9500) = -X(1) - SU + (9500 + 1)


        351 PR = 1
        353 FOR J45 = 1 TO 9500


            355 PR = PR * X(J45)

        359 NEXT J45


        422 FOR J41 = 2 TO 9499


            439 P(J41) = -ABS(X(J41) + SU + X(9500) - (9500 + 1))


        427 NEXT J41


        441 P(9500) = -ABS(PR - 1)


        451 FOR J77 = 2 TO 9500


            452 IF P(J77) < 0 THEN P(J77) = P(J77) ELSE P(J77) = 0

        454 NEXT J77


        577 SP = 0

        578 FOR J99 = 2 TO 9500


            579 SP = SP + P(J99)
        580 NEXT J99
        595 P = SP

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 9500

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I

    1889 REM IF M < -99 THEN 1999

    1947 PRINT A(1), A(2), A(3), A(4), A(7497), A(9498), A(9499), A(9500), M, JJJJ

1999 NEXT JJJJ

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

0      0      0      0      0
0      0      9501     -3       -32000

0      0      0      0      0
0      0      9503     -3       -31999

0      0      0      0      0
0      0      9501     -1       -31998

0      0      0      0      0
0      0      9502     -2       -31997

-1      -1      -1      -1      -1
-1      -1    18997    -5      -31996

-1      -1      -1      -1      -1
-1      -1    19000     -2      -31995

0      0      0      0      0
0      0      9503     -5       -31994

0      0      0      0      0
0      0      9500     -2       -31993

-1      -1      -1      -1      -1
-1      -1    19000    -2      -31992

1      1      1      1      1
1      1       3       -3      -31991

-1      -1      -1      -1      -1
-1      -1    19001    -3      -31990

1      1     1     1     1
1      1     1     0      -31989

-1      -1      -1      -1      -1
-1      -1    19000    -2      -31988

-1      -1      -1      -1      -1
-1      -1    19000    -2      -31987

0      0      0      0      0
0      0      9501     -1       -31986

0      0      0      0      0
0      0      9500     -2       -31985

0      0      0      0      0
0      0      9501     -3       -31984

1      1     1      1      1
1      1     1      0      -31983

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

Thus, at JJJJ=-31989 and JJJJ=-31983, M=0.  Of the 9500 A's, only the 8 A’s of line 1947 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 [7], the wall-clock time for obtaining the output through JJJJ= -31983 was four hours.      

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

[2] Tianmin Han, Yuhuan Han, Solving large scale nonlinear equations by a new ODE numerical integration method, Applied Mathematics, 2010, 1, pp. 222-229.  www.SciRP.org/journal/am.

[3] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations: Theory and experiments. Technical Report RT-04-08, July 2004.
http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

[4] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations, Mathematics of Computation, vol. 75, no. 255, pp.1429-1448, 2006.

[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, Florida 33432, 1981.

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

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

[8] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

Thursday, August 18, 2016

A Nonlinear Integer Programming Code/Software/Solver Applied to Solving a Nonlinear System of 7500 Simultaneous Diophantine Equations Based on the Brown Function, Revised Edition

Jsun Yui Wong

The following computer program seeks to solve the following nonlinear system of 7500 Diophantine equations:

           7500
x(i) + sigma x(j) - (7500+1) = 0, for i = 1, 2, 3,..., 7499,
           j=1

7500
pi    x(j) -1 = 0.
j=1

The present system is based on Brown's almost linear function in La Cruz, Marinez, and Raydan [2, p. 25]; http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

The starting vectors are given in line 42, which is 42 A(J44) = -3 + FIX(RND * 7).

While line 441 of the older edition is 441 P(4500) = -ABS(PR - 1),
here line 441 is 441 P(7500) = -ABS(PR - 1).

0 REM DEFDBL A-Z
2 DEFINT I, J, X

3 DIM B(9999), N(9999), A(9999), H(9999), L(9999), U(9999), X(9999), D(9999), P(9999), PS(9999), J(9999)

12 FOR JJJJ = -32000 TO 32000

    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 7500
        42 A(J44) = -3 + FIX(RND * 7)

    43 NEXT J44
    128 FOR I = 1 TO 30000

        129 FOR KKQQ = 1 TO 7500
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 7500)

            183 REM R = (1 - RND * 2) * A(J)

            187 IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1


            189 REM X(J) = A(J) + (RND ^ 3) * R


        192 NEXT IPP

        251 SU = 0
        254 FOR J44 = 1 TO 7499


            258 SU = SU + X(J44)


        266 NEXT J44

        311 X(7500) = -X(1) - SU + (7500 + 1)


        351 PR = 1
        353 FOR J45 = 1 TO 7500


            355 PR = PR * X(J45)

        359 NEXT J45


        422 FOR J41 = 2 TO 7499


            439 P(J41) = -ABS(X(J41) + SU + X(7500) - (7500 + 1))


        427 NEXT J41


        441 P(7500) = -ABS(PR - 1)

        451 FOR J77 = 2 TO 7500


            452 IF P(J77) < 0 THEN P(J77) = P(J77) ELSE P(J77) = 0

        454 NEXT J77


        577 SP = 0

        578 FOR J99 = 2 TO 7500


            579 SP = SP + P(J99)
        580 NEXT J99
        595 P = SP

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 7500

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I

    1889 REM IF M < -99 THEN 1999

    1947 PRINT A(1), A(2), A(3), A(4), A(7497), A(7498), A(7499), A(7500), M, JJJJ

1999 NEXT JJJJ

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

0    0     0    0    0
0    0     7502    -2    -32000

1    1    1    1    1
1    1    11      -11      -31999

1    1     1     1    1
1    1      2      -2    -31998

0    0    0    0    0
0    0     7503    -3    -31997

1    1    1    1    1
1    1    1    0    -31996

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

Above at JJJJ=-31996, M=0. Of the 7500 A's, only the eight A’s of line 1947 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 [6], the wall-clock time for obtaining the output through JJJJ= -31996 was fifty minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory. American Mathematical Society, Providence, Rhode Island, 2007.

[2] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations: Theory and experiments. Technical Report RT-04-08, July 2004.
http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

[3] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations, Mathematics of Computation, vol. 75, no. 255, pp.1429-1448, 2006.

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

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

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

[7] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

Tuesday, August 16, 2016

A Nonlinear Integer Programming Code/Software/Solver Applied to Solving a Nonlinear System of 7500 Simultaneous Diophantine Equations Based on the Brown Function

Jsun Yui Wong

The following computer program seeks to solve the following nonlinear system of 7500 Diophantine equations:

            7500
x(i)  +   sigma    x(j)  -  (7500+1)   =  0, for i = 1, 2, 3,..., 7499,
            j=1

7500
pi   x(j)     -1      = 0.
j=1

This present system is based on Brown's almost linear function in La Cruz, Marinez, and Raydan [2, p. 25]; http://www.ime.unicamp.br/~martinez/lmrreport.pdf.  

The starting vectors are given in line 42, which is 42 A(J44) = -3 + FIX(RND * 7).

0 REM DEFDBL A-Z
2 DEFINT I, J, X

3 DIM B(9999), N(9999), A(9999), H(9999), L(9999), U(9999), X(9999), D(9999), P(9999), PS(9999), J(9999)

12 FOR JJJJ = -32000 TO 32000

    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 7500
        42 A(J44) = -3 + FIX(RND * 7)



    43 NEXT J44
    128 FOR I = 1 TO 30000


        129 FOR KKQQ = 1 TO 7500
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 7500)

            183 REM R = (1 - RND * 2) * A(J)

            187 IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1


            189 REM X(J) = A(J) + (RND ^ 3) * R


        192 NEXT IPP

        251 SU = 0
        254 FOR J44 = 1 TO 7499


            258 SU = SU + X(J44)


        266 NEXT J44

        311 X(7500) = -X(1) - SU + (7500 + 1)


        351 PR = 1
        353 FOR J45 = 1 TO 7500


            355 PR = PR * X(J45)

        359 NEXT J45


        422 FOR J41 = 2 TO 7499


            439 P(J41) = -ABS(X(J41) + SU + X(7500) - (7500 + 1))


        427 NEXT J41


        441 P(4500) = -ABS(PR - 1)

        451 FOR J77 = 2 TO 7500


            452 IF P(J77) < 0 THEN P(J77) = P(J77) ELSE P(J77) = 0

        454 NEXT J77


        577 SP = 0

        578 FOR J99 = 2 TO 7500


            579 SP = SP + P(J99)
        580 NEXT J99
        595 P = SP

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 7500

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I

    1889 REM IF M < -99 THEN 1999

    1947 PRINT A(1), A(2), A(3), A(4), A(7497), A(7498), A(7499), A(7500), M, JJJJ

1999 NEXT JJJJ

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

0      0      0      0      0
0      0      7503      -2      -32000

1      1      1      1      1
1      1      13      -11      -31999

1      1      1      1      1
1      1      1    -2           -31998

0      0      0      0      0
0      0      7498    -3      -31997

1      1      1      1      1
1      1      1      0       -31996

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

Above at JJJJ=-31996, M=0.  Of the 7500 A's, only the eight A’s of line 1947 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 [6], the wall-clock time for obtaining the output through JJJJ= -31996 was one hour.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

[2] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations: Theory and experiments. Technical Report RT-04-08, July 2004.
http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

[3] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations, Mathematics of Computation, vol. 75, no. 255, pp.1429-1448, 2006.

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

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

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

[7] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

Saturday, August 13, 2016

Simultaneously Solving in Integers a Nonlinear System of 5500 Diophantine Equations in 5500 Unknowns

Jsun Yui Wong

The following computer program seeks to solve the following nonlinear system of 5500 Diophantine equations:

            5500
x(i)  +   sigma    x(j)  -  (5500+1)   =  0, for i = 1, 2, 3,..., 5499,
            j=1

5500
pi   x(j)     -1      = 0.
j=1

This present system is based on Brown's almost linear function in La Cruz, Marinez, and Raydan [2, p. 25]; http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

One notes the starting vectors of line 42, which is  42 A(J44) = -5 + FIX(RND * 11).

0 REM DEFDBL A-Z
2 DEFINT I, J, X

3 DIM B(9999), N(9999), A(9999), H(9999), L(9999), U(9999), X(9999), D(9999), P(9999), PS(9999), J(9999)

12 FOR JJJJ = -32000 TO 32000

    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 5500
        42 A(J44) = -5 + FIX(RND * 11)


    43 NEXT J44
    128 FOR I = 1 TO 30000


        129 FOR KKQQ = 1 TO 5500
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 5500)

            183 REM R = (1 - RND * 2) * A(J)

            187 IF RND < .5 THEN X(J) = A(J) - 1 ELSE X(J) = A(J) + 1


            189 REM X(J) = A(J) + (RND ^ 3) * R


        192 NEXT IPP

        251 SU = 0
        254 FOR J44 = 1 TO 5499


            258 SU = SU + X(J44)


        266 NEXT J44

        311 X(5500) = -X(1) - SU + (5500 + 1)


        351 PR = 1
        353 FOR J45 = 1 TO 5500


            355 PR = PR * X(J45)

        359 NEXT J45


        422 FOR J41 = 2 TO 5499


            439 P(J41) = -ABS(X(J41) + SU + X(5500) - (5500 + 1))


        427 NEXT J41


        441 P(5500) = -ABS(PR - 1)

        451 FOR J77 = 2 TO 5500


            452 IF P(J77) < 0 THEN P(J77) = P(J77) ELSE P(J77) = 0

        454 NEXT J77


        577 SP = 0

        578 FOR J99 = 2 TO 5500


            579 SP = SP + P(J99)
        580 NEXT J99
        595 P = SP

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 5500

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I

    1889 REM IF M < -99 THEN 1999


    1947 PRINT A(1), A(2), A(3), A(4), A(5497), A(5498), A(5499), A(5500), M, JJJJ
1999 NEXT JJJJ

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

0   0   0   0   0
0   0   5504   -4   -32000

-1   -1   -1   -1   -1
-1   -1   11000   -2   -31999

0   0   0   0   0
0   0   5501   -3   -31998

0   0   0   0   0
0   0   5503   -3   -31997

0   0   0   0  0
0   0   5500   -2   -31996

-1   -1   -1   -1   -1
-1   -1   11000   -2   -31995

-2   -2   -2   -2    -2
-2   -2     16498     -4    -31994

0   0   0   0   0
0   0   5501   -1   -31993

-1   -1   -1   -1   -1
-1   -1   11000   -2   -31992

0   0   0   0   0
0   0   5501   -1   -31991

1   1   1   1   1
1   1   7   -7   -31990

2   2   2   2   2
2   2   -5496   -3   -31989

1   1   1   1   1
1   1   1   0   -31988

0   0   0   0   0
0   0   5499   -3   -31987

1   1   1   1   1
1   1   1   0   -31986

1   1   1   1   1
1   1   1   0   -31985

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

Above at JJJJ=-31988, at JJJJ= -31986, and at JJJJ=-31985, M=0.  Of the 5500 unknowns, only the eight A’s of line 1947 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 [6], the wall-clock time for obtaining the output through JJJJ= -31985 was 100 minutes.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

[2] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations: Theory and experiments. Technical Report RT-04-08, July 2004.
http://www.ime.unicamp.br/~martinez/lmrreport.pdf.

[3] William La Cruz, Jose Mario Martinez, Marcos Raydan, Spectral residual method without gradient information for solving large-scale nonlinear systems of equations, Mathematics of Computation, vol. 75, no. 255, pp.1429-1448, 2006.

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

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

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

[7] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.


Wednesday, August 10, 2016

Simultaneously Solving in Integers a System of Three Nonlinear Diophantine Equations in Three Unknowns

Jsun Yui Wong

The following computer program seeks to solve the following system of nonlinear Diophantine equations:

x(x+y+z)  =  -36
y(x+y+z)  =  27
z(x+y+z)  =  90.

This system comes from www.mathalino.com/reviewer/algebra/example-03-simultaneous-equations, [5].

One notes the starting vectors of line 42, which is 42 A(J44) = -100 + FIX(RND * 201).  

0 REM DEFDBL A-Z
2 DEFINT I, J, X

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
    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 3
        42 A(J44) = -100 + FIX(RND * 201)
    43 NEXT J44
    128 FOR I = 1 TO 100

        129 FOR KKQQ = 1 TO 3
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 3)

            183 R = (1 - RND * 2) * A(J)

            187 X(J) = A(J) + (RND ^ 3) * R
        192 NEXT IPP
        439 P1 = -ABS(X(1) * (X(1) + X(2) + X(3)) + 36)

        440 P2 = -ABS(X(2) * (X(1) + X(2) + X(3)) - 27)

        441 P3 = -ABS(X(3) * (X(1) + X(2) + X(3)) - 90)

        462 IF P1 < 0 THEN P1 = P1 ELSE P1 = 0

        463 IF P2 < 0 THEN P2 = P2 ELSE P2 = 0

        464 IF P3 < 0 THEN P3 = P3 ELSE P3 = 0

        466 P = P1 + P2 + P3
        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 3

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I
    1889 IF M < 0 THEN 1999
    1947 PRINT A(1), A(2), A(3), M, JJJJ

1999 NEXT JJJJ

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

4      -3      -10      0      -31919
-4      3      10      0      -31907
-4      3      10      0      -30959
-4      3      10      0      -30843
4      -3      -10      0      -30528
4      -3      -10      0      -30396
-4      3      10      0      -30377
-4      3      10      0      -30330
-4      3      10      0      -30077
4      -3      -10      0      -29931
-4      3      10      0      -29516
-4      3      10      0      -29368
4      -3      -10      0      -29351
-4      3      10      0      -28999
-4      3      10      0      -28696
-4      3      10      0      -28286
-4      3      10      0      -28193

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 [3], the wall-clock time for obtaining the output through JJJJ= -28193 was 3 seconds, not including "Creating .EXEC file..." time.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

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

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

[4] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

[5] www.mathalino.com/reviewer/algebra/example-03-simultaneous-equations.  Retrieved August 9, 2016.

Monday, August 8, 2016

Solving in Integers a Nonlinear System of Six Simultaneous Diophantine Equations in Three Unknowns

Jsun Yui Wong

The following computer program seeks to solve in integers the nonlinear system of six simultaneous Diophantine equations in three unknowns

2 *x * (1 + y + y ^ 2)    =   3 * (1 + y ^ 4)

2 * y * (1 + z + z ^ 2)     = 3 * (1 + z ^ 4)

2 * z * (1 + x + x ^ 2)     = 3 * (1 + x ^ 4).

x+y+z   =   x^3  +y^3 +z^3

x^3  +y^3  +z^3   =  3

x+y+z   =  3.

The first three equations come from de Konnick and Mercier [1, p. 87]; the last three equations come from de Konnick and Mercier [1, p. 85];

One notes the starting vectors of line 52, which is 52 A(J44) = -100 + FIX(RND * 201).

0 REM DEFDBL A-Z
2 DEFINT I, J, X

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

    15 RANDOMIZE JJJJ

    16 M = -1D+37
    51 FOR J44 = 1 TO 3

        52 A(J44) = -100 + FIX(RND * 201)


    53 NEXT J44
    128 FOR I = 1 TO 100

        129 FOR KKQQ = 1 TO 3


            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))


            181 J = 1 + FIX(RND * 3)

            183 R = (1 - RND * 2) * A(J)
            187 X(J) = A(J) + (RND ^ 3) * R
        192 NEXT IPP

        212 X(3) = 3 - X(1) - X(2)

        360 P1 = -ABS(X(1) ^ 3 + X(2) ^ 3 + X(3) ^ 3 - 3)


        361 P2 = -ABS(X(1) + X(2) + X(3) - X(1) ^ 3 - X(2) ^ 3 - X(3) ^ 3)


        459 P3 = -ABS(2 * X(1) * (1 + X(2) + X(2) ^ 2) - 3 * (1 + X(2) ^ 4))


        460 P4 = -ABS(2 * X(2) * (1 + X(3) + X(3) ^ 2) - 3 * (1 + X(3) ^ 4))


        461 P5 = -ABS(2 * X(3) * (1 + X(1) + X(1) ^ 2) - 3 * (1 + X(1) ^ 4))


        462 IF P1 < 0 THEN P1 = P1 ELSE P1 = 0

        463 IF P2 < 0 THEN P2 = P2 ELSE P2 = 0

        464 IF P3 < 0 THEN P3 = P3 ELSE P3 = 0

        465 IF P4 < 0 THEN P4 = P4 ELSE P4 = 0


        466 IF P5 < 0 THEN P5 = P5 ELSE P5 = 0


        766 P = P1 + P2 + P3 + P3 + P4 + P5

        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 3

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I
    1889 IF M < 0 THEN 1999

    1947 PRINT A(1), A(2), A(3), M, JJJJ
1999 NEXT JJJJ

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

1      1      1      0      -31999
1      1      1      0      -31998
1      1      1      0      -31996
1      1      1      0      -31993
1      1      1      0      -31992
1      1      1      0      -31991
1      1      1      0      -31978
1      1      1      0      -31973
1      1      1      0      -31967
1      1      1      0      -31964
1      1      1      0      -31960
1      1      1      0      -31956
1      1      1      0      -31955
1      1      1      0      -31953

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 [3], the wall-clock time for obtaining the output through JJJJ= -31953 was 2 seconds, not including "Creating .EXEC file..." time.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  Americam Mathematical Society, Providence, Rhode Island, 2007.

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

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

[4] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.

Sunday, August 7, 2016

Solving with Integers a System of Simultaneous Nonlinear Diophantine Equations

Jsun Yui Wong

The following computer program seeks to solve the following system of nonlinear Diophantine equations:

     7 * x + 8 * y + 9 * x * y   =   24

     8 * y + 9 * z + 7 * y * z    =   24

     9 *  z+ 7 * x + 8 * z * x    =   24.

This system of nonlinear Diophantine equations is based on the system on p. 85 of de Konnick and Mercier [1].

One notes the starting vector of line 42, which is 42 A(J44) = -100 + FIX(RND * 201).

0 REM DEFDBL A-Z
2 DEFINT I, J, X

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


    15 RANDOMIZE JJJJ

    16 M = -1D+37

    41 FOR J44 = 1 TO 3


        42 A(J44) = -100 + FIX(RND * 201)


    43 NEXT J44
    128 FOR I = 1 TO 100

        129 FOR KKQQ = 1 TO 3


            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))

            181 J = 1 + FIX(RND * 3)

            183 R = (1 - RND * 2) * A(J)
            187 X(J) = A(J) + (RND ^ 3) * R
        192 NEXT IPP

        459 P1 = -ABS(7 * X(1) + 8 * X(2) + 9 * X(1) * X(2) - 24)
        460 P2 = -ABS(8 * X(2) + 9 * X(3) + 7 * X(2) * X(3) - 24)
        461 P3 = -ABS(9 * X(3) + 7 * X(1) + 8 * X(3) * X(1) - 24)

        462 IF P1 < 0 THEN P1 = P1 ELSE P1 = 0

        463 IF P2 < 0 THEN P2 = P2 ELSE P2 = 0

        464 IF P3 < 0 THEN P3 = P3 ELSE P3 = 0

        466 P = P1 + P2 + P3


        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 3

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I
    1889 IF M < -20 THEN 1999

    1947 PRINT A(1), A(2), A(3), M, JJJJ
1999 NEXT JJJJ

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

1      1      1      0      -31997
-2      -3      -4      -18      -31990
1      1      1      0      -31988
1      1      1      0      -31983
1      1      1      0      -31944
1      1      1      0      -31933
-2      -3      -4      -18      -31907
-2      -4      -3      -20      -31894

The solution on p. 289 of de Konnick and Mercier [1] is shown above.

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 [3], the wall-clock time for obtaining the output through JJJJ= -31894 was 2 seconds, not including "Creating .EXEC file..." time..

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  Americam Mathematical Society, Providence, Rhode Island, 2007.

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

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

[4] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html

Saturday, August 6, 2016

Simultaneously Solving with Integers a Nonlinear System of Diophantine Equations


Jsun Yui Wong

The following computer program seeks to solve the following nonlinear system of Diophantine equations:

x+y+z =  x^3  +y^3 +z^3

x^3  +y^3  +z^3  = 3

x+y+z  = 3.

This system comes from de Konnick and Mercier [1, p. 85].

One notes the starting vecor of line 52, which is  52 A(J44) = -100 + FIX(RND * 201).

0 REM DEFDBL A-Z
2 DEFINT I, J, X

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

    15 RANDOMIZE JJJJ

    16 M = -1D+37
    51 FOR J44 = 1 TO 3

        52 A(J44) = -100 + FIX(RND * 201)


    53 NEXT J44
    128 FOR I = 1 TO 100

        129 FOR KKQQ = 1 TO 3


            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 3))


            181 J = 1 + FIX(RND * 3)

            183 R = (1 - RND * 2) * A(J)
            187 X(J) = A(J) + (RND ^ 3) * R
        192 NEXT IPP

        212 X(3) = 3 - X(1) - X(2)

        460 P1 = -ABS(X(1) ^ 3 + X(2) ^ 3 + X(3) ^ 3 - 3)

        461 P2 = -ABS(X(1) + X(2) + X(3) - X(1) ^ 3 - X(2) ^ 3 - X(3) ^ 3)


        462 IF P1 < 0 THEN P1 = P1 ELSE P1 = 0

        463 IF P2 < 0 THEN P2 = P2 ELSE P2 = 0

        466 P = P1 + P2


        1111 IF P <= M THEN 1670
        1452 M = P
        1454 FOR KLX = 1 TO 3

            1455 A(KLX) = X(KLX)
        1456 NEXT KLX
        1557 GOTO 128
    1670 NEXT I
    1889 IF M < 0 THEN 1999

    1947 PRINT A(1), A(2), A(3), M, JJJJ

1999 NEXT JJJJ

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

1   1   1   0   -31989
4   4   -5   0   -31984
1   1   1   0   -31974
1   1   1   0   -31965
4   4   -5   0   -31957
1   1   1   0   -31955
4   -5   4   0   -31951
4   4   -5   0   -31950
1   1   1   0   -31936
4   4   -5   0   -31926
4   4   -5   0   -31921
4   4   -5   0   -31920
4   -5   4   0   -31913
-5   4   4   0   -31910
1   1   1   0   -31908

The four solutions on p. 85 and p. 291 of de Konnick and Mercier [1] are shown above.

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 [3], the wall-clock time for obtaining the output through JJJJ= -31908 was 2 seconds, not including "Creating .EXEC file..." time.

Acknowledgment

I would like to acknowledge the encouragement of Roberta Clark and Tom Clark.

References

[1] Jean-Marie de Konnick, Armel Mercier, 1001 Problems in Classical Number Theory.  American Mathematical Society, Providence, Rhode Island, 2007.

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

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

[4] Jsun Yui Wong (2013, November 11). Solving Nonlinear Systems of Equations with the Domino Method, Second Edition. http://myblogsubstance.typepad.com/substance/2013/11/solving-nonlinear-systems-of-equations-with-the-domino-method-second-edition.html.