*------------------------------------------------------------ * December 26, 1997 * Brown - Bartholomew-Biggs * ODE vs SQP methods for constrained optimisation, * Technical Report No.179, June 1987. * The Hatfield Polytechnic, UK. * * Problem 2 * * Project: Test Problems with SPENBAR * * 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,'Problem 2, Brown - Bartholomew-Biggs, ') * * Dimension of the problem: * n=4 ! No. of variables. m=0 ! No. of inequality constraints. me=1 ! 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=4 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * do i=1,n x(i)=1.01d0 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 * icge(1)=1 icge(2)=1 icge(3)=1 icge(4)=1 * * Starting address of columns of the Jacobian of the equalities * ipge(1)=1 ipge(2)=2 ipge(3)=3 ipge(4)=4 ipge(5)=5 * * Rows indices of the nonzeros of the Jacobian of the Equalities * * * Starting address of columns of the Jacobian of the Equalities * return end *-------------------------------------------------------------- * BB2 Brown - Bartholomew-Bigs *-------------------------------------------------------------- * 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)-1.d0)**2 - (x(2)-1.d0)**2 - 1 (x(3)-1.d0)**2 - (x(4)-1.d0)**2 * gobj(1)=-2.d0*(x(1)-1.d0) gobj(2)=-2.d0*(x(2)-1.d0) gobj(3)=-2.d0*(x(3)-1.d0) gobj(4)=-2.d0*(x(4)-1.d0) * * Bounds on variables: * j=1 do i=1,n cb(j)=x(i) cb(j+1)=1.d38-x(i) j=j+2 end do * * Constraints. (Inequalities): * * * Jacobian of the inequalities constraints: * * * Constraints. (Equalities): * e(1)= 100.d0*(x(2)-x(1)*x(1))**2 + (1.d0-x(1))**2 + 1 90.d0*(x(4)-x(3)*x(3))**2 + (1.d0-x(3))**2 + 1 10.1d0*( (x(2)-1.d0)**2 + (x(4)-1.d0)**2 ) + 1 19.8d0*(x(2)-1.d0)*(x(4)-1.d0) - 0.01d0 * * Jacobian of the equalities constraints: * ge(1)= 200.d0*(x(2)-x(1)*x(1))*(-2.d0*x(1)) - 1 2.d0*(1.d0-x(1)) ge(2)= 200.d0*(x(2)-x(1)*x(1)) + 1 20.2d0*(x(2)-1.d0) + 1 19.8d0*(x(4)-1.d0) ge(3)= 180.d0*(x(4)-x(3)*x(3))*(-2.d0*x(3)) - 1 2.d0*(1-x(3)) ge(4)= 180.d0*(x(4)-x(3)*x(3)) + 1 20.2d0*(x(4)-1.d0) + 1 19.8d0*(x(2)-1.d0) * return end *----------------------------------------------------BB2.for