*--------------------------------------------------------- * Date created: February 25, 2001 * * Klaus Schittkowski * More Test Examples for Nonlinear Programming Codes. * Springer Verlag, Berlin, 1987. * Problem 338, pp.159 * * 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 338, pp.159') * n=3 m=0 me=2 mb=6 nszc=0 nsze=6 * * Initial point * x(1)=0.d0 x(2)=0.d0 x(3)=0.d0 * * 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. * icge(1)=1 icge(2)=2 icge(3)=1 icge(4)=2 icge(5)=1 icge(6)=2 * * Starting address of the columns of the Jacobian of the Equalities. * ipge(1)=1 ipge(2)=3 ipge(3)=5 ipge(4)=7 * * Rows indices of the nonzeros of the Jacobian of the Equalities. * * * Starting address of the columns of the Jacobian of the Equalities. * * return end * *-------------------------------------------------------------- * Date created: February 25, 2001 * Schittkowski, prob. 338, pp.159 *-------------------------------------------------------------- * 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)**2 - x(2)**2 - x(3)**2 * gobj(1)=-2.d0*x(1) gobj(2)=-2.d0*x(2) gobj(3)=-2.d0*x(3) * * Bounds on variables. * j=1 do i=1,n cb(j)=x(i) + 1.d38 cb(j+1)=1.d38-x(i) j=j+2 end do * * INEquality Constraints. * * * Jacobian of the INEquality constraints. * * * Equality constraints * e(1)=0.5d0*x(1)+x(2)+x(3)-1.d0 e(2)=x(1)**2 + (2.d0/3.d0)*x(2)**2 + 0.25d0*x(3)**2 -4.d0 * * Jacobian of the Equality constraints * ge(1)=0.5d0 ge(2)=2.d0*x(1) ge(3)=1.d0 ge(4)=(4.d0/3.d0)*x(2) ge(5)=1.d0 ge(6)=0.5d0*x(3) * return end *---------------------------------------------S338.for