Monday, September 12, 2016

Simultaneously Solving in Integers a System of Two Simultaneous Nonlinear Equations with Fifty General Integer Variables

Jsun Yui Wong

The computer program listed below seeks one integer solution or more to the following given system of two nonlinear equations:

20
sigma   i*(x(i)^2+x(i)^4)  =  0
i=1

50
sigma   i*(x(i)^2+x(i)^4)  =  0.
i=1

These two equations are based on the last two problems in Schittkowski [9, page 212 and page 213].
One notes the starting vector line 94, which is 94 A(KK) = -1000 + FIX(RND * 2001).

0 REM DEFDBL A-Z
3 DEFINT J, K, X

4 DIM X(1142), A(1142), L(1133), K(1133)


5 FOR JJJJ = -32000 TO 32000


    14 RANDOMIZE JJJJ
    16 M = -1D+17
    91 FOR KK = 1 TO 50

        94 A(KK) = -1000 + FIX(RND * 2001)


    95 NEXT KK


    128 FOR I = 1 TO 100000



        129 FOR K = 1 TO 50

            131 X(K) = A(K)
        132 NEXT K
        155 FOR IPP = 1 TO FIX(1 + RND * 3)

            181 B = 1 + FIX(RND * 50)
            182 IF RND < .5 THEN 183 ELSE GOTO 189

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


            186 X(B) = A(B) + (RND ^ 3) * R


            187 REM IF RND < .25 THEN X(B) = A(B) + RND * R ELSE IF RND < .333 THEN X(B) = A(B) + RND ^ 4 * R ELSE IF RND < .5 THEN X(B) = A(B) + RND ^ 7 * R ELSE X(B) = CINT(A(B))

            188 GOTO 191

            189 IF RND < .5 THEN X(B) = A(B) - 1 ELSE X(B) = A(B) + 1

        191 NEXT IPP
        1103 SUMONE = 0


        1111 FOR J44 = 1 TO 20

            1115 SUMONE = SUMONE + J44 * (X(J44) ^ 2 + X(J44) ^ 4)


        1118 NEXT J44

        1203 SUMTWO = 0


        1211 FOR J44 = 1 TO 50

            1215 SUMTWO = SUMTWO + J44 * (X(J44) ^ 2 + X(J44) ^ 4)



        1218 NEXT J44
        1275 N111 = SUMONE - 4200



        1276 N112 = SUMTWO - 25500



        1277 P = -ABS(N111) - ABS(N112)



        1451 IF P <= M THEN 1670
        1657 FOR KEW = 1 TO 50

            1658 A(KEW) = X(KEW)
        1659 NEXT KEW
        1661 M = P
    1670 NEXT I
    1888 IF M < 0 THEN 1999


    1912 PRINT A(1), A(2), A(3), A(4), A(5)



    1913 PRINT A(6), A(7), A(8), A(9), A(10)

    1914 PRINT A(11), A(12), A(13), A(14), A(15)


    1915 PRINT A(16), A(17), A(18), A(19), A(20), M, JJJJ


    1921 PRINT A(21), A(22), A(23), A(24), A(25)


    1922 PRINT A(26), A(27), A(28), A(29), A(30)

    1923 PRINT A(31), A(32), A(33), A(34), A(35)
    1924 PRINT A(36), A(37), A(38), A(39), A(40)
    1925 PRINT A(41), A(42), A(43), A(44), A(45)
    1927 PRINT A(46), A(47), A(48), A(49), A(50)

1999 NEXT JJJJ

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

-1      -1      -5      -1      -1
0      0      -3      0      0
0      0      0      1      0
3      0      0      -1      0
0         -31999
0      -2      1      0      0
0      0      -1      -1      0
0      0      0      -2      0
-1      -2      0      0      0
0      2      0      0      2
3      0      0      -4      0

0      1      0      -1      -5
1      1      -1      2      0
1      0      0      2      0
0      1      0      -2      0
0         -31992
-1      1      2      -1      1
-1      -1      0      0      -2
-1      -2      2      0      0
-1      0      2      3      -1
1      1      4      -1      1
-1      -1      2      2      0

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 [10], the wall-clock time for obtaining the output through JJJJ= -31992 was 20 seconds, not including creating .EXEC file time.

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

References
[1] C. A. Floudas, Deterministic Global Optimization. Kluwer Academic Publishers, 2000.
[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] W. Hock, K. Schittkowski, Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1981.
[4] 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.
[5] 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.
[6] 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.
[7] William H. Mills, A System of Quadratic Diophantine Equations, Pacific Journal of Mathematics, 3 (1953), pp. 209-220.
[8] 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.
[9] K. Schittkowski, More Test Examples for Nonlinear Programming Codes. Springer-Verlag, 1987.
[10] Wikipedia, QB64, https://en.wikipedia.org/wiki/QB64.
[11] Wolfram Research, Inc., Diophantine Polynomial Systems. https:/reference.wolfram.com/language/tutorial/DiophantineReduce.html.
[12] 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.
[13] Jsun Yui Wong (2015, October 26). Testing the Domino Method of General Integer Nonlinear Programming with Brown’s Almost Linear System of Fifteen Equations, Second Edition. http://myblogsubstance.typepad.com/substance/2015/10/

No comments:

Post a Comment