*--------------------------------------------------------- * Date created: December 22, 1997 * * Hock & Schittkowski, * Test Examples for Nonlinear Programming Codes. * Springer-Verlag, 1981. * Problem 97, pp,109 * * Dr. Neculai Andrei, * Research Institute for Informatics - Bucharest * 8-10, Averescu Avenue, * 71316 Bucharest - Romania * E-mail: nandrei@u3.ici.ro * web: http://www.ici.ro/camo/neculai/nandrei.htm *--------------------------------------------------------- * subroutine ini(n,m,mb,me,sb,x,icgc,ipgc,icge,ipge, 1 nszc,nsze,nb) * double precision x(n) integer sb(mb) integer icgc(nszc),ipgc(n+1) integer icge(nsze),ipge(n+1) * write(1,10) 10 format(5x,'Example of a Nonlinear Programming Problem.') write(1,11) 11 format(5x,'Schittkowski, prob 97, pp.109') * n=6 m=4 me=0 mb=2*n nszc=20 nsze=0 * * Initial Point * do i=1,n x(i)=0.0001d0 end do * * Index vector for simple bounds: * j=1 do i=1,n sb(j)=i sb(j+1)=-i j=j+2 end do * * Rows indices of the nonzeros of the Jacobian of the Equalities. * * * Starting address of the columns of the Jacobian of the Equalities. * * * Rows indices of the nonzeros of the Jacobian of the INEqualities. * icgc(1)=1 icgc(2)=2 icgc(3)=4 icgc(4)=1 icgc(5)=2 icgc(6)=3 icgc(7)=4 icgc(8)=1 icgc(9)=2 icgc(10)=1 icgc(11)=2 icgc(12)=3 icgc(13)=4 icgc(14)=1 icgc(15)=2 icgc(16)=3 icgc(17)=4 icgc(18)=1 icgc(19)=2 icgc(20)=4 * * Starting address of the columns of the Jacobian of the INEqualities. * ipgc(1)=1 ipgc(2)=4 ipgc(3)=8 ipgc(4)=10 ipgc(5)=14 ipgc(6)=18 ipgc(7)=21 * return end * *---------------------------------------------------- * Date created: December 22, 1997 * Hock & Schittkowski, Prob. 97, pp.109 *-------------------------------------------------------------- * subroutine prob(n,m,mb,me,sb,x,objf,gobj,c,gc,cb,e,ge, 1 nszc,nsze,nb) * * Calculate problem functions at iterate x. * double precision x(n),objf,gobj(n),c(m),gc(nszc), * cb(mb),e(me),ge(nsze) * * Objective function, and its gradient. * objf= 4.3d0*x(1) + 31.8d0*x(2) + 63.3d0*x(3) + 1 15.8d0*x(4) + 68.5d0*x(5) + 4.7d0*x(6) * gobj(1)=4.3d0 gobj(2)=31.8d0 gobj(3)= 63.3d0 gobj(4)=15.8d0 gobj(5)=68.5d0 gobj(6)=4.7d0 * * Bounds on variables. * cb(1)=x(1) cb(2)=0.31d0-x(1) cb(3)=x(2) cb(4)=0.046d0-x(2) cb(5)=x(3) cb(6)=0.068d0-x(3) cb(7)=x(4) cb(8)=0.042d0-x(4) cb(9)=x(5) cb(10)=0.028d0-x(5) cb(11)=x(6) cb(12)=0.0134d0-x(6) * * * Equality Constraints. * * * Jacobian of the equality constraints. * * * INEquality Constraints. * * Data for problem 97. Schittkowski, pp.109 * b1=32.97d0 b2=25.12d0 b3=-29.08d0 b4=-78.02d0 * c(1)= 17.1d0*x(1) + 38.2d0*x(2) + 204.2d0*x(3) + 1 212.3d0*x(4) + 623.4d0*x(5) + 1495.5d0*x(6) - 1 169.d0*x(1)*x(3) - 3580.d0*x(3)*x(5) - 1 3810.d0*x(4)*x(5) - 18500*x(4)*x(6) - 1 24300.d0*x(5)*x(6) - b1 c(2)= 17.9d0*x(1) + 36.8d0*x(2) + 113.9d0*x(3) + 1 169.7d0*x(4) + 337.8d0*x(5) + 1385.2d0*x(6) - 1 139.d0*x(1)*x(3) - 2450.d0*x(4)*x(5) - 1 16600.d0*x(4)*x(6) - 17200.d0*x(5)*x(6) - b2 c(3)= -273.d0*x(2) - 70.d0*x(4) - 819.d0*x(5) + 1 26000.d0*x(4)*x(5) - b3 c(4)= 159.9d0*x(1) - 311.d0*x(2) + 587.d0*x(4) + 1 391.d0*x(5) + 2198.d0*x(6) - 1 14000.d0*x(1)*x(6) - b4 * * Jacobian of the INEquality constraints. c1 gc(1)=17.1d0 - 169.d0*x(3) gc(2)=17.9d0 - 139.d0*x(3) gc(3)=159.9d0 - 14000.d0*x(6) c2 gc(4)=38.2d0 gc(5)=36.8d0 gc(6)=-273.d0 gc(7)=-311.d0 c3 gc(8)=204.2d0 - 169.d0*x(1) - 3580.d0*x(5) gc(9)=113.9d0 - 139.d0*x(1) c4 gc(10)=212.3d0 - 3810.d0*x(5) - 18500.d0*x(6) gc(11)=169.7d0 - 2450.d0*x(5) - 16600.d0*x(6) gc(12)=-70.d0 + 26000.d0*x(5) gc(13)=587.d0 c5 gc(14)=623.4d0 - 3580.d0*x(3) - 3810.d0*x(4) - 24300.d0*x(6) gc(15)=337.8d0 - 2450.d0*x(4) - 17200.d0*x(6) gc(16)=-819.d0 + 26000*x(4) gc(17)=391.d0 c6 gc(18)=1495.5d0 - 18500*x(4) - 24300*x(5) gc(19)=1385.2d0 - 16600.d0*x(4) - 17200.d0*x(5) gc(20)=2198.d0-14000.d0*x(1) * return end *--------------------------------------------------------HS97.for