Monday, October 9, 2017

Applying the Nonlinear Programming Algorithm of This Blog To Solve a Geometric Programming Problem Involving Discrete Variables

Jsun Yui Wong

The computer program listed below seeks to solve the following problem from page 710 of Li and Lu [9, Program 3].

Minimize     X(1) ^ 3 * X(2) * X(3) ^ 3 * X(4) + X(1) ^ 3 * X(2) * X(3) * X(4) ^ 2

subject to

         X(1) ^ 3 * X(2) * X(3) ^ 2 + X(3) * X(4)<=-500,

        - X(1) ^ 3 * X(2) * X(3) + X(3) ^ 2 * X(4)<=500,

         -5<=X(1) <=5,

        -5<=X(2) <=5,

where

X(3) Epsilon{   -1,  0,  1,  4, 5,  6, 7.5,  8,  9, 10    },

X(4) Epsilon{  -27,  -18, -9, -7,  -4,  -1, 1, 3, 4, 5  }.
     
The added variables X(5) and X(6) below are slack variables.  One takes note of line 330, which is 330 IF X(J99) < 0 THEN X(J99) = X(J99) ELSE X(J99) = 0.


0 DEFDBL A-Z

2 DEFINT K

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 STEP .01

    14 RANDOMIZE JJJJ
    16 M = -1D+37

    75 A(1) = -5 + RND * 10
    77 A(2) = -5 + RND * 10

    86 IF RND < .100 THEN A(3) = -1 ELSE IF RND < .111 THEN A(3) = 0 ELSE IF RND < .125 THEN A(3) = 1 ELSE IF RND < .143 THEN A(3) = 4 ELSE IF RND < .167 THEN A(3) = 5 ELSE IF RND < .200 THEN A(3) = 6 ELSE IF RND < .25 THEN A(3) = 7.5 ELSE IF RND < .333 THEN A(3) = 8 ELSE IF RND < .5 THEN A(3) = 9 ELSE A(3) = 10

    88 IF RND < .100 THEN A(4) = -27 ELSE IF RND < .111 THEN A(4) = -28 ELSE IF RND < .125 THEN A(4) = -9 ELSE IF RND < .143 THEN A(4) = -7 ELSE IF RND < .167 THEN A(4) = -4 ELSE IF RND < .200 THEN A(4) = -1 ELSE IF RND < .25 THEN A(4) = 1 ELSE IF RND < .333 THEN A(4) = 3 ELSE IF RND < .5 THEN A(4) = 4 ELSE A(4) = 5

    128 FOR I = 1 TO 3000

        129 FOR KKQQ = 1 TO 4
            130 X(KKQQ) = A(KKQQ)
        131 NEXT KKQQ
        133 FOR IPP = 1 TO (1 + FIX(RND * 1))
            134 r = (1 - RND * 2) * A(1)

            135 IF RND < .5 THEN 137

            136 X(1) = A(1) + (RND ^ (RND * 10)) * r
            137 IF RND < .5 THEN 139
            138 X(2) = A(2) + (RND ^ (RND * 10)) * r

            139 IF RND < .5 THEN 151

            141 IF RND < .100 THEN X(3) = -1 ELSE IF RND < .111 THEN X(3) = 0 ELSE IF RND < .125 THEN X(3) = 1 ELSE IF RND < .143 THEN X(3) = 4 ELSE IF RND < .167 THEN X(3) = 5 ELSE IF RND < .200 THEN X(3) = 6 ELSE IF RND < .25 THEN X(3) = 7.5 ELSE IF RND < .333 THEN X(3) = 8 ELSE IF RND < .5 THEN X(3) = 9 ELSE X(3) = 10
            151 IF RND < .5 THEN 191

            161 IF RND < .100 THEN X(4) = -27 ELSE IF RND < .111 THEN X(4) = -18 ELSE IF RND < .125 THEN X(4) = -9 ELSE IF RND < .143 THEN X(4) = -7 ELSE IF RND < .167 THEN X(4) = -4 ELSE IF RND < .200 THEN X(4) = -1 ELSE IF RND < .25 THEN X(4) = 1 ELSE IF RND < .333 THEN X(4) = 3 ELSE IF RND < .5 THEN X(4) = 4 ELSE X(4) = 5

        191 NEXT IPP

        208 IF X(1) < -5 THEN 1670

        210 IF X(1) > 5 THEN 1670


        211 IF X(2) < -5 THEN 1670

        212 IF X(2) > 5 THEN 1670

        301 X(5) = -500 - X(1) ^ 3 * X(2) * X(3) ^ 2 - X(3) * X(4)
        303 X(6) = 500 + X(1) ^ 3 * X(2) * X(3) - X(3) ^ 2 * X(4)

        325 FOR J99 = 5 TO 6

            330 IF X(J99) < 0 THEN X(J99) = X(J99) ELSE X(J99) = 0

        331 NEXT J99

        357 POBA = -X(1) ^ 3 * X(2) * X(3) ^ 3 * X(4) - X(1) ^ 3 * X(2) * X(3) * X(4) ^ 2 + 1000000 * (X(5) + X(6))

        466 P = POBA

        1111 IF P <= M THEN 1670

        1452 M = P
        1454 FOR KLX = 1 TO 6

            1459 A(KLX) = X(KLX)
        1460 NEXT KLX
        1557 GOTO 128

    1670 NEXT I

    1889 IF M < 369900 THEN 1999

    1900 PRINT A(1), A(2), A(3), A(4)
    1901 PRINT A(5), A(6), M, JJJJ

