*----------------------------------------------------------- * Date created: July 22, 1996 * Copmbustion of Propane - Reduced Formulation. * * Averick, B.M., Carter, R.G., More, J.J., * The MINPACK-2 Test Problem Collection * (Preliminary Version) * Technical Memorandum No.150, May 1991. * * 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 p005, p05, p5 parameter (p005=5.0d-3,p05=5.0d-2,p5=0.5d0) * * Information about the problem. * write(1,10) 10 format(5x,'Example of nonlinear programming.') write(1,11) 11 format(5x,'Combustion of Propane - Reduced Formulation') write(1,12) 12 format(5x,'MINPACK-2 test problem 2.5, pp.9') write(1,13) 13 format(5x,'B.M. Averick, R.G. Carter, J.J. More,') write(1,14) 14 format(5x,'The MINPACK-2 test problem collection') write(1,15) 15 format(5x,'Technical Memorandum No.150, May 1991') write(1,16) 16 format(5x,'Argonne National Laboratory, Illinois 60439') * * Dimension of the problem: * n=5 ! No. of variables. m=0 ! No. of inequality constraints. me=5 ! No. of equality constraints. mb=10 ! No. of simple bounds on variables. nszc=0 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=25 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * x(1) = p005+10.d0 x(2) = p005+10.d0 x(3) = p05 x(4) = p5+50.d0 x(5) = p05 * * 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)=3 icge(4)=4 icge(5)=5 icge(6)=1 icge(7)=2 icge(8)=3 icge(9)=4 icge(10)=5 icge(11)=1 icge(12)=2 icge(13)=3 icge(14)=4 icge(15)=5 icge(16)=1 icge(17)=2 icge(18)=3 icge(19)=4 icge(20)=5 icge(21)=1 icge(22)=2 icge(23)=3 icge(24)=4 icge(25)=5 * * Starting address of columns of the Jacobian of the Equalities * ipge(1)=1 ipge(2)=6 ipge(3)=11 ipge(4)=16 ipge(5)=21 ipge(6)=26 * return end * *-------------------------------------------------------------- * Date created: July,22 1996 * Combustion of Propane - Reduced Formulation. *-------------------------------------------------------------- * 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(5,5) double precision k(10), r(10) double precision sqrtp double precision eight, forty, four, one, p, p005, p05, p5, rr, + ten, three, two, zero parameter (zero=0.0d0,p005=5.0d-3,p05=5.0d-2,p5=0.5d0,one=1.0d0, + two=2.0d0,three=3.0d0,four=4.0d0,eight=8.0d0,ten=1.0d1, + forty=4.0d1) parameter (p=forty,rr=ten) * data k/0.0d0, 0.0d0, 0.0d0, 0.0d0, 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: c Initialization. sqrtp = sqrt(p) r(5) = k(5) r(6) = k(6)/sqrtp r(7) = k(7)/sqrtp r(8) = k(8)/p r(9) = k(9)/sqrtp r(10) = k(10)/p * * Constraints. (Equalities): * e(1) = x(1)*x(2) + x(1) - three*x(5) e(2) = two*x(1)*x(2) + x(1) + two*r(10)*x(2)**2 + + x(2)*x(3)**2 + r(7)*x(2)*x(3) + r(9)*x(2)*x(4) + + r(8)*x(2) - rr*x(5) e(3) = two*x(2)*x(3)**2 + r(7)*x(2)*x(3) + + two*r(5)*x(3)**2 + r(6)*x(3) - eight*x(5) e(4) = r(9)*x(2)*x(4) + two*x(4)**2 - four*rr*x(5) e(5) = x(1)*x(2) + x(1) + r(10)*x(2)**2 + x(2)*x(3)**2 + + r(7)*x(2)*x(3) + r(9)*x(2)*x(4) + r(8)*x(2) + + r(5)*x(3)**2 + r(6)*x(3) + x(4)**2 - one * * Jacobian of the equalities constraints: * fjac(1,1) = x(2) + one fjac(2,1) = two*x(2) + one fjac(3,1) = zero fjac(4,1) = zero fjac(5,1) = x(2) + one fjac(1,2) = x(1) fjac(2,2) = two*x(1) + four*r(10)*x(2) + x(3)**2 + r(7)*x(3) + + r(9)*x(4) + r(8) fjac(3,2) = two*x(3)**2 + r(7)*x(3) fjac(4,2) = r(9)*x(4) fjac(5,2) = x(1) + two*r(10)*x(2) + x(3)**2 + r(7)*x(3) + + r(9)*x(4) + r(8) fjac(1,3) = zero fjac(2,3) = two*x(2)*x(3) + r(7)*x(2) fjac(3,3) = four*x(2)*x(3) + r(7)*x(2) + four*r(5)*x(3) + r(6) fjac(4,3) = zero fjac(5,3) = two*x(2)*x(3) + r(7)*x(2) + two*r(5)*x(3) + r(6) fjac(1,4) = zero fjac(2,4) = r(9)*x(2) fjac(3,4) = zero fjac(4,4) = r(9)*x(2) + four*x(4) fjac(5,4) = r(9)*x(2) + two*x(4) fjac(1,5) = -three fjac(2,5) = -rr fjac(3,5) = -eight fjac(4,5) = -four*rr fjac(5,5) = zero * do j=1,n do i=1,n ij=i+(j-1)*n ge(ij)=fjac(i,j) end do end do * return end *--------------------------------------------------------PROPR.for