Program DSSRSSR for the solution of nonlinear optimisation models

Program DSSRSSR for the solution of nonlinear optimisation models

Program DSSRSSR for the solution of nonlinear optimisation models S. L. ONG Department o f Ovil Engineering, National University o f Singapore, Kent R...

516KB Sizes 0 Downloads 24 Views

Program DSSRSSR for the solution of nonlinear optimisation models S. L. ONG Department o f Ovil Engineering, National University o f Singapore, Kent Ridge, Singapore 0511

G. S. L E E C-E Natco In ternational Ltd, 51 Goldhill Plaza, No. 22-05, Thomson Road, Singapore 1130

T h i s article presents a B A S I C program for solving

nonlinear optimisation models. The optimisation a l g o r i t h m e m p l o y e d in the program is a slightly m o d i f i e d f o r m o f t h e d i r e c t s e a r c h w i t h systematic reduction of the size of search region ( D S S R S S R ) d e v e l o p e d b y Luss and Jaakola: The program is

implemented on an IBM-PC and tested by several constrained nonlinear optimisation problems given in the literature. From the results of these tests p e r f o r m e d , t h e D S S R S S R a l g o r i t h m was found to be effective and suitable for implementing on a microcomputer for solving nonlinear optimisation problems. INTRODUCTION The program presented in this article is designed to solve a general nonlinear optimisation problem formulated as follows: Optimise

f(x~,x2 ..... x.)

(1)

tion which fails to satisfy the constraint set (equations (2) and/or (3)) is discarded. The value of the objective function is then calculated for each admissible X (k) and the value of X (k) which corresponds to the best value of objective function is assigned to X *(k). If the desired number of iteration (typical value = 200) has been reached, the procedure terminates. Otherwise, the range of search lbr each variable is reduced by a factor, b, as follows:

= bXR

-1)

where 0 ~< b ~< 1 (typical value = 0.95). The value of k is then increased by one to k + 1 and another p sets of vectors (each calculated by equation (4)) are generated. Thereafter, the same process as outlined above is repeated. The algorithm presented above ignores any trial vector that does not satisfy the constraint set completely. This practice will tend to reduce the efficiency of the algorithm as it cuts down the total number of admissible trial solutions assessed in the course of searching for the optimal solution. Lesser trial solutions considered may lower the probability of obtaining the optimal solution. This abovementioned drawback can be partially overcome by introducing the upper and lower bounds constraints as follows:

Xmin, i~Xi~Xmax, i

s.t.

(5)

i = 1. . . . . n

(6)

where k = iteration index; k = 1. . . . ,N, and Zii = random number with a value between 0 and 1. Each trial solution generated from equation (4) is checked against equations (2) and (3) for feasibility. Any trial solu-

With equation (6), should the value of any X i generated happen to fall beyond its upper or lower bound, it can be assigned to its respective upper or lower bound accordingly. These bounds are incorporated to prevent the selection of unrealistic values of Xi. The values of Xmin, i and Smax, i need not be exact. Very often, these bounds can be established from the physical characteristic of the activity that the variable is representing. In the original DSSRSSR algorithm, p set of trial solutions are generated (in each iteration cycle) based on the best solution found in the previous iteration cycle. An alternative way is to replace the term X * ( k - l ) in equation (4) by the best solution tound at that stage. That is,X *(k-l) will be replaced immediately once a superior solution is found rather than to replace its value at the end of the iteration cycle. This modification will often lead to a faster rate of arrwing at the optimal solution. The DSSRSSR algorithm with the two abovementioned modifications is summarized as follows:

Accepted November 1985. Discussion closes September 1986.

(1) Input X *(°), Xmin, i and Xmax, i ( i = 1. . . . . n) and set k=l,]=l.

hi(X1,X 2. . . . . Xn)>~O

i = 1. . . . . m

(2)

g/(Xx, Xz . . . . . X , ) <~ 0

] = 1. . . . . m'

(3)

