*----------------------------------------------------------- * Date created: February 19, 1996 * * Example from K. Schittkowski, * More Test Examples for Nonlinear Programming Codes. * Springer Verlag, 1987, Problem 376, pp.195 * * Optimization of a multi-spindle automatic lathe. * * 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 from K., Schittkowski.') write(1,11) 11 format(5x,'More Test Examples for Nonlinear Programming', 1 ' Codes.') write(1,12) 12 format(5x,'Springer Verlag, 1987.') write(1,13) 13 format(5x,'Problem 376, pp.195.') * * Dimension of the problem: * n=10 m=14 me=1 mb=20 nszc=48 nsze=2 * * Initial point: * x(1)=9.9999d0 x(2)=0.005d0 x(3)=0.0080d0 x(4)=100.d0 x(5)=0.001699d0 x(6)=0.001299d0 x(7)=0.002699d0 x(8)=0.00199d0 x(9)=0.99d0 x(10)=0.999d0 * * 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 *1 icgc(1)=1 icgc(2)=2 icgc(3)=3 icgc(4)=4 icgc(5)=5 *2 icgc(6)=6 icgc(7)=7 icgc(8)=8 icgc(9)=9 icgc(10)=10 icgc(11)=11 icgc(12)=12 icgc(13)=13 *3 icgc(14)=1 icgc(15)=10 icgc(16)=11 icgc(17)=12 icgc(18)=13 icgc(19)=14 *4 icgc(20)=1 icgc(21)=2 icgc(22)=3 icgc(23)=4 icgc(24)=5 icgc(25)=6 icgc(26)=7 icgc(27)=8 icgc(28)=9 icgc(29)=10 icgc(30)=11 icgc(31)=12 icgc(32)=13 icgc(33)=14 *5 icgc(34)=2 icgc(35)=6 icgc(36)=14 *6 icgc(37)=3 icgc(38)=7 icgc(39)=14 *7 icgc(40)=4 icgc(41)=8 *8 icgc(42)=5 icgc(43)=9 icgc(44)=14 *9 icgc(45)=2 icgc(46)=6 *10 icgc(47)=3 icgc(48)=7 * * Starting address of columns of the Jacobian of the Inequalities * ipgc(1)=1 ipgc(2)=6 ipgc(3)=14 ipgc(4)=20 ipgc(5)=34 ipgc(6)=37 ipgc(7)=40 ipgc(8)=42 ipgc(9)=45 ipgc(10)=47 ipgc(11)=49 * * Rows indices of the nonzeros of the Jacobian of the Equalities * icge(1)=1 icge(2)=1 * * Starting address of columns of the Jacobian of the Equalities * ipge(1)=0 ipge(2)=0 ipge(3)=0 ipge(4)=0 ipge(5)=0 ipge(6)=0 ipge(7)=0 ipge(8)=0 ipge(9)=1 ipge(10)=2 ipge(11)=3 * return end * *-------------------------------------------------------------- * Date created: February 19, 1996 * Example from K., Schittkowski: Problem 376, pp.195 *-------------------------------------------------------------- * 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.15d0*x(1)+14.d0*x(2)-0.06 t2=0.002d0+x(1)+60.d0*x(2) * objf=-20000.d0*t1/t2 * gobj(1)=-20000.d0*(0.15d0*t2-t1)/(t2*t2) gobj(2)=-20000.d0*(14.d0*t2-60.d0*t1)/(t2*t2) gobj(3)=0.d0 gobj(4)=0.d0 gobj(5)=0.d0 gobj(6)=0.d0 gobj(7)=0.d0 gobj(8)=0.d0 gobj(9)=0.d0 gobj(10)=0.d0 * * Bounds on variables: * cb(1)=x(1) cb(2)=10.d0-x(1) cb(3)=x(2) cb(4)=0.1-x(2) cb(5)=x(3)-0.5e-04 cb(6)=0.0081-x(3) cb(7)=x(4)-10.d0 cb(8)=1000.d0-x(4) cb(9)=x(5)-0.5e-04 cb(10)=0.0017-x(5) cb(11)=x(6)-0.5e-04 cb(12)=0.0013-x(6) cb(13)=x(7)-0.5e-04 cb(14)=0.0027-x(7) cb(15)=x(8)-0.5e-04 cb(16)=0.002-x(8) cb(17)=x(9)-0.5e-04 cb(18)=1.d0-x(9) cb(19)=x(10)-0.5e-04 cb(20)=1.d0-x(10) * * Constraints. (Inequalities): * c(1)=x(1)-0.75d0/(x(3)*x(4)) c(2)=x(1)-x(9)/(x(4)*x(5)) c(3)=x(1)-x(10)/(x(4)*x(6))-10.d0/x(4) c(4)=x(1)-0.19d0/(x(4)*x(7))-10.d0/x(4) c(5)=x(1)-0.125d0/(x(4)*x(8)) c(6)=10000.d0*x(2)-0.00131d0*x(9)*(x(5)**0.666)*(x(4)**1.5) c(7)=10000.d0*x(2)-0.001038d0*x(10)*(x(6)**1.6)*(x(4)**3) c(8)=10000.d0*x(2)-0.000223d0*(x(7)**0.666)*(x(4)**1.5) c(9)=10000.d0*x(2)-0.000076*(x(8)**3.55)*(x(4)**5.66) c(10)=10000.d0*x(2)-0.000698*(x(3)**1.2)*x(4)*x(4) c(11)=10000.d0*x(2)-0.00005*(x(3)**1.6)*(x(4)**3) c(12)=10000.d0*x(2)-0.00000654*(x(3)**2.42)*(x(4)**4.17) c(13)=10000.d0*x(2)-0.000257*(x(3)**0.666)*(x(4)**1.5) c(14)=30.d0-2.003d0*x(4)*x(5)-1.885d0*x(4)*x(6)- 1 0.184d0*x(4)*x(8)-2.d0*x(4)*(x(3)**0.803) * * Jacobian of the inequalities constraints: *1 gc(1)=1.d0 gc(2)=1.d0 gc(3)=1.d0 gc(4)=1.d0 gc(5)=1.d0 *2 gc(6)=10000.d0 gc(7)=10000.d0 gc(8)=10000.d0 gc(9)=10000.d0 gc(10)=10000.d0 gc(11)=10000.d0 gc(12)=10000.d0 gc(13)=10000.d0 *3 gc(14)=0.75d0/(x(3)*x(3)*x(4)) gc(15)=-0.000698d0*1.2d0*(x(4)**2)*(x(3)**0.2) gc(16)=-0.00005d0*1.6d0*(x(4)**3)*(x(3)**0.6) gc(17)=-0.00000654d0*2.42d0*(x(3)**1.42)*(x(4)**4.17) gc(18)=-0.000257*0.666*(x(4)**1.5)/(x(3)**0.334) gc(19)=-2.d0*0.803d0*x(4)/(x(3)**0.197) *4 gc(20)=0.75d0/(x(3)*x(4)*x(4)) gc(21)=x(9)/(x(4)*x(4)*x(5)) gc(22)=x(10)/(x(6)*x(4)*x(4))+10.d0/(x(4)**2) gc(23)=0.19/(x(4)*x(4)*x(7))+10.d0/(x(4)**2) gc(24)=0.125d0/(x(4)*x(4)*x(8)) gc(25)=-0.00131d0*1.5d0*x(9)*(x(5)**0.666)*(x(4)**0.5) gc(26)=-0.001038d0*3.d0*x(10)*(x(6)**1.6)*(x(4)**2) gc(27)=-0.000223*1.5d0*(x(7)**0.666)*(x(4)**0.5) gc(28)=-0.000076*5.66d0*(x(8)**3.55)*(x(4)**4.66) gc(29)=-0.000698*2.d0*(x(3)**1.2)*x(4) gc(30)=-0.00005d0*3.d0*(x(3)**1.6)*(x(4)**2) gc(31)=-0.00000654*4.17d0*(x(3)**2.42)*(x(4)**3.17) gc(32)=-0.000257*1.5d0*(x(3)**0.666)*(x(4)**0.5) gc(33)=-2.003d0*x(5)-1.885d0*x(6)-0.184d0*x(8)-2.d0*(x(3)**0.803) *5 gc(34)=x(9)/(x(5)*x(5)*x(4)) gc(35)=-0.00131*x(9)*(x(4)**1.5)/(x(5)**0.334) gc(36)=-2.003d0*x(4) *6 gc(37)=x(10)/(x(4)*x(6)*x(6)) gc(38)=-0.001038d0*1.6d0*(x(4)**3)*(x(6)**0.6)*x(10) gc(39)=-1.885d0*x(4) *7 gc(40)=0.19d0/(x(4)*x(7)*x(7)) gc(41)=-0.000223d0*0.666*(x(4)**1.5)/(x(7)**0.334) *8 gc(42)=0.125d0/(x(4)*x(8)*x(8)) gc(43)=-0.000076d0*3.55d0*(x(8)**2.55)*(x(4)**5.66) gc(44)=-0.184d0*x(4) *9 gc(45)=-1.d0/(x(4)*x(5)) gc(46)=-0.00131d0*(x(5)**0.666)*(x(4)**1.5) *10 gc(47)=-1.d0/(x(4)*x(6)) gc(48)=-0.001038d0*(x(6)**1.6)*(x(4)**3) * * Constraints. (Equality): * e(1)=x(9)+x(10)-0.225d0 * * Jacobian of the equalities constraints: * ge(1)=1.d0 ge(2)=1.d0 * return end *-------------------------------------------------S376.for