*------------------------------------------------------------ * Date created: October 10, 1996. * Date modified: February 16, 2001 * * Static Power Scheduling * * Hock - Schittkowski, * Test Examples for Nonlinear Programming. * Springer-Verlag, 1981. * Problem 107, Page 116. * * 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 * * Remark: I have considered another initial feasible * point not very different from that given by * Hock & Schittkowski *------------------------------------------------------------ * 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 107, Hock-Schittkowski pp.116') write(1,14) 14 format(5x,'Static Power Scheduling') * * Dimension of the problem: * n=9 ! No. of variables. m=0 ! No. of inequality constraints. me=6 ! No. of equality constraints. mb=8 ! No. of simple bounds on variables. nszc=0 ! No. of non-zeros in Jacobian of c(x)>=0. nsze=34 ! No. of non-zeros in Jacobian of e(x) =0. * * Initial point: * x(1) = 0.8d0 x(2) = 0.8d0 x(3) = 0.2d0 x(4) = 0.2d0 x(5) = 1.0454d0 x(6) = 1.0454d0 x(7) = 0.99d0 x(8) = 0.1d0 x(9) = 0.1d0 * * Index vector for simple bounds: cb >= 0. * sb(1)=1 sb(2)=2 j=3 do i=5,7 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)=4 icge(4)=5 icgc(5)=1 icge(6)=2 icge(7)=3 icge(8)=4 icge(9)=5 icge(10)=6 icge(11)=1 icge(12)=2 icge(13)=3 icge(14)=4 icge(15)=5 icge(16)=6 icge(17)=1 icge(18)=2 icge(19)=3 icge(20)=4 icge(21)=5 icge(22)=6 icge(23)=1 icge(24)=2 icge(25)=3 icge(26)=4 icge(27)=5 icge(28)=6 icge(29)=1 icge(30)=2 icge(31)=3 icge(32)=4 icge(33)=5 icge(34)=6 * * 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 ipge(6)=11 ipge(7)=17 ipge(8)=23 ipge(9)=29 ipge(10)=35 * * return end * *-------------------------------------------------------------- * Date created: October 10, 1996 * Date modified: February 16, 2001 * * Generated in: * Bayreuth University, Mathematics Department, * Professor Klaus Schittkowski * Problem 107. (Static Power Scheduling) * Hock - Schittkowski, pp.116. *-------------------------------------------------------------- * 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) * real*8 c1,d * * Objective function and its gradient: * objf = 3000.d0*x(1) + 1000.000d0*x(1)*x(1)*x(1) + 1 2000.d0*x(2) + 666.667d0*x(2)*x(2)*x(2) gobj(1)= 3000.d0 + 3000.d0*x(1)*x(1) gobj(2)= 2000.d0 + 3.d0*666.667d0*x(2)*x(2) 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 * * Bounds on variables: * cb(1) = x(1) cb(2) = x(2) j=3 do i=5,7 cb(j)=x(i)-0.90909d0 cb(j+1)=1.0909d0-x(i) j=j+2 end do * * Constraints. (Inequalities): * * * Jacobian of the inequalities constraints: * * * Constraints. (Equalities): * c1=(48.4d0/50.176d0)*dsin(0.25d0) d =(48.4d0/50.176d0)*dcos(0.25d0) * e(1) = 0.4d0 - x(1) + 2.d0*c1*x(5)*x(5) - 1 x(5)*x(6)*(d*dsin(x(8)) + c1*dcos(x(8))) - 1 x(5)*x(7)*(d*dsin(x(9)) + c1*dcos(x(9))) e(2) = 0.4d0 - x(2) + 2.d0*c1*x(6)*x(6) + 1 x(5)*x(6)*(d*dsin(x(8)) - c1*dcos(x(8))) + 1 x(6)*x(7)*(d*dsin(x(8)-x(9)) - c1*dcos(x(8)-x(9))) e(3) = 0.8d0 + 2.d0*c1*x(7)*x(7) + 1 x(5)*x(7)*(d*dsin(x(9)) - c1*dcos(x(9))) - 1 x(6)*x(7)*(d*dsin(x(8)-x(9)) + c1*dcos(x(8)-x(9))) e(4) = 0.2d0 - x(3) + 2.d0*d*x(5)*x(5) + 1 x(5)*x(6)*(c1*dsin(x(8)) - d*dcos(x(8))) + 1 x(5)*x(7)*(c1*dsin(x(9)) - d*dcos(x(9))) e(5) = 0.2d0 - x(4) + 2.d0*d*x(6)*x(6) - 1 x(5)*x(6)*(c1*dsin(x(8)) + d*dcos(x(8))) - 1 x(6)*x(7)*(c1*dsin(x(8)-x(9)) + d*dcos(x(8)-x(9))) e(6) = -0.337d0 + 2.d0*d*x(7)*x(7) - 1 x(5)*x(7)*(c1*dsin(x(9)) + d*dcos(x(9))) + 1 x(6)*x(7)*(c1*dsin(x(8)-x(9)) - d*dcos(x(8)-x(9))) * Jacobian of the equalities constraints: * C1ok ge(1)= -1.d0 C2ok ge(2)= -1.d0 C3ok ge(3)= -1.d0 C4ok ge(4)= -1.d0 C5ok ge(5)= 4.d0*c1*x(5) - x(6)*d*dsin(x(8)) - 1 x(6)*c1*dcos(x(8)) - 1 x(7)*d*dsin(x(9)) - 1 x(7)*c1*dcos(x(9)) ge(6)= x(6)*d*dsin(x(8)) - 1 x(6)*c1*dcos(x(8)) ge(7)= x(7)*d*dsin(x(9)) - 1 x(7)*c1*dcos(x(9)) ge(8)= 4.d0*d*x(5) + 1 x(6)*c1*dsin(x(8)) - 1 x(6)*d*dcos(x(8)) + 1 x(7)*c1*dsin(x(9)) - 1 x(7)*d*dcos(x(9)) ge(9)= -x(6)*c1*dsin(x(8)) - 1 x(6)*d*dcos(x(8)) ge(10)= -x(7)*c1*dsin(x(9)) - 1 x(7)*d*dcos(x(9)) C6ok ge(11)= -x(5)*d*dsin(x(8)) - x(5)*c1*dcos(x(8)) ge(12)= 4.d0*c1*x(6) + x(5)*d*dsin(x(8)) - 1 x(5)*c1*dcos(x(8)) + 1 x(7)*d*dsin(x(8)-x(9)) - 1 x(7)*c1*dcos(x(8)-x(9)) ge(13)= -x(7)*d*dsin(x(8)-x(9)) - 1 x(7)*c1*dcos(x(8)-x(9)) ge(14)= x(5)*c1*dsin(x(8)) - x(5)*d*dcos(x(8)) ge(15)= 4.d0*d*x(6) - x(5)*c1*dsin(x(8)) - 1 x(5)*d*dcos(x(8)) - 1 x(7)*c1*dsin(x(8)-x(9)) - 1 x(7)*d*dcos(x(8)-x(9)) ge(16)= x(7)*c1*dsin(x(8)-x(9)) - x(7)*d*dcos(x(8)-x(9)) C7ok ge(17)= -x(5)*d*dsin(x(9)) - x(5)*c1*dcos(x(9)) ge(18)= x(6)*d*dsin(x(8)-x(9)) - x(6)*c1*dcos(x(8)-x(9)) ge(19)= 4.d0*c1*x(7) + x(5)*d*dsin(x(9)) - 1 x(5)*c1*dcos(x(9)) - 1 x(6)*d*dsin(x(8)-x(9)) - 1 x(6)*c1*dcos(x(8)-x(9)) ge(20)= x(5)*c1*dsin(x(9)) - x(5)*d*dcos(x(9)) ge(21)= -x(6)*c1*dsin(x(8)-x(9)) - x(6)*d*dcos(x(8)-x(9)) ge(22)= 4.d0*d*x(7) - x(5)*c1*dsin(x(9)) - x(5)*d*dcos(x(9)) + 1 x(6)*c1*dsin(x(8)-x(9)) - 1 x(6)*d*dcos(x(8)-x(9)) C8ok ge(23)= -x(5)*x(6)*d*dcos(x(8)) + 1 x(5)*x(6)*c1*dsin(x(8)) ge(24)= x(5)*x(6)*d*dcos(x(8)) + x(5)*x(6)*c1*dsin(x(8)) + 1 x(6)*x(7)*d*dcos(x(8)-x(9)) + 1 x(6)*x(7)*c1*dsin(x(8)-x(9)) ge(25)= -x(6)*x(7)*d*dcos(x(8)-x(9)) + 1 x(6)*x(7)*c1*dsin(x(8)-x(9)) ge(26)= x(5)*x(6)*c1*dcos(x(8)) + x(5)*x(6)*d*dsin(x(8)) ge(27)= -x(5)*x(6)*c1*dcos(x(8)) + x(5)*x(6)*d*dsin(x(8)) - 1 x(6)*x(7)*c1*dcos(x(8)-x(9)) + 1 x(6)*x(7)*d*dsin(x(8)-x(9)) ge(28)= x(6)*x(7)*c1*dcos(x(8)-x(9)) + 1 x(6)*x(7)*d*dsin(x(8)-x(9)) C9 ge(29)= -x(5)*x(7)*d*dcos(x(9)) + x(5)*x(7)*c1*dsin(x(9)) ge(30)= -x(6)*x(7)*d*dcos(x(8)-x(9)) - 1 x(6)*x(7)*c1*dsin(x(8)-x(9)) ge(31)= x(5)*x(7)*d*dcos(x(9)) + x(5)*x(7)*c1*dsin(x(9)) + 1 x(6)*x(7)*d*dcos(x(8)-x(9)) - 1 x(6)*x(7)*c1*dsin(x(8)-x(9)) ge(32)= x(5)*x(7)*c1*dcos(x(9)) + x(5)*x(7)*d*dsin(x(9)) ge(33)= x(6)*x(7)*c1*dcos(x(8)-x(9)) - 1 x(6)*x(7)*d*dsin(x(8)-x(9)) ge(34)= -x(5)*x(7)*c1*dcos(x(9)) + x(5)*x(7)*d*dsin(x(9)) - 1 x(6)*x(7)*c1*dcos(x(8)-x(9)) - 1 x(6)*x(7)*d*dsin(x(8)-x(9)) * return end *-------------------------------------------------------SPS.for