*--------------------------------------------------------- * Date created: February 25, 2001 * * Klaus Schittkowski * More Test Examples for Nonlinear Programming Codes. * Springer Verlag, Berlin, 1987. * Problem 230, pp.54 * * 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 230, pp.54') * n=2 m=2 me=0 mb=4 nszc=4 nsze=0 * * Initial point * x(1)=0.d0 x(2)=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 INEqualities. * icgc(1)=1 icgc(2)=2 icgc(3)=1 icgc(4)=2 * * Starting address of the columns of the Jacobian of the INEqualities. * ipgc(1)=1 ipgc(2)=3 ipgc(3)=5 * * 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. 230, pp.54 *-------------------------------------------------------------- * 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(2) * gobj(1)=0.d0 gobj(2)=1.d0 * * 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. * c(1)=-2.d0*x(1)**2 + x(1)**3 + x(2) c(2)=-2.d0*(1.d0-x(1))**2 + (1.d0-x(1))**3 + x(2) * * Jacobian of the INEquality constraints. * gc(1)=-4.d0*x(1)+3.d0*x(1)*x(1) gc(2)=4.d0*(1.d0-x(1)) - 3.d0*(1.d0-x(1))**2 gc(3)=1.d0 gc(4)=1.d0 * * Equality constraints * * * Jacobian of the Equality constraints * * return end *---------------------------------------------S230.for