*--------------------------------------------------------- * Date created: March 7, 2001 * * Floudas & Pardalos, * A collection of test problems for constrained global * optimization algorithms. * Springer-Verlag, Berlin, 1990 * * Problem 3.3.1, pp.23-24 * * 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) * write(1,10) 10 format(5x,'Example of a Nonlinear Programming Problem.') write(1,11) 11 format(5x,'Floudas & Pardalos, Problem 3.3, pp.23-24') write(1,12) 12 format(5x,'March 7, 2001') * n=6 m=6 me=0 mb=2*n nszc=12 nsze=0 * * Initial Point: * x(1)=2 x(2)=3 x(3)=4 x(4)=2 x(5)=3 x(6)=4 * * Index vector for simple bounds: * 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. * * * Starting adress for the columns * * * Rows indices of the nonzeros of the Jacobian of the INEqualities. * icgc(1)= 3 icgc(2)= 4 icgc(3)= 5 icgc(4)= 6 icgc(5)= 3 icgc(6)= 4 icgc(7)= 5 icgc(8)= 6 icgc(9)= 1 icgc(10)=1 icgc(11)=2 icgc(12)=2 * ** Starting adress for the columns * ipgc(1)=1 ipgc(2)=5 ipgc(3)=9 ipgc(4)=10 ipgc(5)=11 ipgc(6)=12 ipgc(7)=13 * return end * *-------------------------------------------------------------- * Date created: March 7, 2001 * Floudas & Pardalos, Problem 3.3, pp.23-24 *-------------------------------------------------------------- * subroutine prob(n,m,mb,me,sb,x,objf,gobj,c,gc,cb,e,ge, 1 nszc,nsze,nb) * * Calculate problem functions at iterate x. * double precision x(n),objf,gobj(n),c(m),gc(nszc), * cb(mb),e(me),ge(nsze) * * Objective function, and its gradient. * objf= -25.d0*(x(1)-2.d0)**2 - (x(2)-2.d0)**2 - * (x(3)-1.d0)**2 - (x(4)-4.d0)**2 - * (x(5)-1.d0)**2 - (x(6)-4.d0)**2 * * Gradient of the Objective Function * gobj(1)=-50.d0*(x(1)-2.d0) gobj(2)= -2.d0*(x(2)-2.d0) gobj(3)= -2.d0*(x(3)-1.d0) gobj(4)= -2.d0*(x(4)-4.d0) gobj(5)= -2.d0*(x(5)-1.d0) gobj(6)= -2.d0*(x(6)-4.d0) * * Bounds on variables. * cb(1)=x(1) cb(2)=100.d0-x(1) cb(3)=x(2) cb(4)=100.d0-x(2) cb(5)=x(3)-1.d0 cb(6)=5.d0-x(3) cb(7)=x(4) cb(8)=6.d0-x(4) cb(9)=x(5)-1.d0 cb(10)=5.d0-x(5) cb(11)=x(6) cb(12)=10.d0-x(6) * * * -- Equality Constraints * * * -- Jacobian of the Equality Constraints * * * -- InEquality Constraints * c(1)=(x(3)-3.d0)**2 + x(4) - 4.d0 c(2)=(x(5)-3.d0)**2 + x(6) - 4.d0 c(3)=2.d0 - x(1) + 3.d0*x(2) c(4)=2.d0 + x(1) - x(2) c(5)=6.d0 - x(1) - x(2) c(6)=x(1) + x(2) -2.d0 * * * -- Jacobian of the Inequality constraints. * c1 gc(1)=-1.d0 gc(2)= 1.d0 gc(3)=-1.d0 gc(4)= 1.d0 c2 gc(5)=3.d0 gc(6)=-1.d0 gc(7)=-1.d0 gc(8)=1.d0 c3 gc(9)=2.d0*(x(3)-3.d0) c4 gc(10)=1.d0 c5 gc(11)=2.d0*(x(5)-3.d0) c6 gc(12)=1.d0 * return end *------------------------------------------------FP3-3.for