*----------------------------------------------------------- * Date created: February 22, 1996 * * Design of an electric transformer. * * Hock - Schittkowski, * Test Examples for Nonlinear Programming. * Springer-Verlag, 1981. Problem 93, pp.108. * * 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,'Design of an Electric Transformer.') write(1,11) 11 format(5x,'M.C. Bartholomew-Biggs') write(1,12) 12 format(5x,'A numerical comparison between two approaches') write(1,13) 13 format(5x,'to the nonlinear programming problem.') write(1,14) 14 format(5x,'in L.C.W. Dixon and G.P. Szego, (Eds.),') write(1,15) 15 format(5x,'Towards Global Optimization, North-Holland,') write(1,16) 16 format(5x,'1978, pp.293 - 312.') write(1,17) 17 format(5x,'Please see: Hock & Schittkowski, Problem 93, pp.108') * * Dimension of the problem: * n=6 m=2 me=0 mb=6 nszc=12 nsze=0 * * Initial point: * x(1)=5.54d0 x(2)=4.4d0 x(3)=12.02d0 x(4)=11.82d0 x(5)=0.702d0 x(6)=0.852d0 * * Index vector for simple bounds: cb >= 0. * sb(1)=1 sb(2)=2 sb(3)=3 sb(4)=4 sb(5)=5 sb(6)=6 * * Rows indices of the nonzeros of the Jacobian of the Inequalities * icgc(1)=1 icgc(2)=2 icgc(3)=1 icgc(4)=2 icgc(5)=1 icgc(6)=2 icgc(7)=1 icgc(8)=2 icgc(9)=1 icgc(10)=2 icgc(11)=1 icgc(12)=2 * * Starting address of columns of the Jacobian of the Inequalities * ipgc(1)=1 ipgc(2)=3 ipgc(3)=5 ipgc(4)=7 ipgc(5)=9 ipgc(6)=11 ipgc(7)=13 * return end * *-------------------------------------------------------------- * Date created: February 2, 1996 * Design of an Electrical Transformer. * Hock - Schittkowski, 1981, problem 93, pp.108 *-------------------------------------------------------------- * 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 t1,t2 * * Objective function and its gradient: * * t1=0.00062 t2=0.00058 * objf=0.0204*x(1)*x(1)*x(4) + 1 0.0204*x(1)*x(2)*x(4) + 1 0.0204*x(1)*x(3)*x(4) + * 1 0.0187*x(1)*x(2)*x(3) + 1 0.0187*x(2)*x(2)*x(3)*1.57 + 1 0.0187*x(2)*x(3)*x(4) + * 1 0.0607*x(1)*x(1)*x(4)*x(5)*x(5) + 1 0.0607*x(1)*x(2)*x(4)*x(5)*x(5) + 1 0.0607*x(1)*x(3)*x(4)*x(5)*x(5) + * 1 0.0437*x(1)*x(2)*x(3)*x(6)*x(6) + 1 0.0437*x(2)*x(2)*x(3)*x(6)*x(6)*1.57 + 1 0.0437*x(2)*x(3)*x(4)*x(6)*x(6) * gobj(1)=0.0204*x(1)*x(4)*2.d0 + 1 0.0204*x(2)*x(4) + 1 0.0204*x(3)*x(4) + 1 0.0187*x(2)*x(3) + 1 0.0607*x(1)*x(4)*x(5)*x(5)*2.d0 + 1 0.0607*x(2)*x(4)*x(5)*x(5) + 1 0.0607*x(3)*x(4)*x(5)*x(5) + 1 0.0437*x(2)*x(3)*x(6)*x(6) * gobj(2)=0.0204*x(1)*x(4) + 1 0.0187*x(1)*x(3) + 1 0.0187*x(2)*x(3)*1.57*2.d0 + 1 0.0187*x(3)*x(4) + 1 0.0607*x(1)*x(4)*x(5)*x(5) + 1 0.0437*x(1)*x(3)*x(6)*x(6) + 1 0.0437*x(2)*x(3)*x(6)*x(6)*1.57*2.d0 + 1 0.0437*x(3)*x(4)*x(6)*x(6) * gobj(3)=0.0204*x(1)*x(4) + 1 0.0187*x(1)*x(2) + 1 0.0187*x(2)*x(2)*1.57d0 + 1 0.0187*x(2)*x(4) + 1 0.0607*x(1)*x(4)*x(5)*x(5) + 1 0.0437*x(1)*x(2)*x(6)*x(6) + 1 0.0437*x(2)*x(2)*x(6)*x(6)*1.57 + 1 0.0437*x(2)*x(4)*x(6)*x(6) * gobj(4)=0.0204*x(1)*x(1) + 1 0.0204*x(1)*x(2) + 1 0.0204*x(1)*x(3) + 1 0.0187*x(2)*x(3) + 1 0.0607*x(1)*x(1)*x(5)*x(5) + 1 0.0607*x(1)*x(2)*x(5)*x(5) + 1 0.0607*x(1)*x(3)*x(5)*x(5) + 1 0.0437*x(2)*x(3)*x(6)*x(6) * gobj(5)=0.0607*x(1)*x(1)*x(4)*x(5)*2.d0 + 1 0.0607*x(1)*x(2)*x(4)*x(5)*2.d0 + 1 0.0607*x(1)*x(3)*x(4)*x(5)*2.d0 * gobj(6)=0.0437*x(1)*x(2)*x(3)*x(6)*2.d0 + 1 0.0437*x(2)*x(2)*x(3)*x(6)*2.d0*1.57d0 + 1 0.0437*x(2)*x(3)*x(4)*x(6)*2.d0 * * Bounds on variables: * cb(1)=x(1) cb(2)=x(2) cb(3)=x(3) cb(4)=x(4) cb(5)=x(5) cb(6)=x(6) * * Constraints. (Inequalities): * c(1)=0.001*x(1)*x(2)*x(3)*x(4)*x(5)*x(6) - 2.07d0 c(2)=1.d0 - 1 0.00062*x(1)*x(4)*x(5)*x(5)*(x(1)+x(2)+x(3)) - 1 0.00058*x(2)*x(3)*x(6)*x(6)*(x(1)+1.57*x(2)+x(4)) * * Jacobian of the inequalities constraints: *1 gc(1)= 0.001*x(2)*x(3)*x(4)*x(5)*x(6) gc(2)=- 0.00062*x(1)*x(4)*x(5)*x(5)*2.d0 - 1 0.00062*x(2)*x(4)*x(5)*x(5) - 1 0.00062*x(3)*x(4)*x(5)*x(5) - 1 0.00058*x(2)*x(3)*x(6)*x(6) *2 gc(3)=0.001*x(1)*x(3)*x(4)*x(5)*x(6) gc(4)=- 0.00062*x(1)*x(4)*x(5)*x(5) - 1 0.00058*x(1)*x(3)*x(6)*x(6) - 1 0.00058*x(2)*x(3)*x(6)*x(6)*2.d0*1.57 - 1 0.00058*x(3)*x(4)*x(6)*x(6) *3 gc(5)=0.001*x(1)*x(2)*x(4)*x(5)*x(6) gc(6)=- 0.00062*x(1)*x(4)*x(5)*x(5) - 1 0.00058*x(1)*x(2)*x(6)*x(6) - 1 0.00058*x(2)*x(2)*x(6)*x(6)*1.57d0 - 1 0.00058*x(2)*x(4)*x(6)*x(6) *4 gc(7)=0.001*x(1)*x(2)*x(3)*x(5)*x(6) gc(8)=- 0.00062*x(1)*x(1)*x(5)*x(5) - 1 0.00062*x(1)*x(2)*x(5)*x(5) - 1 0.00062*x(1)*x(3)*x(5)*x(5) - 1 0.00058*x(2)*x(3)*x(6)*x(6) *5 gc(9)=0.001*x(1)*x(2)*x(3)*x(4)*x(6) gc(10)=-0.00062*x(1)*x(1)*x(4)*x(5)*2.d0 - 1 0.00062*x(1)*x(2)*x(4)*x(5)*2.d0 - 1 0.00062*x(1)*x(3)*x(4)*x(5)*2.d0 *6 gc(11)=0.001*x(1)*x(2)*x(3)*x(4)*x(5) gc(12)=-0.00058*x(1)*x(2)*x(3)*x(6)*2.d0 - 1 0.00058*x(2)*x(2)*x(3)*x(6)*2.d0*1.57d0 - 1 0.00058*x(2)*x(3)*x(4)*x(6)*2.d0 * return end * *--------------------------------------------------------TRAFO.for