* Date created: October 10, 1996. * Generated during my stay in: * Bayreuth University, Mathematics Department, * Prof. Klaus Schittkowski * * Hock & Schittkowski, * Test Examples for Nonlinear Programming Codes. * Springer-Verlag, 1981. * Problem 81, Page 101. * * 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) * * Information about the problem. * write(1,10) 10 format(5x,'Example of nonlinear programming.') write(1,11) 11 format(5x,'Hock-Schittkowski pp.101') write(1,14) 14 format(5x,'Problem 81') * * Dimension of the problem: * n=5 ! No. of variables. m=0 ! No. of inequality constraints. me=3 ! No. of equality constraints. mb=10 ! No. of simple bounds on variables. nszc=0 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=11 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * x(1) = -2.d0 x(2) = 2.d0 x(3) = 2.d0 x(4) = -1.d0 x(5) = -1.d0 * * Index vector for simple bounds: cb >= 0. * 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)=3 icge(3)=1 icge(4)=2 icge(5)=3 icge(6)=1 icge(7)=2 icge(8)=1 icge(9)=2 icge(10)=1 icge(11)=2 * * Starting address of columns of the Jacobian of the equalities * ipge(1)=1 ipge(2)=3 ipge(3)=6 ipge(4)=8 ipge(5)=10 ipge(6)=12 * * Rows indices of the nonzeros of the Jacobian of the INEqualities * * * Starting address of columns of the Jacobian of the INEqualities * * * return end * *-------------------------------------------------------------- * Date created: October 10, 1996 * * Problem 81. * Hock - Schittkowski, pp.101. *-------------------------------------------------------------- * subroutine prob(n,m,mb,me,sb,x,objf,gobj,c,gc,cb,e,ge, 1 nszc,nsze,nb) * * Calculate problem function at iterate x. * double precision x(n),objf,gobj(n),c(m),gc(nszc) double precision cb(mb),e(me),ge(nsze) * * * Objective function and its gradient: * objf = dexp(x(1)*x(2)*x(3)*x(4)*x(5)) - 1 0.5d0*(x(1)**3 + x(2)**3 + 1.d0)**2 gobj(1)= x(2)*x(3)*x(4)*x(5)*objf - 1 3.d0*(x(1)**3+x(2)**3+1.d0)*x(1)*x(1) gobj(2)= x(1)*x(3)*x(4)*x(5)*objf - 1 3.d0*(x(1)**3+x(2)**3+1.d0)*x(2)*x(2) gobj(3)= x(1)*x(2)*x(4)*x(5)*objf gobj(4)= x(1)*x(2)*x(3)*x(5)*objf gobj(5)= x(1)*x(2)*x(3)*x(4)*objf * * Bounds on variables: * cb(1)=x(1)+2.3d0 cb(2)=2.3d0-x(1) cb(3)=x(2)+2.3d0 cb(4)=2.3d0-x(2) j=5 do i=1,n cb(j)=x(i)+ 3.2d0 cb(j+1)=3.2d0-x(i) j=j+2 end do * * Constraints. (Inequalities): * * * Jacobian of the inequalities constraints: * * * Constraints. (Equalities): * e(1) = x(1)**2+x(2)**2+x(3)**2+x(4)**2+x(5)**2 - 10.d0 e(2) = x(2)*x(3) - 5.d0*x(4)*x(5) e(3) = x(1)**3 + x(2)**3 +1.d0 * * Jacobian of the equalities constraints: * ge(1)=2.d0*x(1) ge(2)=3.d0*x(1)*x(1) ge(3)=2.d0*x(2) ge(4)=x(3) ge(5)=3.d0*x(2)*x(2) ge(6)=2.d0*x(3) ge(7)=x(2) ge(8)=2.d0*x(4) ge(9)=-5.d0*x(5) ge(10)=2.d0*x(5) ge(11)=-5.d0*x(4) * return end *---------------------------------------------HS81.for