*--------------------------------------------------------- * Date created: December 23, 1997. * * Hock & Schittkowski, * Test Examples for Nonlinear Programming Codes. * Springer-Verlag, 1981. * Problem 83, page 102 * * 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 83, pp.102') * n=5 m=6 me=0 mb=2*n nszc=26 nsze=0 * * Initial Point * x(1)=78.001d0 x(2)=33.001d0 x(3)=27.001d0 x(4)=27.001d0 x(5)=27.001d0 * * 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)=3 icgc(4)=4 icgc(5)=5 icgc(6)=6 icgc(7)=1 icgc(8)=2 icgc(9)=3 icgc(10)=4 icgc(11)=1 icgc(12)=2 icgc(13)=3 icgc(14)=4 icgc(15)=5 icgc(16)=6 icgc(17)=1 icgc(18)=2 icgc(19)=5 icgc(20)=6 icgc(21)=1 icgc(22)=2 icgc(23)=3 icgc(24)=4 icgc(25)=5 icgc(26)=6 * * Starting address of the columns of the Jacobian of the INEqualities. * ipgc(1)=1 ipgc(2)=7 ipgc(3)=11 ipgc(4)=17 ipgc(5)=21 ipgc(6)=27 * return end * *-------------------------------------------------------------- * Date created: December 23, 1997 * Schittkowski, prob. 83, pp.102 *-------------------------------------------------------------- * 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) real*8 a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12 * * Objective function, and its gradient. * objf= 5.3578547d0*x(3)*x(3) + 0.8356891d0*x(1)*x(5) + 1 37.293239d0*x(1) - 40792.141d0 * gobj(1)=37.293239d0 + 0.8356891d0*x(5) gobj(2)=0.d0 gobj(3)=2.d0*5.3578547d0*x(3) gobj(4)=0.d0 gobj(5)=0.8356891d0*x(1) * * Bounds on variables. * cb(1)=x(1)-78.d0 cb(2)=102.d0-x(1) cb(3)=x(2)-33.d0 cb(4)=45.d0-x(2) cb(5)=x(3)-27.d0 cb(6)=45.d0-x(3) cb(7)=x(4)-27.d0 cb(8)=45.d0-x(4) cb(9)=x(5)-27.d0 cb(10)=45.d0-x(5) * * * Equality Constraints. * * * Jacobian of the equality constraints. * * * INEquality Constraints. * a1=85.334407d0 a2=0.0056858d0 a3=0.0006262d0 a4=0.0022053d0 a5=80.51249d0 a6=0.0071317d0 a7=0.0029955d0 a8=0.0021813d0 a9=9.300961d0 a10=0.0047026d0 a11=0.0012547d0 a12=0.0019085d0 * c(1)=a1 + a2*x(2)*x(5) + a3*x(1)*x(4) - a4*x(3)*x(5) c(2)=92.d0 - c(1) c(3)=a5 +a6*x(2)*x(5) + a7*x(1)*x(2) + a8*x(3)*x(3) -90.d0 c(4)=20.d0 - c(3) c(5)=a9 + a10*x(3)*x(5)+a11*x(1)*x(3)+a12*x(3)*x(4)-20.d0 c(6)=5.d0 - c(5) * * Jacobian of the INEquality constraints. c1 gc(1)=a3*x(4) gc(2)=-a3*x(4) gc(3)=a7*x(2) gc(4)=-a7*x(2) gc(5)=a11*x(3) gc(6)=-a11*x(3) c2 gc(7)=a2*x(5) gc(8)=-a2*x(5) gc(9)=a6*x(5)+a7*x(1) gc(10)=-(a6*x(5)+a7*x(1)) c3 gc(11)=-a4*x(5) gc(12)=a4*x(5) gc(13)=2.d0*a8*x(3) gc(14)=-2.d0*a8*x(3) gc(15)=a10*x(5)+a11*x(1)+a12*x(4) gc(16)=-(a10*x(5)+a11*x(1)+a12*x(4)) c4 gc(17)=a3*x(1) gc(18)=-a3*x(1) gc(19)=a12*x(3) gc(20)=-a12*x(3) c5 gc(21)=a2*x(2)-a4*x(3) gc(22)=-(a2*x(2)-a4*x(3)) gc(23)=a6*x(2) gc(24)=-a6*x(2) gc(25)=a10*x(3) gc(26)=-a10*x(3) * return end *-----------------------------------------------HS83.for