SOLUTION TECHNIQUE The optimisation algorithm employed in this article is basically based on the DSSRSSR algorithm developed by Luss and Jaakola. 1 Starting with an initial trial vector X *(°) and an initial search range for each variable XR (°), DSSRSSR generates p sets (typical value = 100) of trial solutions, each calculated by the following:

x(,") = x *('-1) + ( z / i - o 5)XR i = 1. . . . . n andj = 1. . . . . p

134

Adv. Eng. Software, 1986, Vol. 8, No. 3

(4)

0141-1195/86/030134-07 $2.00 © 1986 Computational Mechanics Publications

(2) Generate n random numbers with values between 0 and 1 and then generate a trial solution by using equation (4). (3) Check the feasibility of the trial solution generated against equation (6). Adjust the value of X t to its appropriate bound, if necessary. (4) Check the feasibility of the trial vector against equations (2) and (3). If infeasible, proceed to step 6. Otherwise, compute the value of the objective function. (5) Replace X * ( k - l ) (i = 1. . . . . n) by the newly generated trial solution if it is inferior to this newly generated trial solution. (6) Set ]=]+ 1. Proceed to step 2 if/<~p (a value to be supplied by the user; a typical value is 100). (7) Reduce the range of search for each variable by using equation (5). (8) Set k = k + 1. Proceed to step 2 i f k ~
solutions available at the beginning of each iteration cycle is displayed on the monitor if the option of 'detail results' is chosen. Otherwise, the program displays only the final results. If the output is longer than a page, the program will only display information that can be contained within a page. Hitting any key on the keyboard will cause the program to display the remaining information (one page at a time). The program allows the user to output the final results to either a monitor or a printer. Upon displaying all the results, the program will display the menu of the various options available. At this point, the user can choose an option to: (i) display the results all over again, or (ii)editing the data for further run, or (iii) solve the model with a new set of data again, or (iv) terminate the program. NUMERICAL EXPERIMENTS The program developed was tested by applying it to several optimisation models which have been solved by other algorithms. Owing to space limitation, we present only four of the tests performed. The computation time is reported for an IBM-PC. The program was compiled by using the IBM BASIC compiler version 1.0.

Example 1 Consider the production model of a US steel manufacturing company cited by Himmelblau: 2 Minimize f = 4.3Xz + 31.8X2 + 63.3X3 + 15.8X4 + 68.5Xs + 4.7X6 subject to 17.1Xz + 38.2X2 + 204.2X3+ 212.3X4+ 623.4Xs + 1495.5X6-- 169XIX3-3580X3Xs-3810X4Xs - 18 500X4X6--24 300XsX6>~ 32.97 17.9Xz+ 36.8X2+ 113.9X3+ 169.7X4+ 337.8Xs + 1385.2X6- 139Xz X 3 - 2450X4Xs - 16 600X4X6 - 17 200XsX6/> 25.12 -273X2-

7 0 X 4 - 819Xs + 26 000X4Xs ~> - 124.08

159.9X~- 311X2+ 587X4+ 391Xs + 2198X6 - 14000XzX6~> - 173.02 0~
Adv. Eng. Software, 1986, Vol. 8, No. 3

135

The corresponding values of the independent variables found in this study were X~' = 0.02685648, X~ = 0, X*=0, X,~=O, X*=0.028 and X ~ ' = 0 . 0 1 3 4 . This model was solved in 9.7 min of computer time. This computation time was based on a p value of 100 (i.e. 100 trial solutions were generated per iteration cycle). The same problem was also successfully solved f o r p = 40, 60 and 80. The computation times required corresponding to these p values were 4.7, 5.9 and 7.3 min, respectively. When p was set to a value of 20, the best value of f was found to be 3.1363, which is only about 0.016% inferior to the optimal solution. The computation time for this run was 3.2 rain. These computation times should be considered very satisfactory for a microcomputer.

This model was typical of problems in wtuch functions are described by a self-contained computer subroutine as follows: ~'[2)- i .h*YL I I

Y(q)=I.22*Y(2)-X(1)

1'}

Y{6)=(Xi2)+Y(3))/X(I)

