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

No comments:

Post a Comment