Filter löschen
Filter löschen

fmincon solver stopping criteria issue

1 Ansicht (letzte 30 Tage)
Nikhil
Nikhil am 4 Jan. 2014
Kommentiert: Nikhil am 5 Jan. 2014
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

Antworten (1)

Walter Roberson
Walter Roberson am 4 Jan. 2014
See optimset to construct an options structure to pass to the fmincon() call.
  1 Kommentar
Nikhil
Nikhil am 5 Jan. 2014
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

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by