* Date created: October 10, 1996. * Bayreuth University, Mathematics Department * Problem 106 * Hock - Schittkowski Page 115. * * Heat exchanger design * * 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 * * During my stay in Bayreuth University, Mathematics Department *-------------------------------------------------------------- * 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,'Problem 106, Hock-Schittkowski pp.115') write(1,14) 14 format(5x,'') * * Dimension of the problem: * n=8 ! No. of variables. m=6 ! No. of inequality constraints. me=0 ! No. of equality constraints. mb=16 ! No. of simple bounds on variables. nszc=17 ! 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) = 5000.d0 x(2) = 5000.d0 x(3) = 5000.d0 x(4) = 200.d0 x(5) = 350.d0 x(6) = 150.d0 x(7) = 225.d0 x(8) = 425.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)=4 icgc(2)=5 icgc(3)=6 icgc(4)=1 icgc(5)=2 icgc(6)=4 icgc(7)=5 icgc(8)=2 icgc(9)=3 icgc(10)=5 icgc(11)=6 icgc(12)=1 icgc(13)=4 icgc(14)=2 icgc(15)=5 icgc(16)=3 icgc(17)=6 * * Starting address of columns of the Jacobian of the Inequalities * ipgc(1)=1 ipgc(2)=2 ipgc(3)=3 ipgc(4)=4 ipgc(5)=8 ipgc(6)=12 ipgc(7)=14 ipgc(8)=16 ipgc(9)=18 * * 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 * Problem 106. * Hock - Schittkowski, pp.115. *-------------------------------------------------------------- * 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) + x(2) + x(3) gobj(1)= 1.d0 gobj(2)= 1.d0 gobj(3)= 1.d0 gobj(4)= 0.d0 gobj(5)= 0.d0 gobj(6)= 0.d0 gobj(7)= 0.d0 gobj(8)= 0.d0 * * Bounds on variables: * cb(1) = x(1) - 100.d0 cb(2) = 10000.d0 - x(1) cb(3) = x(2) - 1000.d0 cb(4) = 10000.d0 - x(2) cb(5) = x(3) - 1000.d0 cb(6) = 10000.d0 - x(3) j=7 do i=4,n cb(j)=x(i)-10.d0 cb(j+1)=1000.d0-x(i) j=j+2 end do * * Constraints. (Inequalities): * c(1)= 1.d0 - 0.0025d0*(x(4)+x(6)) c(2)= 1.d0 - 0.0025d0*(x(5)+x(7)-x(4)) c(3)= 1.d0 - 0.01d0*(x(8)-x(5)) c(4)= x(1)*x(6) - 833.33252d0*x(4) - 100.d0*x(1) + 83333.333d0 c(5)= x(2)*x(7) - 1250.d0*x(5) - x(2)*x(4) + 1250.d0*x(4) c(6)= x(3)*x(8) - x(3)*x(5) + 2500.d0*x(5) - 1250000.d0 * * Jacobian of the inequalities constraints: * gc(1)= x(6)-100.d0 gc(2)= x(7)-x(4) gc(3)= x(8)-x(5) gc(4)= -0.0025d0 gc(5)= 0.0025d0 gc(6)= -833.33252d0 gc(7)= -x(2)+1250.d0 gc(8)= -0.0025d0 gc(9)= 0.01d0 gc(10)= -1250.d0 gc(11)= -x(3)+2500.d0 gc(12)= -0.0025d0 gc(13)= x(1) gc(14)= -0.0025d0 gc(15)= x(2) gc(16)= -0.01d0 gc(17)= x(3) * * Constraints. (Equalities): * * * Jacobian of the equalities constraints: * * return end *-------------------------------------------------HS106.for