*------------------------------------------------------------ * March 8, 2000 * Blending/Pooling/Separation Problem * * Floudas & Pardalos, * A collection of test problems for constrained global * optimization algorithms. * Springer-Verlag, Berlin, 1990 * * Problem 5.4.1, pp.47-49 * * 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) * * Information about the problem. * write(1,10) 10 format(5x,'Example of nonlinear programming.') write(1,11) 11 format(5x,'Blending/Pooling/Separation Problem') write(1,14) 14 format(5x,'Floudas & Pardalos, Problem 5-4, pp.47-49') write(1,15) 15 format(5x,'March 8, 2001') * * Dimension of the problem: * n=32 ! No. of variables. m=0 ! No. of inequality constraints. me=26 ! No. of equality constraints. mb=2*n ! No. of simple bounds on variables. nszc=0 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=n*me ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * do i=1,n x(i)=1.d0 end do * * 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 * k=1 do i=1,n do j=1,me icge(k)=j k=k+1 end do end do * * Starting address of columns of the Jacobian of the Equalities * ipge(1)=1 do i=2,n+1 ipge(i)=me*(i-1)+1 end do * return end *-------------------------------------------------------------- * March 8, 2000 * Blending/Pooling/Separation Problem * Floudas & Pardalos, Problem 5-4, pp.47-49 *-------------------------------------------------------------- * 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) * real*8 gjac(26,32) * * * Objective function and its gradient: * objf=0.9979d0 + 0.00432d0*x(5) + 0.01517d0*x(13) * do i=1,n gobj(i)=0.d0 end do * gobj(5)=0.00432d0 gobj(13)=0.01517d0 * * Bounds on variables: * j=1 do i=1,n cb(j)=x(i) cb(j+1)=10000.d0-x(i) j=j+2 end do * * Constraints. (Equalities): * e(1)=x(1)+x(2)+x(3)+x(4)-300.d0 e(2)=x(6)-x(7)-x(8) e(3)=x(9)-x(10)-x(11)-x(12) e(4)=x(14)-x(15)-x(16)-x(17) e(5)=x(18)-x(19)-x(20) * e(6)=x(5)*x(21)-x(6)*x(22) e(7)=x(5)*x(25)-x(9)*x(26) e(8)=x(5)*x(29)-x(9)*x(30) e(9)=x(13)*x(23)-x(14)*x(24) e(10)=x(13)*x(27)-x(14)*x(28) e(11)=x(13)*x(31)-x(18)*x(32) * e(12)=0.333d0*x(1)+x(15)*x(24)-x(5)*x(21) e(13)=0.333d0*x(1)+x(15)*x(28)-x(5)*x(25) e(14)=0.333d0*x(1)-x(5)*x(29) e(15)=0.333d0*x(2)-x(13)*x(23) e(16)=0.333d0*x(2)+x(10)*x(26)-x(13)*x(27) e(17)=0.333d0*x(2)+x(10)*x(30)-x(13)*x(31) * e(18)=0.333d0*x(3)+x(7)*x(22)+x(16)*x(24)-30.d0 e(19)=0.333d0*x(3)+x(11)*x(26)+x(16)*x(28)-50.d0 e(20)=0.333d0*x(3)+x(11)*x(30)+x(19)*x(32)-30.d0 * e(21)=x(21)+x(25)+x(29)-1.d0 e(22)=x(22)-1.d0 e(23)=x(26)+x(30)-1.d0 e(24)=x(23)+x(27)+x(31)-1.d0 e(25)=x(24)+x(28)-1.d0 e(26)=x(32)-1.d0 * * * Jacobian of inequalities constraints * do i=1,me do j=1,n gjac(i,j)=0.d0 end do end do * *e1 gjac(1,1)=1.d0 gjac(1,2)=1.d0 gjac(1,3)=1.d0 gjac(1,4)=1.d0 *e2 gjac(2,6)=1.d0 gjac(2,7)=-1.d0 gjac(2,8)=-1.d0 *e3 gjac(3,9)=1.d0 gjac(3,10)=-1.d0 gjac(3,11)=-1.d0 gjac(3,12)=-1.d0 *e4 gjac(4,14)=1.d0 gjac(4,15)=-1.d0 gjac(4,16)=-1.d0 gjac(4,17)=-1.d0 *e5 gjac(5,18)=1.d0 gjac(5,19)=-1.d0 gjac(5,20)=-1.d0 *e6 gjac(6,5)=x(21) gjac(6,21)=x(5) gjac(6,6)=-x(22) gjac(6,22)=-x(6) *e7 gjac(7,5)=x(25) gjac(7,25)=x(5) gjac(7,9)=-x(26) gjac(7,26)=-x(9) *e8 gjac(8,5)=x(29) gjac(8,29)=x(5) gjac(8,9)=-x(30) gjac(8,30)=-x(9) *e9 gjac(9,13)=x(23) gjac(9,23)=x(13) gjac(9,14)=-x(24) gjac(9,24)=-x(14) *e10 gjac(10,13)=x(27) gjac(10,27)=x(13) gjac(10,14)=-x(28) gjac(10,28)=-x(14) *e11 gjac(11,13)=x(31) gjac(11,31)=x(13) gjac(11,18)=-x(32) gjac(11,32)=-x(18) *e12 gjac(12,1)=0.333d0 gjac(12,15)=x(24) gjac(12,24)=x(15) gjac(12,5)=-x(21) gjac(12,21)=-x(5) *e13 gjac(13,1)=0.333d0 gjac(13,15)=x(28) gjac(13,28)=x(15) gjac(13,5)=-x(25) gjac(13,25)=-x(5) *e14 gjac(14,1)=0.333d0 gjac(14,5)=-x(29) gjac(14,29)=-x(5) *e15 gjac(15,2)=0.333d0 gjac(15,13)=-x(23) gjac(15,23)=-x(13) *e16 gjac(16,2)=0.333d0 gjac(16,10)=x(26) gjac(16,26)=x(10) gjac(16,13)=-x(27) gjac(16,27)=-x(13) *e17 gjac(17,2)=0.333d0 gjac(17,10)=x(30) gjac(17,30)=x(10) gjac(17,13)=-x(31) gjac(17,31)=-x(13) *e18 gjac(18,3)=0.333d0 gjac(18,7)=x(22) gjac(18,22)=x(7) gjac(18,16)=x(24) gjac(18,24)=x(16) *e19 gjac(19,3)=0.333d0 gjac(19,11)=x(26) gjac(19,26)=x(11) gjac(19,16)=x(28) gjac(19,28)=x(16) *e20 gjac(20,3)=0.333d0 gjac(20,11)=x(30) gjac(20,30)=x(11) gjac(20,19)=x(32) gjac(20,32)=x(19) *e21 gjac(21,21)=1.d0 gjac(21,25)=1.d0 gjac(21,29)=1.d0 *e22 gjac(22,22)=1.d0 *e23 gjac(23,26)=1.d0 gjac(23,30)=1.d0 *e24 gjac(24,23)=1.d0 gjac(24,27)=1.d0 gjac(24,31)=1.d0 *e25 gjac(25,24)=1.d0 gjac(25,28)=1.d0 *e26 gjac(26,32)=1.d0 * do j=1,n do i=1,me k=(j-1)*me+i ge(k)=gjac(i,j) end do end do * * Constraints. (Equalities): * * Jacobian of the equalities constraints: * return end *---------------------------------------------------- FP5-4.for