1999 NEXT JJJJ


This BASIC computer program was run with qb64v1000-win [26].  The complete output through JJJJ = -31999.96000000001 is shown below:

-4.958160881457932         4.323632488239245      1
-27
0         0           369953.99999999944      -31999.98

-4.842381486860238         4.64123558725103        1
-27
0         0           369953.99999999944      -31999.97000000001

-4.762515957826314         4.878668210944634         1
-27
0         0           369954                           -31999.96000000001

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

On a personal computer with a Pentium Dual-Core CPU E5200 @2.50GHz, 2.50 GHz, 960 MB of RAM and qb64v1000-win [26], the wall-clock time for obtaining the output through JJJJ= -31999.96000000001 was 8 seconds, most of these seconds were for creating the .EXE file.

Acknowledgment

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

References

[1]  Yuichiro Anzai (1974).  On Integer Fractional Programming. Journal Operations Research Society of Japan, Volume 17, No. 1, March 1974, pp. 49-66.
www..orsj.or.jp/~archiv/pdf/e_mag/Vol.17_01_049.pdf.

[2]  Sjirk Boon. Solving systems of nonlinear equations. Sci. Math. Num-Analysis,1992, Newsgroup Article 3529.     .

[3]  H. Chickermane, H. C. Gea (1996)  Structural optimization using a new local approximation method, International Journal for Numerical Methods in Engineering, 39, pp. 829-846.

[4]  Piya Chootinan, Anthony Chen (2006).  Constraint Handling in genetic algorithms using a gradient-based repair method.  Computers and Operations Research 33 (2006) 2263-2281.

[5]  Amir Hossein Gandomi, Xin-She Yang, Amir Hossein Alavi (2011).  Mixed variable structural optimization using Firefly Algorithm, Computers and Structures 89 (2011) 2325-2336.

[6]  Amir Hossein Gandomi, Xin-She Yang, Siamak Taratahari, Amir Hossein Alavi (2013).  Firefly Algorithm with Chaos, Communications in Nonlinear Science and Numerical Sinulation 18 (2013) 89-98.

[7]  Amir Hossein Gandomi, Xin-She Yang, Amir Hossein Alavi (2013).  Cuckoo search algorithm:  a metaheuristicapproach to solve structural optimization problem.  Engineering with Computers (2013) 29:17-35.

[8]  Amir Hossein Gandomi, Xin-She Yang, Amir Hossein Alavi (2013).  Erratum to:  Cuckoo search algorithm:  a metaheuristicapproach to solve structural optimization problem.  Engineering with Computers (2013) 29:245.

[9]  Han-Lin Li , Hao-Chun Lu (2009).  Global Optimization for Generalized Geometric Programs with Mixed Free-Sign Variables.   Operations Research, 57 (3) May-June 2009, pp. 701-713.

