* Date created: April 11, 1997 * * Brown, A.A., Bartholomew-Biggs, M.C., * ODE versus SQP methods for constrained optimisation. * Technical Report No. 179, June 1987. * The Hatfield Polytechnic, College Lane, Hatfield * * Problem 16. * * 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 *----------------------------------------------------------- * 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,'Problem 16, April 11, 1997') write(1,12) 12 format(5x,'Brown & Bartholomew-Biggs') * * Dimension of the problem: * n=6 ! No. of variables. m=0 ! No. of inequality constraints. me=5 ! 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=25 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * x(1)=6.d0 x(2)=5.d0 x(3)=4.d0 x(4)=3.d0 x(5)=2.d0 x(6)=1.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)=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)=0 ipge(7)=26 * return end *-------------------------------------------------------------- * Date created: April 11, 1997 * Problem 16, Brown & Bartholomew-Biggs *-------------------------------------------------------------- * 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) * * Objective function and its gradient: * objf = (x(1)-x(2))**2 + (x(2)-x(3))**4 + 1 (x(3)-x(4))**6 + (x(4)-x(5))**8 + 1 (x(5)-x(6))**2 * gobj(1)= 2.d0*(x(1)-x(2)) gobj(2)= -2.d0*(x(1)-x(2)) + 4.d0*(x(2)-x(3))**3 gobj(3)= -4.d0*(x(2)-x(3))**3 + 6.d0*(x(3)-x(4))**5 gobj(4)= -6.d0*(x(3)-x(4))**5 + 8.d0*(x(4)-x(5))**7 gobj(5)= -8.d0*(x(4)-x(5))**7 + 2.d0*(x(5)-x(6)) gobj(6)= -2.d0*(x(5)-x(6)) * * Bounds on variables: * j=1 do i=1,n cb(j)=x(i)+100.d0 cb(j+1)=100.d0-x(i) j=j+2 end do * * Constraints. (Inequalities): * * * Jacobian of the inequalities constraints: * * Constraints. (Equalities): * e(1) = x(1)+x(2)+x(3)+x(4)+x(5) - 15.d0 e(2) = x(1)*(x(2)+x(3)+x(4)+x(5)) + 1 x(2)*(x(3)+x(4)+x(5)) + 1 x(3)*(x(4)+x(5)) + 1 x(4)*x(5) - 85.d0 e(3) = x(1)*x(2)*(x(3)+x(4)+x(5)) + 1 x(4)*x(5)*(x(1)+x(2)+x(3)) + 1 (x(1)*x(3)+x(2)*x(3))*(x(4)+x(5)) - 225.d0 e(4) = x(1)*x(2)*(x(3)*x(4)+x(4)*x(5)+x(3)*x(5)) + 1 x(3)*x(4)*x(5)*(x(1)+x(2)) - 274.d0 e(5) = x(1)*x(2)*x(3)*x(4)*x(5) - 120.d0 * * Jacobian of the equalities constraints: * c1 ge(1)=1.d0 ge(2)=x(2)+x(3)+x(4)+x(5) ge(3)=x(2)*(x(3)+x(4)+x(5)) + x(4)*x(5) + 1 x(3)*(x(4)+x(5)) ge(4)=x(2)*(x(3)*x(4)+x(4)*x(5)+x(3)*x(5)) + 1 x(3)*x(4)*x(5) ge(5)=x(2)*x(3)*x(4)*x(5) c2 ge(6)=1.d0 ge(7)=x(1) + (x(3)+x(4)+x(5)) ge(8)=x(1)*(x(3)+x(4)+x(5)) + x(4)*x(5) + 1 x(3)*(x(4)+x(5)) ge(9)=x(1)*(x(3)*x(4)+x(4)*x(5)+x(3)*x(5)) + 1 x(3)*x(4)*x(5) ge(10)=x(1)*x(3)*x(4)*x(5) c3 ge(11)=1.d0 ge(12)=x(1) + x(2) + (x(4)+x(5)) ge(13)=x(1)*x(2) + x(4)*x(5) + 1 (x(1)+x(2))*(x(4)+x(5)) ge(14)=x(1)*x(2)*x(4) + x(1)*x(2)*x(5) + 1 x(4)*x(5)*(x(1)+x(2)) ge(15)=x(1)*x(2)*x(4)*x(5) c4 ge(16)=1.d0 ge(17)=x(1) + x(2) + x(3) + x(5) ge(18)=x(1)*x(2) + x(5)*(x(1)+x(2)+x(3)) + 1 x(1)*x(3)+x(2)*x(3) ge(19)=x(1)*x(2)*x(3) + x(1)*x(2)*x(5) + 1 x(3)*x(5)*(x(1)+x(2)) ge(20)=x(1)*x(2)*x(3)*x(5) c5 ge(21)=1.d0 ge(22)=x(1) + x(2) + x(3) + x(4) ge(23)=x(1)*x(2) + x(4)*(x(1)+x(2)+x(3)) + 1 x(1)*x(3)+x(2)*x(3) ge(24)=x(1)*x(2)*(x(4)+x(3)) + 1 x(3)*x(4)*(x(1)+x(2)) ge(25)=x(1)*x(2)*x(3)*x(4) * return end * *---------------------------------------------BB16.for