*------------------------------------------------------------- * Date created: October 10, 1996. * Generated in: Bayreuth University, Mathematics Department * Prof. Klaus Schittkowski \ * * Hock & Schittkowski, * Test Examples for Nonlinear Programming. * Springer-Verlag, 1981. * Problem No. 100. Page 111. * * 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, page 111') write(1,14) 14 format(5x,'Problem 100') * * Dimension of the problem: * n=7 ! No. of variables. m=4 ! No. of inequality constraints. me=0 ! No. of equality constraints. mb=0 ! No. of simple bounds on variables. nszc=19 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=0 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * x(1) = 1.d0 x(2) = 2.d0 x(3) = 0.d0 x(4) = 4.d0 x(5) = 0.d0 x(6) = 1.d0 x(7) = 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 Inequalities * icgc(1)=1 icgc(2)=2 icgc(3)=3 icgc(4)=4 icgc(5)=1 icgc(6)=2 icgc(7)=3 icgc(8)=4 icgc(9)=1 icgc(10)=2 icgc(11)=4 icgc(12)=1 icgc(13)=2 icgc(14)=1 icgc(15)=2 icgc(16)=3 icgc(17)=4 icgc(18)=3 icgc(19)=4 * * Starting address of columns of the Jacobian of the Inequalities * ipgc(1)=1 ipgc(2)=5 ipgc(3)=9 ipgc(4)=12 ipgc(5)=14 ipgc(6)=16 ipgc(7)=18 ipgc(8)=20 * * Rows indices of the nonzeros of the Jacobian of the Equalities * * * Starting address of columns of the Jacobian of the Equalities * * * return end * *-------------------------------------------------------------- * Date created: October 10, 1996 * Date modified: October 25, 1996 * * Problem 100. * Hock - Schittkowski, pp.111. *-------------------------------------------------------------- * 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 = (x(1)-10.d0)**2 + 5.d0*(x(2)-12.d0)**2 + x(3)**4 + 1 3.d0*(x(4)-11.d0)**2 + 10.d0*x(5)**6 + 7.d0*x(6)**2 + 1 x(7)**4 - 4.d0*x(6)*x(7) - 10.d0*x(6) - 8.d0*x(7) gobj(1)= 2.d0*(x(1)-10.d0) gobj(2)= 10.d0*(x(2)-12.d0) gobj(3)= 4.d0*x(3)**3 gobj(4)= 6.d0*(x(4)-11.d0) gobj(5)= 60.d0*x(5)**5 gobj(6)= 14.d0*x(6) - 4.d0*x(7) - 10.d0 gobj(7)= 4.d0*x(7)**3 - 4.d0*x(6) - 8.d0 * * Bounds on variables: * * j=1 * do i=1,n * cb(j)=x(i) * cb(j+1)=10.d0-x(i) * j=j+2 * end do * * Constraints. (Inequalities): * c(1)= 127.d0 - 2.d0*x(1)**2 - 3.d0*x(2)**4 - x(3) - 1 4.d0*x(4)**2 - 5.d0*x(5) c(2)= 282.d0 - 7.d0*x(1) - 3.d0*x(2) - 10.d0*x(3)**2 - 1 x(4) + x(5) c(3)=196.d0 - 23.d0*x(1) - x(2)**2 - 6.d0*x(6)**2 + 1 8.d0*x(7) c(4)=-4.d0*x(1)**2 - x(2)**2 + 3.d0*x(1)*x(2) - 2.d0*x(3)**2 - 1 5.d0*x(6) + 11.d0*x(7) * * Jacobian of the inequalities constraints: * gc(1)= -4.d0*x(1) gc(2)= -7.d0 gc(3)= -23.d0 gc(4)= -8.d0*x(1) + 3.d0*x(2) gc(5)= -12.d0*x(2)**3 gc(6)= -3.d0 gc(7)= -2.d0*x(2) gc(8)= -2.d0*x(2) + 3.d0*x(1) gc(9)= -1.d0 gc(10)= -20.d0*x(3) gc(11)= -4.d0*x(3) gc(12)= -8.d0*x(4) gc(13)= -1.d0 gc(14)= -5.d0 gc(15)= 1.d0 gc(16)= -12.d0*x(6) gc(17)= -5.d0 gc(18)= 8.d0 gc(19)= 11.d0 * * Constraints. (Equalities): * * * Jacobian of the equalities constraints: * * return end *------------------------------------------HS100.for