*----------------------------------------------------------- * Date created: July 22, 1996 * * Combustion of Propane. * Averick, B.M., Carter, R.G., More, J.J., * The MINPACK-2 Test Problem Collection * (Preliminary Version) * Technical Memorandum No.150, May 1991. p.8. * * 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) * double precision k(10) double precision p double precision sqrtp,zero parameter (p=4.0d1,zero=0.d0) data k/zero, zero, zero, zero, 1.930d-1, 2.597d-3, 3.448d-3, + 1.799d-5, 2.155d-4, 3.846d-5/ * * Information about the problem. * write(1,10) 10 format(5x,'Example of nonlinear programming.') write(1,11) 11 format(5x,'Combustion of Propane') write(1,12) 12 format(5x,'B.M. Averick, R.G. Carter, J.J. More') write(1,13) 13 format(5x,'The MINPACK-2 Test Problem Collection.') write(1,14) 14 format(5x,'Argonne National Laboratory,') write(1,15) 15 format(5x,'Technical Memorandum No. 150, May 1991.') * * Dimension of the problem: * n=11 ! No. of variables. m=0 ! No. of inequality constraints. me=11 ! No. of equality constraints. mb=22 ! No. of simple bounds on variables. nszc=0 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=53 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * sqrtp = sqrt(p) x(1) = 5.0d0 x(2) = 2.5d0 x(3) = 5.0d0 x(4) = 1.0d-1 x(5) = 5.0d-2*k(5) x(6) = k(6)/sqrtp x(7) = 5.0d1*k(7)/sqrtp x(8) = 1.0d3*k(8)/p x(9) = 5.0d2*k(9)/sqrtp x(10) = 5.0d4*k(10)/p x(11) = 2.0d1 * * * 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)=2 icge(3)=5 icge(4)=6 icge(5)=7 icge(6)=8 icge(7)=9 icge(8)=10 icge(9)=11 icge(10)=2 icge(11)=3 icge(12)=5 icge(13)=6 icge(14)=7 icge(15)=11 icge(16)=4 icge(17)=9 icge(18)=11 icge(19)=1 icge(20)=2 icge(21)=5 icge(22)=6 icge(23)=7 icge(24)=8 icge(25)=9 icge(26)=10 icge(27)=11 icge(28)=3 icge(29)=5 icge(30)=11 icge(31)=3 icge(32)=6 icge(33)=11 icge(34)=2 icge(35)=3 icge(36)=7 icge(37)=11 icge(38)=2 icge(39)=8 icge(40)=11 icge(41)=2 icge(42)=4 icge(43)=9 icge(44)=11 icge(45)=2 icge(46)=10 icge(47)=11 icge(48)=6 icge(49)=7 icge(50)=8 icge(51)=9 icge(52)=10 icge(53)=11 * * Starting address of columns of the Jacobian of the Equalities * ipge(1)=1 ipge(2)=10 ipge(3)=16 ipge(4)=19 ipge(5)=28 ipge(6)=31 ipge(7)=34 ipge(8)=38 ipge(9)=41 ipge(10)=45 ipge(11)=48 ipge(12)=54 * return end * *-------------------------------------------------------------- * Date created: July,22 1996 * Combustion of Propane. *-------------------------------------------------------------- * 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) double precision fjac(11,11) double precision k(10) double precision pdx, sqpdx, sqrtp, xfrac, xtau double precision eight, forty, one, p, p5, rr, + ten, three, two, zero parameter (zero=0.0d0,p5=0.5d0,one=1.0d0, + two=2.0d0,three=3.0d0,eight=8.0d0,ten=1.0d1, + forty=4.0d1) parameter (p=forty,rr=ten) data k/zero, zero, zero, zero, 1.930d-1, 2.597d-3, 3.448d-3, + 1.799d-5, 2.155d-4, 3.846d-5/ * * * Objective function and its gradient: * objf=1.d0 * do i=1,n gobj(1)=0.d0 end do * * 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. (Inequalities): * * * Jacobian of the inequalities constraints: * * Constraints. (Equalities): * pdx = p/x(11) sqpdx = sqrt(pdx) sqrtp=sqrt(p) xtau = zero do 20 i = 1, n - 1 xtau = xtau + x(i) 20 continue e(1) = x(1) + x(4) - three e(2) = two*x(1) + x(2) + x(4) + x(7) + x(8) + x(9) + + two*x(10) - rr e(3) = two*x(2) + two*x(5) + x(6) + x(7) - eight e(4) = two*x(3) + x(9) - 4.0d0*rr e(5) = k(5)*x(2)*x(4) - x(1)*x(5) e(6) = k(6)*sqrt(x(2)*x(4)) - sqrt(x(1))*x(6)*sqpdx e(7) = k(7)*sqrt(x(1)*x(2)) - sqrt(x(4))*x(7)*sqpdx e(8) = k(8)*x(1) - x(4)*x(8)*pdx e(9) = k(9)*x(1)*sqrt(x(3)) - x(4)*x(9)*sqpdx e(10) = k(10)*x(1)**2 - (x(4)**2)*x(10)*pdx e(11) = x(11) - xtau * * Jacobian of the equalities constraints: * do 40 j = 1, n do 30 i = 1, n - 1 fjac(i,j) = zero 30 continue fjac(n,j) = -one 40 continue fjac(n,n) = one xfrac = one/(sqrt(x(11))**3) fjac(1,1) = one fjac(2,1) = two fjac(5,1) = -x(5) fjac(6,1) = -p5*x(6)*sqpdx/sqrt(x(1)) fjac(7,1) = p5*k(7)*sqrt(x(2))/sqrt(x(1)) fjac(8,1) = k(8) fjac(9,1) = k(9)*sqrt(x(3)) fjac(10,1) = two*k(10)*x(1) fjac(2,2) = one fjac(3,2) = two fjac(5,2) = k(5)*x(4) fjac(6,2) = p5*k(6)*sqrt(x(4))/sqrt(x(2)) fjac(7,2) = p5*k(7)*sqrt(x(1))/sqrt(x(2)) fjac(4,3) = two fjac(9,3) = p5*k(9)*x(1)/sqrt(x(3)) fjac(1,4) = one fjac(2,4) = one fjac(5,4) = k(5)*x(2) fjac(6,4) = p5*k(6)*sqrt(x(2))/sqrt(x(4)) fjac(7,4) = -p5*x(7)*sqpdx/sqrt(x(4)) fjac(8,4) = -x(8)*pdx fjac(9,4) = -x(9)*sqpdx fjac(10,4) = -two*x(4)*x(10)*pdx fjac(3,5) = two fjac(5,5) = -x(1) fjac(3,6) = one fjac(6,6) = -sqrt(x(1))*sqpdx fjac(2,7) = one fjac(3,7) = one fjac(7,7) = -sqrt(x(4))*sqpdx fjac(2,8) = one fjac(8,8) = -x(4)*pdx fjac(2,9) = one fjac(4,9) = one fjac(9,9) = -x(4)*sqpdx fjac(2,10) = two fjac(10,10) = -(x(4)**2)*pdx fjac(6,11) = p5*sqrt(x(1))*x(6)*sqrtp*xfrac fjac(7,11) = p5*sqrt(x(4))*x(7)*sqrtp*xfrac fjac(8,11) = x(4)*x(8)*p/(x(11)**2) fjac(9,11) = p5*x(4)*x(9)*sqrtp*xfrac fjac(10,11) = x(4)**2*x(10)*p/(x(11)**2) * ij=0 do j=1,n do i=1,n if(fjac(i,j) .ne. 0.d0) then ij=ij+1 ge(ij)=fjac(i,j) end if end do end do * return end *-----------------------------------------------------PROP.for