Sunday, June 28, 2009

A Computer Program and Its Output for an Integer Nonlinear Programming Problem

Jsun Yui Wong

The computer program listed below seeks to solve the following problem.

Objective function:
Maximize:
+X(1)

Constraints:
X(2)-X(1)^3>=0
X(1)^2-X(2)>=0
X(2)-X(1)^3-X(3)^2=0
X(1)^2-X(2)-X(4)^2=0
X(1)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(2)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(3)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000
X(4)=-1000, -999, -998,..., 0, 1, 2, 3,..., 998, 999, 1000

This problem is an adaptation of Problem 263 on page 87 of Schittkowski [1].

0 DEFDBL A-Z
3 DEFINT I,J,K
4 DIM X(42),A(42),L(33),K(33)
5 FOR JJJJ=-32000 TO 32000
14 RANDOMIZE JJJJ
16 M=-1D+17
91 FOR K=1 TO 4
93 A(K)=-1000+FIX(RND*2001)
99 NEXT K
126 IMAR=10+FIX(RND*1000)
128 FOR I=1 TO IMAR
129 FOR K=1 TO 4
131 X(K)=A(K)
132 NEXT K
1110 IJU=1+FIX(RND*4)
1111 X(IJU)=-1000+FIX(RND*2001)
1131 PEN1=X(2)-X(1)^3
1139 IF PEN1<0 THEN PEN1=PEN1 ELSE PEN1=0
1141 PEN2=X(1)^2-X(2)
1143 IF PEN2<0 THEN PEN2=PEN2 ELSE PEN2=0
1151 PEN3=X(2)-X(1)^3-X(3)^2
1159 IF PEN3=0 THEN PEN3=0 ELSE PEN3=PEN3
1161 PEN4=X(1)^2-X(2)-X(4)^2
1163 IF PEN4=0 THEN PEN4=0 ELSE PEN4=PEN4
1486 P=+X(1)-333333!*ABS(PEN1)-333333!*ABS(PEN2)-333333!*ABS(PEN3)-333333!*ABS(PEN4)
1499 PR=+X(1)
1551 IF P<=M THEN 1670
1657 FOR KEW=1 TO 4
1658 A(KEW)=X(KEW)
1659 NEXT KEW
1661 M=P
1663 MM=PR
1666 GOTO 128
1670 NEXT I
1890 IF M>-10 THEN 1912 ELSE 1999
1912 PRINT A(1),A(2),A(3),A(4),M,MM,JJJJ
1999 NEXT JJJJ

This BASIC computer program was run with the IBM basica/D interpreter, and the output produced during the first 10 minutes of running is presented below. (What immediately follows is a manual copy from the computer screen.)

1 1 0 0 1
1 -31490

1 1 0 0 1
1 -29023

-4 -48 4 -8 -4
-4 -28928

-3 9 6 0 -3
-3 -28695

-4 -48 4 -8 -4
-4 -28148

-4 -48 4 -8 -4
-4 -27189

-3 -27 0 6 -3
-3 -26966

-4 0 8 -4 -4
-4 -25278

-4 -48 4 -8 -4
-4 -24529

1 1 0 0 1
1 -23329

Interpreted in accordance with line 1912, the output above shows the best solution produced at JJJJ=-31490, JJJJ=-29023, and JJJJ=-23329 during the first 10 minutes of running on a personal computer with an Intel 2.66 GHz. chip and the IBM basica/D interpreter.

Reference

[1] K. Schittkowski (1987): "More test examples for nonlinear programming codes," Springer-Verlag, Berlin Heidelberg New York.