[10]  Han-Lin Li, Jung-Fa Tsai (2008).  A distributed computational algorithm for solving portfolio problems with integer variables.  European Journal of Operational Research 186 (2008) pp.882-891.

[11]  Ming-Hua Lin, Jung-Fa Tsai (2014).  A deterministic global approach for mixed-discrete structural optimization, Engineering Optimization  (2014) 46:7, pp. 863-879.9

[12]  Harry Markowitz  (1952).   Portfolio Selection.   The Journal of Finance  7 (2008) pp. 77-91.

[13]  Mathworks. Solving a mixed integer engineering design problem using the genetic algorithm - MATLAB & Simulink Example.
https://www.mathworks.com/help/gads/examples/solving-a-mixed-integer-engineering-design-problem-using-the-genetic-algorithm.html/

[14]  Ong Kok Meng, Ong Pauline, Sia Chee Kiong, H. A. Wahab, N. Jafferi. Application of Modified Flower Pollination Algorithm on Mechanical Engineering Design Problem.  IOP Conf. Series: Materials Science and Engineering 165 (2017) 012032.

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

[16]  Sinan Melih Nigdeli, Gebrail Bekdas, Xin-She Yang (2016). Application of the Flower Pollination Algoritm in Structural Engineering. Springer International Publishing Switzerland 2016.  www.springer.com/cda/content/document/cda.../

[17]  Gideon Oron (1979) An algorithm for optimizing nonlinear contrained zero-one problems to improve wastewater treatment, Engineering Optimization, 4:2, 109-114.

[18]  H. S. Ryoo, N. V. Sahinidis (1995).  Global optimization of nonconvex NLP and MINLP with applications in process design. Computers and Chemical Engineering Vol. 19 (5) (1995) pp. 551-566.

[19]  c. R. Seshan, V. G. Tikekar (1980)  Algorithms for Fractional Programming.  Journal of the Indian Institute of Science 62 (B), Feb. 1980, Pp. 9-16.

[20]  P. B. Thanedar, G. N. Vanderplaats (1995).  Survey of discrete variable optimization for structural design,  Journal of Structural Engineering, 121 (2), 301-306 (1995).

[21]  Jung-Fa Tsai (2005).  Global optimization of nonlinear fractional programming problems in engineering design. Engineering Optimization  (2005) 37:4, pp. 399-409.

[22]  Jung-Fa Tsai, Ming-Hua Lin (2007).  Finding all solutions of systems of nonlinear equations with free variables.  Engineering Optimization  (2007) 39:6, pp. 649-659

[23]  Jung-Fa Tsai, Ming-Hua Lin, Yi-Chung Hu (2007).  On generalized geometric programming problems with non-positive variables.  European Journal of Operational Research 178 (2007) pp. 10-19.

[24]  Jung-Fa Tsai, Ming-Hua Lin (2008).  Global optimization of signomial mixed-integer nonlinear programming with free variables.  Journal of Global Optimization (2008) 42  pp. 39-49.

[25]  Jung-Fa Tsai, Ming-Hua Lin (2013). An improved framework for solving NLIPs with signomial terms in the objective or constraints to global optimality.  Computers and Chemical Engineering (2013) 53 pp. 44-54.

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

[27] Jsun Yui Wong (2012, April 12).  The Domino Method of General Integer Nonlinear Programming Applied to a Nonlinear Fractional Programming Problem from the Literature. http://myblogsubstance.typepad.com/substance/2012/04/12/ 

[28] Xin-She Yang, Christian Huyck, Mehmet Karamanoglu, Nawaz Khan (2014).  True global optimality of the pressure vessel design problem:  A benchmark for bio-inspired optimisation algorithms.
https://arxiv.org/pdf/1403.7793.pdf.

[29]  Xin-She Yang, Amir Hossein Gandomi (2012).  Bat algorithm: a novel approach for global engineering optimization.  Engineering Computations: International Journal for Computer-Aided Engineering and Software, Vol. 20,No. 5, 2012, pp. 461-483.

[30]  B. D. Youn, K. K. Choi (2004). A new responsesurface methodology for reliability-based design optimization. Computers and Structures 82 (2004) 241-256.

No comments:

Post a Comment