From: JOHN pip on 1 Jun 2010 19:32 I have to solve a non-linear programming problem with three non-linear constraints and 5 linear constraints.The problem i have is when i solve it, in order to get an optimal solution using an exhaustive search without fmincon it takes dramatically less time than using an fmincon's search based on the initial points.The problem is the following: minz=(((p1)^s)*((p2)^g(1))*((p3)^g(2))*((p4)^g(3)))/ (1+(p1)*(((p1)^s)-1)/(p1-1)) +(((p1)^s)*(p2)*(((p2)^g(1))-1/(p2-1)) +(((p1)^s)*((p2)^g(1))*(p3)*(((p3)^g(2))-1)/(p3-1)) +(((p1)^s)*((p2)^g(1))*((p3)^g(2))*(p4)*(((p4)^g(3))-1)/(p4-1)) the non-linear constraints are: #1 (((p1)^s)*((p2)^g(1))*((p3)^g(2))*(p4)*(((p4)^g(3))-1)/((p4)-1))/ (1+(p1)*(((p1)^s)-1)/(p1-1)) +(((p1)^s)*(p2)*(((p2)^g(1))-1/(p2-1)) +(((p1)^s)*((p2)^g(1))*(p3)*(((p3)^g(2))-1)/(p3-1)) +(((p1)^s)*((p2)^g(1))*((p3)^g(2))*(p4)*(((p4)^g(3))-1)/(p4-1))-0.0001<=0 #2 (((p1)^s)*((p2)^g(1))*(((p3)^g(2))*(p4)*((((p4)^g(3))-1)/((p4)-1))+(p3)*((((p3)^g(2))-1)/((p3)-1))))/ (1+(p1)*(((p1)^s)-1)/(p1-1)) +(((p1)^s)*(p2)*(((p2)^g(1))-1/(p2-1)) +(((p1)^s)*((p2)^g(1))*(p3)*(((p3)^g(2))-1)/(p3-1)) +(((p1)^s)*((p2)^g(1))*((p3)^g(2))*(p4)*(((p4)^g(3))-1)/(p4-1))-0.01<=0 #3 (((p1)^s)*(((p2)^g(1))*(((p3)^g(2))*(p4)*((((p4)^g(3))-1)/((p4)-1))+(p3)*((((p3)^g(2))-1)/((p3)-1)))+(p2)*((((p2)^g(1))-1)/((p2)-1))))/ (1+(p1)*(((p1)^s)-1)/(p1-1)) +(((p1)^s)*(p2)*(((p2)^g(1))-1/(p2-1)) +(((p1)^s)*((p2)^g(1))*(p3)*(((p3)^g(2))-1)/(p3-1)) +(((p1)^s)*((p2)^g(1))*((p3)^g(2))*(p4)*(((p4)^g(3))-1)/(p4-1))-0.1<=0 where N=100; p1=5/6; p2=1/2; p3=1/4; p4=1/12; G=(g(1)+g(2)+g(3)); s=((N-G)-1); and g1 g2 g3 are the variables finally the linear constraints are: g1-g2<=-1 g2-g3<=-1 g1=>10 g1+g2+g3<90 g1+g2+g3=>33 g1,g2,g3 integers So i am wondering, is it proper for Fmincon to be slower than an exhaustive search which is considered to be an extremely simple method?Can someone tell me why something like this is happening and is it the right thing? I would higly appreciate any help or opinion because i am in a dead end.Please mention any questions you may have. Thank you in advance.
From: Matt J on 1 Jun 2010 22:21 "JOHN pip" <johny-pip(a)hotmail.com> wrote in message <hu459n$s4u$1(a)fred.mathworks.com>... > g1,g2,g3 integers > > > So i am wondering, is it proper for Fmincon to be slower than an exhaustive search which is considered to be an extremely simple method?Can someone tell me why something like this is happening and is it the right thing? ================= you're obviously not constraining the gi to integers when using fmincon because fmincon cannot process such constraints. When you constrain the gi to integers the number of feasible solutions becomes very small and easy to enumerate, so there is really no surprise that exhaustive search is faster. Also, the expressions for the nonlinear constraints are monstrous, with many repeated sub-expressions. Evaluating them iteratively in fmincon would consume much computation time if you implemented them as written, rather than carefully optimizing them.
From: John D'Errico on 1 Jun 2010 23:39 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hu4f6h$oe3$1(a)fred.mathworks.com>... > "JOHN pip" <johny-pip(a)hotmail.com> wrote in message <hu459n$s4u$1(a)fred.mathworks.com>... > > > g1,g2,g3 integers > > > > > > So i am wondering, is it proper for Fmincon to be slower than an exhaustive search which is considered to be an extremely simple method?Can someone tell me why something like this is happening and is it the right thing? > ================= > > you're obviously not constraining the gi to integers when using fmincon because fmincon cannot process such constraints. > > When you constrain the gi to integers the number of feasible solutions becomes very small and easy to enumerate, so there is really no surprise that exhaustive search is faster. > > Also, the expressions for the nonlinear constraints are monstrous, with many repeated sub-expressions. Evaluating them iteratively in fmincon would consume much computation time if you implemented them as written, rather than carefully optimizing them. > And if you are somehow TRYING to constrain the parameters to be integer, then this explains why fmincon is having a problem. It can't do that. John
From: JOHN pip on 2 Jun 2010 05:51 "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hu4jop$njm$1(a)fred.mathworks.com>... > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hu4f6h$oe3$1(a)fred.mathworks.com>... > > "JOHN pip" <johny-pip(a)hotmail.com> wrote in message <hu459n$s4u$1(a)fred.mathworks.com>... > > > > > g1,g2,g3 integers > > > > > > > > > So i am wondering, is it proper for Fmincon to be slower than an exhaustive search which is considered to be an extremely simple method?Can someone tell me why something like this is happening and is it the right thing? > > ================= > > > > you're obviously not constraining the gi to integers when using fmincon because fmincon cannot process such constraints. > > > > When you constrain the gi to integers the number of feasible solutions becomes very small and easy to enumerate, so there is really no surprise that exhaustive search is faster. > > > > Also, the expressions for the nonlinear constraints are monstrous, with many repeated sub-expressions. Evaluating them iteratively in fmincon would consume much computation time if you implemented them as written, rather than carefully optimizing them. > > > > And if you are somehow TRYING to constrain the parameters > to be integer, then this explains why fmincon is having a > problem. It can't do that. > > John So if fmincon isn't appropriate for this type of problem can you propose another matlab function?
From: JOHN pip on 2 Jun 2010 06:12 "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hu4jop$njm$1(a)fred.mathworks.com>... > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hu4f6h$oe3$1(a)fred.mathworks.com>... > > "JOHN pip" <johny-pip(a)hotmail.com> wrote in message <hu459n$s4u$1(a)fred.mathworks.com>... > > > > > g1,g2,g3 integers > > > > > > > > > So i am wondering, is it proper for Fmincon to be slower than an exhaustive search which is considered to be an extremely simple method?Can someone tell me why something like this is happening and is it the right thing? > > ================= > > > > you're obviously not constraining the gi to integers when using fmincon because fmincon cannot process such constraints. > > > > When you constrain the gi to integers the number of feasible solutions becomes very small and easy to enumerate, so there is really no surprise that exhaustive search is faster. > > > > Also, the expressions for the nonlinear constraints are monstrous, with many repeated sub-expressions. Evaluating them iteratively in fmincon would consume much computation time if you implemented them as written, rather than carefully optimizing them. > > > > And if you are somehow TRYING to constrain the parameters > to be integer, then this explains why fmincon is having a > problem. It can't do that. > > John And can i somehow constrain gi to integers when using fmincon in order to reduce the number of feasibles solutions?Is there any option that can do this?
|
Next
|
Last
Pages: 1 2 3 Prev: Dicomread changes pixel values! Next: Testing for block diagonal form |