*------------------------------------------------------------ * March 8, 2000 * Propane, Isobutane, n-Butane Nonsharp separation * * Floudas & Pardalos, * A collection of test problems for constrained global * optimization algorithms. * Springer-Verlag, Berlin, 1990 * * Problem 5.2.1, pp.37-39. * * 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,'Propane, Isobutane, n-Butane Nonsharp separation') write(1,14) 14 format(5x,'Floudas & Pardalos, Problem 5.2, pp.37-40.') write(1,15) 15 format(5x,'March 8, 2001') * * Dimension of the problem: * n=48 ! No. of variables. m=0 ! No. of inequality constraints. me=38 ! 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)=0.9d0 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 * * * Starting address of columns of the Jacobian of the Equalities * * * Rows indices of the nonzeros of the Jacobian of the INEqualities * 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 INEqualities * ipge(1)=1 do i=2,n+1 ipge(i)=me*(i-1)+1 end do * return end *-------------------------------------------------------------- * March 8, 2000 * Propane, Isobutane, n-Butane Nonsharp separation * Floudas & Pardalos, Problem 5.2, pp.37-40. *-------------------------------------------------------------- * 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 a01,a11,a21,a31,ba1,bb1 real*8 a02,a12,a22,a32,ba2,bb2 * real*8 gjac(38,48) * a01=0.23947d0 a11=-0.0139904d0 a21=0.0093514d0 a31=0.0077308d0 ba1=-0.0005719d0 bb1=0.0042656d0 a02=0.75835d0 a12=-0.0661588d0 a22=0.0338147d0 a32=0.0373349d0 ba2=0.0016371d0 bb2=0.0288996d0 * * Objective function and its gradient: * objf=a01 + (a11+a21*x(1)+a31*x(3)+ba1*x(5)+bb1*x(11))*x(27) + * a02 + (a12+a22*x(2)+a32*x(4)+ba2*x(8)+bb2*x(14))*x(35) * do i=1,n gobj(i)=0.d0 end do gobj(1)=a21*x(27) gobj(2)=a22*x(35) gobj(3)=a31*x(27) gobj(4)=a32*x(35) gobj(5)=ba1*x(27) gobj(8)=ba2*x(35) gobj(11)=bb1*x(27) gobj(14)=bb2*x(35) gobj(27)=a11+a21*x(1)+a31*x(3)+ba1*x(5)+bb1*x(11) gobj(35)=a12+a22*x(2)+a32*x(4)+ba2*x(8)+bb2*x(14) * * Bounds on variables: * cb(1)=x(1)-0.85d0 cb(2)=1.d0-x(1) cb(3)=x(2)-0.85d0 cb(4)=1.d0-x(2) cb(5)=x(3)-0.85d0 cb(6)=1.d0-x(3) cb(7)=x(4)-0.85d0 cb(8)=1.d0-x(4) * j=9 do i=5,n cb(j)=x(i) cb(j+1)=10000.d0-x(i) j=j+2 end do * * Constraints. (Equalities): * e(1)=x(23)+x(24)+x(25)+x(26) - 300.d0 e(2)=x(28)-x(29)-x(30) e(3)=x(31)-x(32)-x(33)-x(34) e(4)=x(36)-x(37)-x(38)-x(39) e(5)=x(40)-x(41)-x(42) e(6)=x(28)*x(6)-x(1)*x(43) e(7)=x(36)*x(15)-x(2)*x(45) e(8)=x(31)*x(13)-x(3)*x(46) e(9)=x(40)*x(22)-x(4)*x(47) e(10)=x(43)-x(27)*x(5) e(11)=x(46)-x(27)*x(11) e(12)=x(48)-x(27)*x(17) e(13)=x(44)-x(35)*x(8) e(14)=x(45)-x(35)*x(14) e(15)=x(47)-x(35)*x(20) e(16)=x(43)-x(28)*x(6)-x(31)*x(7) e(17)=x(46)-x(28)*x(12)-x(31)*x(13) e(18)=x(48)-x(28)*x(18)-x(31)*x(19) e(19)=x(44)-x(36)*x(9)-x(40)*x(10) e(20)=x(45)-x(36)*x(15)-x(40)*x(16) e(21)=x(47)-x(36)*x(21)-x(40)*x(22) e(22)=0.333d0*x(23)+x(37)*x(9)-x(43) e(23)=0.333d0*x(23)+x(37)*x(15)-x(46) e(24)=0.333d0*x(23)+x(37)*x(21)-x(48) e(25)=0.333d0*x(24)+x(32)*x(7)-x(44) e(26)=0.333d0*x(24)+x(32)*x(13)-x(45) e(27)=0.333d0*x(24)+x(32)*x(19)-x(47) e(28)=x(18) e(29)=x(10) e(30)=0.333d0*x(25)+x(29)*x(6)+x(33)*x(7)+x(38)*x(9)+ * x(41)*x(10)-30.d0 e(31)=0.333d0*x(25)+x(29)*x(12)+x(33)*x(13)+x(38)*x(15)+ * x(41)*x(16)-50.d0 e(32)=0.333d0*x(25)+x(29)*x(18)+x(33)*x(19)+x(38)*x(21)+ * x(41)*x(22)-30.d0 e(33)=x(5)+x(11)+x(17)-1.d0 e(34)=x(6)+x(12)+x(18)-1.d0 e(35)=x(7)+x(13)+x(19)-1.d0 e(36)=x(8)+x(14)+x(20)-1.d0 e(37)=x(9)+x(15)+x(21)-1.d0 e(38)=x(10)+x(16)+x(22)-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,23)=1.d0 gjac(1,24)=1.d0 gjac(1,25)=1.d0 gjac(1,26)=1.d0 *e2 gjac(2,28)=1.d0 gjac(2,29)=-1.d0 gjac(2,30)=-1.d0 *e3 gjac(3,31)=1.d0 gjac(3,32)=-1.d0 gjac(3,33)=-1.d0 gjac(3,34)=-1.d0 *e4 gjac(4,36)=1.d0 gjac(4,37)=-1.d0 gjac(4,38)=-1.d0 gjac(4,39)=-1.d0 *e5 gjac(5,40)=1.d0 gjac(5,41)=-1.d0 gjac(5,42)=-1.d0 *e6 gjac(6,6)=x(28) gjac(6,28)=x(6) gjac(6,1)=-x(43) gjac(6,43)=-x(1) *e7 gjac(7,36)=x(15) gjac(7,15)=x(36) gjac(7,2)=-x(45) gjac(7,45)=-x(2) *e8 gjac(8,31)=x(13) gjac(8,13)=x(31) gjac(8,3)=-x(46) gjac(8,46)=-x(3) *e9 gjac(9,40)=x(22) gjac(9,22)=x(40) gjac(9,4)=-x(47) gjac(9,47)=-x(4) *e10 gjac(10,43)=1.d0 gjac(10,27)=-x(5) gjac(10,5)=-x(27) *e11 gjac(11,46)=1.d0 gjac(11,27)=-x(11) gjac(11,11)=-x(27) *e12 gjac(12,48)=1.d0 gjac(12,27)=-x(17) gjac(12,17)=-x(27) *e13 gjac(13,44)=1.d0 gjac(13,35)=-x(8) gjac(13,8)=-x(35) *e14 gjac(14,45)=1.d0 gjac(14,35)=-x(14) gjac(14,14)=-x(35) *e15 gjac(15,47)=1.d0 gjac(15,35)=-x(20) gjac(15,20)=-x(35) *e16 gjac(16,43)=1.d0 gjac(16,28)=-x(6) gjac(16,6)=-x(28) gjac(16,31)=-x(7) gjac(16,7)=-x(31) *e17 gjac(17,46)=1.d0 gjac(17,28)=-x(12) gjac(17,12)=-x(28) gjac(17,31)=-x(13) gjac(17,13)=-x(31) *e18 gjac(18,48)=1.d0 gjac(18,28)=-x(18) gjac(18,18)=-x(28) gjac(18,31)=-x(19) gjac(18,19)=-x(31) *e19 gjac(19,44)=1.d0 gjac(19,36)=-x(9) gjac(19,9)=-x(36) gjac(19,40)=-x(10) gjac(19,10)=-x(40) *e20 gjac(20,45)=1.d0 gjac(20,36)=-x(15) gjac(20,15)=-x(36) gjac(20,40)=-x(16) gjac(20,16)=-x(40) *e21 gjac(21,47)=1.d0 gjac(21,36)=-x(21) gjac(21,21)=-x(36) gjac(21,40)=-x(22) gjac(21,22)=-x(40) *e22 gjac(22,23)=0.333d0 gjac(22,37)=x(9) gjac(22,9)=x(37) gjac(22,43)=-1.d0 *e23 gjac(23,23)=0.333d0 gjac(23,37)=x(15) gjac(23,15)=x(37) gjac(23,46)=-1.d0 *e24 gjac(24,23)=0.333d0 gjac(24,37)=x(21) gjac(24,21)=x(37) gjac(24,48)=-1.d0 *e25 gjac(25,24)=0.333d0 gjac(25,32)=x(7) gjac(25,7)=x(32) gjac(25,44)=-1.d0 *e26 gjac(26,24)=0.333d0 gjac(26,32)=x(13) gjac(26,13)=x(32) gjac(26,45)=-1.d0 *e27 gjac(27,24)=0.333d0 gjac(27,32)=x(19) gjac(27,19)=x(32) gjac(27,47)=-1.d0 *e28 gjac(28,18)=1.d0 *e29 gjac(29,10)=1.d0 *e30 gjac(30,25)=0.333d0 gjac(30,29)=x(6) gjac(30,6)=x(29) gjac(30,33)=x(7) gjac(30,7)=x(33) gjac(30,38)=x(9) gjac(30,9)=x(38) gjac(30,41)=x(10) gjac(30,10)=x(41) *e31 gjac(31,25)=0.333d0 gjac(31,29)=x(12) gjac(31,12)=x(29) gjac(31,33)=x(13) gjac(31,13)=x(33) gjac(31,38)=x(15) gjac(31,15)=x(38) gjac(31,41)=x(16) gjac(31,16)=x(41) *e32 gjac(32,25)=0.333d0 gjac(32,29)=x(18) gjac(32,18)=x(29) gjac(32,33)=x(19) gjac(32,19)=x(33) gjac(32,38)=x(21) gjac(32,21)=x(38) gjac(32,41)=x(22) gjac(32,22)=x(41) *e33 gjac(33,5)=1.d0 gjac(33,11)=1.d0 gjac(33,17)=1.d0 *e34 gjac(34,6)=1.d0 gjac(34,12)=1.d0 gjac(34,18)=1.d0 *e35 gjac(35,7)=1.d0 gjac(35,13)=1.d0 gjac(35,19)=1.d0 *e36 gjac(36,8)=1.d0 gjac(36,14)=1.d0 gjac(36,20)=1.d0 *e37 gjac(37,9)=1.d0 gjac(37,15)=1.d0 gjac(37,21)=1.d0 *e38 gjac(38,10)=1.d0 gjac(38,16)=1.d0 gjac(38,22)=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. (INEqualities): * * Jacobian of the inequalities constraints: * return end *---------------------------------------------------- FP5-2.for