Y2CALC=X( I )*( 112+13. 167*Y(b)-O. 6067~Y(6)*'2)/I00. IF( ABq (Y 2CALC-Y (2) )-0.0(}I ) 3U,30,20 y ( 2 )=Y 2CALC

21}

G(! To

ll1

311

CONTINITF

DID

Y(5)~86.35 + ]o098"Y(6) - 0.038"Y(6)*'2 + O.325"(Y(4)-89.)

Y(4)=93.

~(8)=-i ~3. + 3"Y(5)

Example 2 Consider the nonlinear optimisation model cited by Colville: a

Y(7)=Sq.82 - 0.222"Y(8) Y4CALC=98UO{I*X(3) / (Y (2)*Y (7) +X (3)* IO00) IF(ABS (Y4CALC-Y (4))-0. {lO01 ) 300,300,2rlO y(4)=k 4C~LC

200

Minimise f =

l,O pl~ ll]q}

IO0(X 2 --X~) 2 + (1 - - X O 2 + 90(X4-- X~) 2

+ (1 - - X a ) 2 + 10.1 [(X2-- 1) 2 + (i"4-- 1) 2] + 1 9 . 8 0 ( 2 - 1)(I"4-- 1) subject to --10~
i= 1,2,3,4

The problem was designed to have a nonoptimal stationary point at f = 8 that can cause premature convergence. Starting with Xi = 0 (i = 1, 2, 3, 4) and an initial search range of 20 for all the tbur variables, the best value of f = 6.958 x 10-7 was found in 6.7 rain of computer time. The value of Xi's corresponding to the optimum solution were 0.9998, 0.9995, 1.0003 and 1.0006 for i = 1. . . . . 4, respectively. These results compare favourably to the optimal solution o f f * = 0 and 7(/* = 1 (1 = 1,2, 3, 4) reported by Colville.a The slight differences between the two solutions is a result of rounding error. This example demonstrated the ability of the DSSRSSR program to local the optimal solution in the present of other nonoptimal stationary point.

~r}u

CON'PiNUI2

Starting with )(1 = 1000, I"2 = 8000, Xs = 60, p = 100, and the respective initial search range of 2000, 16 000, and 120, the optimal solution o f / * = 1161.257 were found in 25.5 min of computer time. The model was also successtully solved with p = 20, 40, 60, and 80. The computer times corresponding to these four values of p were 6.2, 11.2, 15.8 and 20.5rain, respectively. Again, the times taken are very reasonable for a microcomputer. Example 4 Consider the production model of the Shell Development Company cited by Colville: s Minimise f=-

-- 20X1X 2 -- 10X1Xs + 32XIX4-- IOXIXs -- 20X2XI + 3 9 X ~ - 6 X 2 X 3 - 31X2X4 + 32X2Xs -- 10XsX1 -- 67(3)(2 + IOX~ -- 6 X s X 4 - - IOXsXs + --

Example 3 Consider the optimisation model cited by Colville: a

31X4Xa

--

6X4Xs + 39X 2

--

20X4Xs

f = 0.063Y2 Ys - 5.04X1 -- 3 . 3 6 Y 3 - 0.035X2-- 10Xs subject to

subject to -- 1 6 X l + 2 ) ( 2 + 7 ( 4 + 4 0 > / 0

0 ~< Xa ~< 2000

-- 2X= + 0.4)(4 + 2Xs + 2 ~> 0

O~
-- 3.5)(1 + 2Xa + 0.25 t> 0

O < X a ~ < 120

-- 2)(2 -- 4 X 4 - Xs + 4 >/0

0 < Y2 < 5000

-- 9)(2 -- 9-)(3 + )(4 -- 2.8Xs + 4 t> 0

0 < Ys ~< 2000

2X1--4Xs+ l>~0

85 ~. Y4 ~- 93

-- X 1 - - )(2 -- X a - - X 4 - - Xs + 40/> 0

90--. < Ys~95

-- Xl -- 2)(2 -- 3Xs - -

3 ~< Y 6

-

TM

12

0.01 ~< Y7~<4 145 ~< Y 8 ~ 162

Adv. Eng. Software, 1986, Vol. 8, No. 3

32X4X1 --

l 0XsXI

+ 3 2 X s X = - 10XsXa-- 20XsX4 + 30X 2 + 47(1a + 8X=a + l OXaa + 6X2 + 2Xsa

Maximise

136

1 5 X 1 - 2 7 ) ( 2 - 3 6 X s - - 187(4-- 12Xs + 30X~

2)(4 -- Xs +

60 i> 0

X~ + 27(2 + 3Xa + 4)(4 + 5Xs -- 5/> 0 X~ + X2 + Xa + X4 + Xs - 1 >~ 0 Xi~>O

i=1 ..... 5

Starting with XI = 0, X2 = 0, Xa = 0, X4 = 0, Xs = 1, p = 100, and the respective initial search range of two for all the five independent variables, the optimal solution of - - 3 2 . 3 2 2 was found in 17.4 min of computer time. The corresponding values of the five independent variables were X1 = 0.300, X2 = 0.340, Xa = 0.400, X4 = 0.448 and Xs = 0.210. This example again demonstrated the ability of the DSSRSSR program in solving a reasonable size nonlinear optimisation model on a microcomputer. CONCLUSION

gram is quite suitable for solving some nonlinear optimisation models encountered in real world on microcomputers. REFERENCES 1 Luss, R. and Jaakola, T. H. I. Optimization by direct search and systematic reduction of the size of search region,A1ChEJ. 1973, 19 (4), 760 2 Himmelblau, D. M. Applied Nonlinear Programming, McGrawHill, 1972 3 ColviUe, A. R. A comparative study on nonlinear programming code, IBM N.Y. Science Center, Report 320-2949, 1968

The examples illustrated have shown that DSSRSSR pro-

APPENI)IX A

Listing

[0 l) 20 25 30 35 4O 45 5O 55 60 65 100 130 160 190 220 250 280 310 340 370 400

of p r o g r a m

DSSRSSR

550

Nonlinear Programming Via Direct Search with System Reduction of Size of Search Regiot~ instructions : I. Independent variables are defined as X(I), I=I,...,NVAR% NVAR% = Number of Independent Variable 2. Objective Function is to be placed within statements 5000 to 5999 First statement must start with number 5000 OBJ = Value of Objective Function 3. Constraint set is to be placed within statements 6000 to 65529 First statement must start with statement 6000 4. Indicator% = i : All constraints are satisfied = 0 : One or more of the constraints are not met DIM X O P T ( 5 0 ) , X ( 5 0 ) , X L O W ( 5 0 ) , X U P ( 5 0 ) , X R A N G E ( 5 0 ) , X R A N G E 0 ( 5 0 ) , X 0 ( 5 0 ) ' input the Information for the O p t i m i z a t i o n Model CLS PRINT "Type of O p t i m i z a t i o n : 0 - M a x i m i z a t i o n " PRINT i - Minimization " INPUT "Enter your option (0/I) ";IMIN% : PRINT PRINT "Output Options : 0 - Final Results only " PRINT '° I - Detail Results R e q u i r e d " INPUT "Enter your option (0/I) ";IOUT% : PRINT INPUT "No. of points to be generated (per cycle) ";NPOINT% : PRINT INPUT "Fraction in which search ranges are to be reduced (per cycle) "; F~CTION : PRINT INPUT "No. of Independent Variables = ";NVAR% lCYC%=I:ICOLI%=5:ICOL2%=I6:ICOL3%=33:ICOL4%=46:ICOL5%=61 C L S : P R I N T TAB(If) "Enter the Relevant I n f o r m a t i o n for the Variable Indicated" : PRINT PRINT " Variable Guessed Solution Lower Bound Upper Bound Search Range" PRINT "

580 610 640 670 700 730 760 790 820 850 880 910 940 970 1000

ISCYCZ=(ICYC%-I)*I5+I:IECYC%=ICYC%*I5:ILINE%=5 IF ISCYC%>NVAR% THEN 970 IF I E C Y C % > N V A R % THEN I E C Y C % = N V A R % FOR J C Y C % = I S C Y C % TO IECYC% LOCATE I L I N E % , I C O L I % , [ : P R I N T JCYC% LOCATE I L I N E % , I C O L 2 % , I : I N P U T ....,XO(JCYC%) LOCATE [ L I N E % , I C O L 3 % , I : I N P U T ....,XLOW(JCYC%) LOCATE I L I N E % , I C O L 4 % , I : I N P U T ....,XUP(JCYC%) LOCATE II,I N E % , I C O L 5 % , I : I N P U T ,XRANGE0(JCYC%) ILINE%=ILINE%+I NEXT JCYC% ICYC%=ICYC%+I PRINT "Hit any key to continue " ; : X C $ = I N P U T $ ( 1 ) : I F ' MENU CLS

430 460 490 520

IECYC%
A,-~. ~

THEN 490

, f o . , : - , ~ ! 9 8 6 , VoL 8, No. 3

137

I, u , ' '12.q' l 1,{) ]le-;',t [21~) 12.4(~ 1271) 13(~t/ !33~: i;(~() 1 ~9(J 147a [45(I 14~{) 1510 ]540 157() •

1500 i(~30 [660 1690 1720 1750 1780 1810 1840 1870 1900 1930 ]960 1990 2020

2050 2080 2110 2140 2170 2200 2230 2260 2290 232(I 2350 2380 2410 2440 2500 2530 2560 2590 2620 2650 2680 2710 2740 277U 2800 2830 2860

Pk]NT TAi.~ ' ~,) " I ............... Pi'.LI~T P.',);(! B) " ' ' , . S o L v i n g The Moetel PklNT ' f A B ( 1 5 ) "'. [. Checking/E,-iJting Basic /ntormatiot~ FEINT F A B ( 1 3 ) "! 2. Checking/Editing inf~,rmation for \,;iFJ,lb]<.~q P[-'INT T A B ( l % ] "! 3. Displaying Results PtZLNT T A B ( 1 3 ) "! 4 . gild o f P r o g r a m :' P K I a T TAe~(13) % . . . . . . . ~., I.()CATE l{), I O, ] : i r e ' t i T " E n t e r your Option (0/1/2/3/4) " ; IOPT;g IF [()PT';<~) (;R ]t)P'['%>4 THEN PRINT C H R $ ( 7 ) : GOT() 13()0 ¢)N IOP'[';~+l (;<)'i'O 298(*,1390,1930, '+180, 487~! r,,,.,~S,.pRiNT. " B a s i c Information :PRINT Iie ]MiN%:I TIiEN O P T $ = " M i n i m i z a t i o n '' ELSE O P T $ = " M a x i m i z a t i o n "' PI{]NT "I. Type of Optimization : ";OPTS IF /OUT%=I THEN OUTT$="Detail Results" ELSE OUTT$="Final Results only" PRINT "2. Output Option : ";OUTT$ PRINT "3. No. of point to be generated (per cycle) = ";NPOINT% PRINT "4. Frac.tion in which each search range is to reduced (per cycle) = ";FRACTION PRINT "5. No. of Independent Variables = ";NVAR% PRINT : PRINT "options : 0 : Return to Menu" PRINT " i - 5 : To Check/Edit the item indicated" iNPUT Enter your options ;JO}Z% : PRINT IF JOPT%<=O OR JOPT%>5 THEN i000 ON JOPT% GOTO ] 7 8 0 , 1 8 1 0 , 1 8 4 0 , 1 8 7 0 , 1 9 0 0 INPUT "Optimization Option : 0-Max/l-Min ";IMIN% : GOTO 1390 INPUT "Output Option : 0 - F i n a l / l - D e t a i l ";IOUT% : GOTO 1390 INPUT " N O . OF POINTS TO BE GENERATED (PER CYCLE) = " ; N P O I N T % : G O T O 1390 INPUT "Fraction in which each search range is to be reduced (per cycle) = ";FRACTION : GOTO 1390 INPUT "No. of Independent Variables = ";NVAR% : GOTO 1390 ICYC%= I CLS PRINT " Variable Guessed Solution Lower Bound Upper Bound Search Range" PRINT " ,

t



. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ISCYC%=(ICYC%-I)*I5+I:IECYC%=ICYC%*IS:ILINE%=3 IF ISCYC%>NVAR% THEN 1000 IF IECYC%>NVAR% THEN IECYC%=NVAR% FOR JCYC%=ISCYC% TO IECYC% LOCATE I L I N E % , I C O L 1 % , I : P R I N T JCYC% LOCATE [ L I N E % , I C O L 2 % , I : P R I N T X0(JCYC%) LOCATE I L I N E % , I C O L 3 % , 1 : P R I N T XLOW(JCYC%) LOCATE I L I N E % , I C O L 4 % , I : P R I N T XUP(JCYC%) LOCATE [ L I N E % , I C O L 5 % , I : P R I N T XRANGEO(JCYC%) [LINE%=ILINE%+I NEXT JCYC% PRINT:PRINT "options 0 : To Continue " PRINT TAB(9) ISCYC%;".J - ";IECYC%;".J : To correct the J column of a chosen variable, J=l to 4":PRINT LOCATE [ L I N E % + 3 , 1 , 1 : I N P U T "Enter your option ";LOPT$ LENG%=LEN(LOPT$):LPOSI%=INSTR(I,LOPT$,"."):LOPT=VAL(LOPT$) IF LOPT=0 THEN i000 iF (LPOSI%=0) OR (LPOSI%+]<>LENG%) THEN PRINT C H R $ ( 7 ) : G O T O 2440 LOPTI%=VAL(LEFT$(LOPT$,LPOSI%-I)):LOPT2%=VAL(RIGHT$(LOPT$,I)) IF LOPTI% I E C Y C % OR LOPT2%4 THEN PRINT CIIR$(7):GOTO 2440 ON LOPT2% GOTO 2 6 8 0 , 2 7 4 0 , 2 8 0 0 , 2 8 6 0 PRINT "Variable No. ";LOPTI%;:INPUT " Guessed Solution = ";X0(LOPTI%) GOTO 1960 PRINT "Variable No. ";LOPT]%;:INPUT Lower Bound = ";XLOW(LOPTI%) GOTO 1960 PRINT "VariabIe No. " ; L O P T I % ; : I N P U T " Upper bound = ";XUP(LOPTI%) GOTO 1960 PRINT "Variable No. ";LOPTI%;:INPUT " Search Range = ";XRANGEO(LOPTI%)

138 Adv. Eng. Software, 1986, VoL 8, No. 3

2890 2920 2950 2980 3010 304I~ 3070 3100 3130 3160 319(1 322'0 ]250 3280 3310 3340 3370 3400 3430 3460 3490 3520 3550 3580

GOTO 1961) ICYC%=ICYC%+I PRINT "Hit any key to continue ";:XC$=INPUT$(1):GOTO 1960 'Algorithm NCYCLE%=INT (LOG (.000035) / LOG (FRACTION)) FOR I,~;=l TO NVAR% ;,:OPT(]%)=X0(E>I) X(I%)---XO(t/,,) XP~ANGE( I}o) =XP~NGE0 ( 1% ) NEXT 1% GOSUB 6000 'check for feasibility IF INDICATOR>'=[ TttEN GOSUB 5000:FOPT=OBJ:GOTO 3280 IF IMIN%=0 THEN F O P T = - I E + 3 0 ELSE FOPT=IE+30 RD=RND(-2000) FOR 1CYC%=I TO NCYCLE% I~ANOOEIEZE RND*32767 iF IOUT%=0 THEN 3520 PRINT "At Iteration Cycle no : ";ICYC%;" Objective Function = ";FOPT FOR IP%=I TO'NVAR% PRINT "X( ";IP%;" ) = ";XOPT(IP%) NEXT IP% : PRINT IF (ICYC%<=I0 AND NPOINT%<=100) THEN NPOINTI%=100 ELSE NPOINTI%=NPOINT% FOR JCYC%=I TO NPOINTI% FOR IV%=I TO NVAR%

3610 X ( IV% )=XOPT ( iV% )+ ( RND-. 5 ) * XRANGE ( IV% ) 3640 3670 3700 3730 3760 3790 3820 3850 3880 3910 3940 3970 4000 4030 4060 4090 4120 4150 4180 4210 4240 4270 4300

43313 4360 4390 4420 4450 4480 4510 4540 4570 4~00 4630 4660 4690 4720 4750 4780 4810 4840 487()

IF X(IV%)XUP(IV%) THEN X(IV%)=XUP(IV%) NEXT IV% GOSUB 6000 iF INDICATOR%=O THEN 4000 ELSE GOSUB 5000 IF IMIN%=I THEN 3850 IF OBJ<=FOPT THEN 4000 ELSE 3880 IF OBJ>=FOPT THEN 4000 FOPT=OBJ FOR IV%=I TO NVAR% XOPT(IV%)=X(IV%) NEXT IV% NEXT JCYC% FOR IV%=l TO NVAR% XRANGE ( I V%) =XRANGE ( IV% )* FRACTION NEXT IV% NEXT ICYC% 'Results PRINT:INPUT "Output to Screen or Printer (S/P) ";OUTDEV$ IF OUTDEV$="S '' OR OUTDEV$="s" THEN 4240 ELSE 4660 KP%=I CLS PRINT "Tbe Optimum Value of Objective Function = ";FOPT:PRINT PRINT TAB(17) "Variable" TAB(32) "Solution" PRINT TAB(17) " -" TAB(32) . . . . IPS%=(KP%-I )*I 5+I IF ]_PS%>NVAR% THEN i000 [PE%=KP%* 15 IF IPE%>NVAR% THEN IPE%=NVAR% FOR IP%=IPS% TO IPE% PRINT TAB(20) IP% TAB(32) XOPT(IP%) NEXT IP% KPZ=KP%+ i PRINT "Hit any key to continue ";:XC$=INPUT$(1) :IF IPE%
Adv. Eng. ,~oftware, 1986, VoL 8, No. 3

139

A P Pi~,NI)IX B l i,;t!ng of objective function block, using example I

l ) < , ,< ' THE O B J E C T I V E FUNCTION -} / • 501(1 (,BJ=,~ 3*X(1)+:31.8*X(X)+63.3*X(3)+lS.8*X(4)+68.5*X(5)+4.7*X(6) v,(32~) RETIJIiN

APPENDIX

C

l,isting of constraint

block,

using example

I

THE CONSTRAINT SET 6000 ' 6010 INDICATOR%=I 6020 YY=I7.1*X(1)+38.2*X(2)+204.2*X(3)+212.3*X(4)+623.4*X(5)+1495.5*X(6)-I69* X(1)*X(3)-3580*X(B)*X(5)-3810*X(4)*X(5)-I8500*X(4)*X(6)-24300*X(5)*X(6) 6030 IF YY<32.97 THEN 6110 6040 YY=I7.9*X(1)+36.8*X(2)+II3.9*X(3)+169.7*X(4)+337.8*X(5)+I385.2*X(6)139*X(1)*X(B)-2450*X(4)*X(5)-I6600*X(4)*X(6)-I7200*X(5)*X(6) 6050 IF YY<25.12 THEN 6110 6060 YY=-273*X(2)-70*X(4)-819*X(5)+26000*X(4)*X(5) 0070 IF YY<-124.08 THEN 6110 6080 YY=I59.9*X(1)-311*X(2)+587*X(4)+391*X(5)+2198*X(6)-I4000*X(1)*X(6) 6090 IF YY<-173.02 THEN 6110 b I ()0 RETURN 61 i0 REM INDICATES CONSTRAINT VIOLATION 6120 INI)ICATOR%=O 0130

RETURN

140 Adv. Eng, SOftW~, 1986, Vol. 8, NO. 3