fmincon solver stopping criteria issue

1 次查看(过去 30 天)
Hello all,
I am trying to solve one optimization problem using fmincon solver. During the analysis I am getting exit flag as -2. Which means the optimization is incomplete. When I analyzed my fmincon function, I am getting following message:
No feasible solution found.
fmincon stopped because the predicted change in the objective function is less than the default value of the function tolerance but constraints are not satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
Can somebody guide me how to resolve this issue? I want to increase default function tolerance value, so that my constraint tolerance values are also satisfied by fmincon solver.
Thanks in advance,
Nikhil

回答(1 个)

Walter Roberson
Walter Roberson 2014-1-4
See optimset to construct an options structure to pass to the fmincon() call.
  1 个评论
Nikhil
Nikhil 2014-1-5
Hey,
Thanks for your suggestion. I tried this approach also. But still I am getting same type of error. Max fun eval limit is reached something like that. I think the real issue is my problem is not well defined, that is why I am getting so many errors. I tried to fix this at my end, but didn't work out. I am providing my code over here, if you could find something inappropriate please guide me about the same.
z=16; KN1=4.5080e+005; alpha=40; Fr=17800;
Fa=17800;
[dr, Epsi,g]=opt();
function [dopt,EPSI,exitflag] = opt()
dr0=[0.05 0.08];
lb=[0 0];
ub=[1 1];
alpha=alpha*pi/180;
Options=optimset('Algorithm','active-set','Display','Iter','TolFun',1e-12,'MaxFunEvals',1000, 'TolCon',1e-12,'TolX',1e-15);
[dopt,fval,exitflag]=fmincon(@myfun,dr0,[],[],[],[],lb,ub,@mycon,Options);
EPSI=myfun(dopt);
end
function epsi=myfun(dr)
epsi=0.5*(1+dr(1)*tan(alpha)/(dr(2)));
end
function [c,ceq]=mycon(dr)
phi1=acos(-dr(1)*tan(alpha)/dr(2));
epsi=0.5*(1+(dr(1)*tan(alpha)/dr(2)));
c(1)=-dr(1)*tan(alpha)/dr(2);
c(2)=abs(-dr(1)*tan(alpha)/dr(2))-1;
c(3)=-1+(0.5/epsi).*(1-cos(phi1));% to check integrand is positive for each guess of dr.
c(4)=-dr(1);
c(5)=-dr(2);
funr=@(theta)((1/(2*pi)).*(1-(0.5/epsi).*(1-cos(theta))).^(1.5).*cos(theta));
Jr=quad(funr,-phi1,phi1);
funa=@(beta)((1/(2*pi)).*(1-(0.5/epsi).*(1-cos(beta))).^(1.5));
Ja=quad(funa,-phi1,phi1);
ceq(1)=(Z*KN1*(dr(1)*sin(alpha)+dr(2)*cos(alpha))^(1.5)*real(Jr))*cos(alpha)-Fr;
ceq(2)=(Z*KN1*(dr(1)*sin(alpha)+dr(2)*cos(alpha))^(1.5)*real(Ja))*sin(alpha)-Fa;
end
My problem is I want to solve for dr which is two dimensional vector using fmincon solver. The answers which I am getting are not satisfying the constraints completely. Ideally dr should never have negative component, but one of the component in final answer is coming out to be negative. Kindly help me to fix this issue. Thank you in advance,
Nikhil

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by