*--------------------------------------------------------- * Date created: February 25, 2001 * * Klaus Schittkowski * More Test Examples for Nonlinear Programming Codes. * Springer Verlag, Berlin, 1987. * Problem 329, pp.150 * * Dr. Neculai Andrei * Research Institute for Informatics, * 8-10, Averescu Avenue, Bucharest 1, Romania * E-mail: nandrei@u3.ici.ro * web: www.ici.ro/camo *--------------------------------------------------------- * 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 329, pp.150') * n=2 m=3 me=0 mb=2*n nszc=6 nsze=0 * * Initial point * x(1)=14.35d0 x(2)=8.6d0 * * 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)=1 icgc(5)=2 icgc(6)=3 * * Starting address of the columns of the Jacobian of the INEqualities. * ipgc(1)=1 ipgc(2)=4 ipgc(3)=7 * return end * *-------------------------------------------------------------- * Date created: February 25, 2001 * Schittkowski, prob. 329, pp.150 *-------------------------------------------------------------- * 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=(x(1)-10.d0)**3 + (x(2)-20.d0)**3 * gobj(1)=3.d0*(x(1)-10.d0)**2 gobj(2)=3.d0*(x(2)-20.d0)**2 * * Bounds on variables. * cb(1)=x(1)-13.d0 cb(2)=16.d0-x(1) cb(3)=x(2) cb(4)=15.d0-x(2) * * INEquality Constraints. * c(1)= (x(1)-5.d0)**2 + (x(2)-5.d0)**2 - 100.d0 c(2)=-(x(1)-6.d0)**2 - (x(2)-5.d0)**2 + 82.81d0 c(3)= (x(1)-6.d0)**2 + (x(2)-5.d0)**2 * Jacobian of the INEquality constraints. * gc(1)= 2.d0*(x(1)-5.d0) gc(2)=-2.d0*(x(1)-6.d0) gc(3)= 2.d0*(x(1)-6.d0) * gc(4)= 2.d0*(x(2)-5.d0) gc(5)=-2.d0*(x(2)-5.d0) gc(6)= 2.d0*(x(2)-5.d0) * return end *---------------------------------------------S329.for