*------------------------------------------------------------ * Date created:November 29, 1996. * Date modified: March 24, 1997 * * Andrei's Pooling Problem * * Neculai Andrei, * Advanced Mathematical Programming, * Theory, Computational Methods, Applications. * Technical Press, Bucharest, 1999. Romania. * Chapter 31, pp.808. * * 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 * * Remark: This problem has been created during my visit to: * Bonner & Moore Associated GmbH, Wiesbaden, Germany, * as a result of a technical discussion with * Dr. Ronald Coxhead. *------------------------------------------------------------ * 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,'Pooling Problem of Andrei') write(1,14) 14 format(5x,'Bonner & Moore Assopciated GmbH - Germany') * * Dimension of the problem: * n=34 ! No. of variables. m=0 ! No. of inequality constraints. me=20 ! No. of equality constraints. mb=68 ! No. of simple bounds on variables. nszc=0 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=101 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * x(1)=182.d0 x(2)=140.d0 x(3)=70.d0 x(4)=1070.d0 x(5)=47.d0 x(6)=11.d0 x(7)=12.d0 x(8)=700.d0 x(9)=60.d0 x(10)=190.d0 x(11)=0.1d0 x(12)=0.1d0 x(13)=0.1d0 do i=14,23 x(i)=88.d0 end do do i=24,28 x(i)=0.77d0 end do x(29)=401.d0 x(30)=402.d0 x(31)=702.d0 x(32)=810.d0 x(33)=1001.d0 x(34)=1510.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 * * * Starting address of columns of the Jacobian of the Inequalities * * * Rows indices of the nonzeros of the Jacobian of the Equalities * icge(1)=1 icge(2)=6 icge(3)=11 icge(4)=16 c2 icge(5)=1 icge(6)=6 icge(7)=11 icge(8)=16 c3 icge(9)=1 icge(10)=6 icge(11)=11 icge(12)=16 c4 icge(13)=2 icge(14)=7 icge(15)=12 icge(16)=17 c5 icge(17)=2 icge(18)=7 icge(19)=12 icge(20)=17 c6 icge(21)=2 icge(22)=7 icge(23)=12 icge(24)=17 c7 icge(25)=2 icge(26)=7 icge(27)=12 icge(28)=17 c8 icge(29)=3 icge(30)=8 icge(31)=13 icge(32)=18 c9 icge(33)=3 icge(34)=8 icge(35)=13 icge(36)=18 c10 icge(37)=4 icge(38)=9 icge(39)=14 icge(40)=19 c11 icge(41)=4 icge(42)=9 icge(43)=14 icge(44)=19 c12 icge(45)=5 icge(46)=10 icge(47)=15 icge(48)=20 c13 icge(49)=5 icge(50)=10 icge(51)=15 icge(52)=20 c14 icge(53)=1 icge(54)=4 c15 icge(55)=2 icge(56)=4 icge(57)=5 c16 icge(58)=3 icge(59)=5 c17 icge(60)=4 c18 icge(61)=5 c19 icge(62)=6 icge(63)=9 c20 icge(64)=7 icge(65)=9 icge(66)=10 c21 icge(67)=8 icge(68)=10 c22 icge(69)=9 c23 icge(70)=10 c24 icge(71)=11 icge(72)=14 c25 icge(73)=12 icge(74)=14 icge(75)=15 c26 icge(76)=13 icge(77)=15 c27 icge(78)=14 c28 icge(79)=15 c29 icge(80)=4 icge(81)=9 icge(82)=14 icge(83)=16 icge(84)=19 c30 icge(85)=4 icge(86)=9 icge(87)=14 icge(88)=17 icge(89)=19 c31 icge(90)=5 icge(91)=10 icge(92)=15 icge(93)=17 icge(94)=20 c32 icge(95)=5 icge(96)=10 icge(97)=15 icge(98)=18 icge(99)=20 c33 icge(100)=19 c34 icge(101)=20 * * Starting address of columns of the Jacobian of the Equalities * ipge(1)=1 ipge(2)=5 ipge(3)=9 ipge(4)=13 ipge(5)=17 ipge(6)=21 ipge(7)=25 ipge(8)=29 ipge(9)=33 ipge(10)=37 ipge(11)=41 ipge(12)=45 ipge(13)=49 ipge(14)=53 ipge(15)=55 ipge(16)=58 ipge(17)=60 ipge(18)=61 ipge(19)=62 ipge(20)=64 ipge(21)=67 ipge(22)=69 ipge(23)=70 ipge(24)=71 ipge(25)=73 ipge(26)=76 ipge(27)=78 ipge(28)=79 ipge(29)=80 ipge(30)=85 ipge(31)=90 ipge(32)=95 ipge(33)=100 ipge(34)=101 ipge(35)=102 * * return end * *-------------------------------------------------------------- * Date created: November 29, 1996 * Date modified: December 2, 1996 * * Andrei's Pooling Problem * March 24, 1997 *-------------------------------------------------------------- * 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 p(100),q(100) * * Initial properties. * * Research Octane p(1)=90.d0 p(2)=89.d0 p(3)=91.d0 p(4)=87.d0 p(5)=90.5d0 p(6)=89.5d0 p(7)=94.d0 p(8)=89.d0 p(9)=89.1d0 p(10)=89.2d0 p(11)=89.3d0 p(12)=89.4d0 p(13)=89.5d0 * Motor Octane p(14)=86.d0 p(15)=85.5d0 p(16)=86.5d0 p(17)=83.2d0 p(18)=86.9d0 p(19)=85.d0 p(20)=89.8d0 p(21)=85.1d0 p(22)=85.3d0 p(23)=85.4d0 p(24)=85.2d0 p(25)=85.5d0 p(26)=85.6d0 * Specific Gravity p(27)=0.78d0 p(28)=0.8d0 p(29)=0.81d0 p(30)=0.77d0 p(31)=0.775d0 p(32)=0.78d0 p(33)=0.82d0 p(34)=0.785d0 p(35)=0.79d0 p(36)=0.787d0 p(37)=0.776d0 p(38)=0.783d0 p(39)=0.779d0 * * Coefficients of the objective function. do i=1,n q(i)=0.d0 end do q(1)=1.1d0 q(2)=1.1d0 q(3)=1.1d0 q(4)=0.878d0 q(5)=0.878d0 q(6)=0.878d0 q(7)=0.878d0 q(8)=1.6d0 q(9)=1.6d0 q(10)=0.5d0 q(11)=0.5d0 q(12)=0.98d0 q(13)=0.998d0 * * Objective function and its gradient: * objf = 0.d0 do i=1,n objf = objf + q(i)*x(i) end do do i=1,n gobj(i)=q(i) end do * * Bounds on variables: * j=1 do i=1,28 cb(j) = x(i) cb(j+1)=11000.d0-x(i) j=j+2 end do cb(57)=x(29)-400.d0 cb(58)=11000.d0-x(29) cb(59)=x(30)-400.d0 cb(60)=11000.d0-x(30) cb(61)=x(31)-700.d0 cb(62)=11000.d0-x(31) cb(63)=x(32)-800.d0 cb(64)=11000.d0-x(32) cb(65)=x(33)-1000.d0 cb(66)=11000.d0-x(33) cb(67)=x(34)-1500.d0 cb(68)=11000.d0-x(34) * * Constraints. (Inequalities): * * * Jacobian of the inequalities constraints: * * Constraints. (Equalities): * e(1)=p(1)*x(1) + p(2)*x(2) +p(3)*x(3) - 1 x(14)*(x(1) + x(2) + x(3)) e(2)=p(4)*x(4) + p(5)*x(5) + p(6)*x(6) + p(7)*x(7) - 1 x(15)*(x(4)+x(5)+x(6)+x(7)) e(3)=p(8)*x(8) + p(9)*x(9) - 1 x(16)*(x(8)+x(9)) e(4)=p(10)*x(10) + p(11)*x(11) + x(29)*x(14) + 1 x(30)*x(15) - x(17)*(x(10)+x(11)+x(29)+x(30)) e(5)=p(12)*x(12) + p(13)*x(13) + x(31)*x(15) + x(32)*x(16) - 1 x(18)*(x(12)+x(13)+x(31)+x(32)) c------------------------------------------------------------------- e(6)=p(14)*x(1) + p(15)*x(2) + p(16)*x(3) - 1 x(19)*(x(1)+x(2)+x(3)) e(7)=p(17)*x(4) + p(18)*x(5) + p(19)*x(6) + p(20)*x(7) - 1 x(20)*(x(4)+x(5)+x(6)+x(7)) e(8)=p(21)*x(8) + p(22)*x(9) - 1 x(21)*(x(8)+x(9)) e(9)=p(23)*x(10) + p(24)*x(11) + x(29)*x(19) + x(30)*x(20)- 1 x(22)*(x(10)+x(11)+x(29)+x(30)) e(10)=p(25)*x(12) + p(26)*x(13) + x(31)*x(20) + x(32)*x(21)- 1 x(23)*(x(12)+x(13)+x(31)+x(32)) c------------------------------------------------------------------- e(11)=p(27)*x(1) + p(28)*x(2) + p(29)*x(3) - 1 x(24)*(x(1)+x(2)+x(3)) e(12)=p(30)*x(4) + p(31)*x(5) + p(32)*x(6) + p(33)*x(7)- 1 x(25)*(x(4)+x(5)+x(6)+x(7)) e(13)=p(34)*x(8) + p(35)*x(9) - 1 x(26)*(x(8)+x(9)) e(14)=p(36)*x(10) + p(37)*x(11) + x(29)*x(24) + x(30)*x(25)- 1 x(27)*(x(10)+x(11)+x(29)+x(30)) e(15)=p(38)*x(12) + p(39)*x(13) + x(31)*x(25) + x(32)*x(26)- 1 x(28)*(x(12)+x(13)+x(31)+x(32)) c-------------------------------------------------------------------- e(16)=x(1)+x(2)+x(3) - x(29) e(17)=x(4)+x(5)+x(6)+x(7) - x(30) - x(31) e(18)=x(8)+x(9) - x(32) e(19)=x(10)+x(11)+x(29)+x(30) - x(33) e(20)=x(12)+x(13)+x(31)+x(32) - x(34) * * Jacobian of the equalities constraints: * c1 ge(1)=p(1) - x(14) ge(2)=p(14) - x(19) ge(3)=p(27) - x(24) ge(4)=1.d0 c2 ge(5)=p(2) - x(14) ge(6)=p(15) - x(19) ge(7)=p(28) - x(24) ge(8)=1.d0 c3 ge(9)=p(3) - x(14) ge(10)=p(16) - x(19) ge(11)=p(29) - x(24) ge(12)=1.d0 c4------------------------------------- ge(13)=p(4) - x(15) ge(14)=p(17) - x(20) ge(15)=p(30) - x(25) ge(16)=1.d0 c5 ge(17)=p(5) - x(15) ge(18)=p(18) - x(20) ge(19)=p(31) - x(25) ge(20)=1.d0 c6 ge(21)=p(6) - x(15) ge(22)=p(19) - x(20) ge(23)=p(32) - x(25) ge(24)=1.d0 c7 ge(25)=p(7) - x(15) ge(26)=p(20) - x(20) ge(27)=p(33) - x(25) ge(28)=1.d0 c8------------------------------------- ge(29)=p(8) - x(16) ge(30)=p(21) - x(21) ge(31)=p(34) - x(26) ge(32)=1.d0 c9 ge(33)=p(9) - x(16) ge(34)=p(22) - x(21) ge(35)=p(35) - x(26) ge(36)=1.d0 c10------------------------------------ ge(37)=p(10) - x(17) ge(38)=p(23) - x(22) ge(39)=p(36) - x(27) ge(40)=1.d0 c11 ge(41)=p(11) - x(17) ge(42)=p(24) - x(22) ge(43)=p(37) - x(27) ge(44)=1.d0 c12------------------------------------ ge(45)=p(12) - x(18) ge(46)=p(25) - x(23) ge(47)=p(38) - x(28) ge(48)=1.d0 c13 ge(49)=p(13) - x(18) ge(50)=p(26) - x(23) ge(51)=p(39) - x(28) ge(52)=1.d0 c14------------------------------------- ge(53)=-(x(1)+x(2)+x(3)) ge(54)=x(29) c15 ge(55)=-(x(4)+x(5)+x(6)+x(7)) ge(56)=x(30) ge(57)=x(31) c16 ge(58)=-(x(8)+x(9)) ge(59)=x(32) c17 ge(60)=-(x(10)+x(11)+x(29)+x(30)) c18 ge(61)=-(x(12)+x(13)+x(31)+x(32)) c19---------------------------------------- ge(62)= -(x(1)+x(2)+x(3)) ge(63)=x(29) c20 ge(64)=-(x(4)+x(5)+x(6)+x(7)) ge(65)=x(30) ge(66)=x(31) c21 ge(67)=-(x(8)+x(9)) ge(68)=x(32) c22 ge(69)=-(x(10)+x(11)+x(29)+x(30)) c23 ge(70)=-(x(12)+x(13)+x(31)+x(32)) c24---------------------------------------- ge(71)=-(x(1)+x(2)+x(3)) ge(72)=x(29) c25 ge(73)=-(x(4)+x(5)+x(6)+x(7)) ge(74)=x(30) ge(75)=x(31) c26 ge(76)=-(x(8)+x(9)) ge(77)=x(32) c27 ge(78)=-(x(10)+x(11)+x(29)+x(30)) c28 ge(79)=-(x(12)+x(13)+x(31)+x(32)) c29----------------------------------------- ge(80)=x(14) - x(17) ge(81)=x(19) - x(22) ge(82)=x(24) - x(27) ge(83)=-1.d0 ge(84)=1.d0 c30 ge(85)=x(15) - x(17) ge(86)=x(20) - x(22) ge(87)=x(25) - x(27) ge(88)=-1.d0 ge(89)=1.d0 c31 ge(90)=x(15) - x(18) ge(91)=x(20) - x(23) ge(92)=x(25) - x(28) ge(93)=-1.d0 ge(94)=1.d0 c32 ge(95)=x(16) - x(18) ge(96)=x(21) - x(23) ge(97)=x(26) - x(28) ge(98)=-1.d0 ge(99)=1.d0 c33 ge(100)=-1.d0 c34 ge(101)=-1.d0 return end *----------------------------------------------------POOL.for