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.



No comments:

Post a Comment