Constraint optimization problem, fmincon, converged to an infeasible point.-?
Ältere Kommentare anzeigen
Hi
I'm having trouble with an exercise. I don't know how to use the starting guess value x0. When I run it I get this:
_Converged to an infeasible point.
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>_
Although I get final values I am not sure they are right because of this message I get. These are the values: yopt=6.1011; zopt=0.1098; fval=3.9996.
First I have the cost function, then the constraints function, and the script file to obtain the optimized value:
function [ J ] = objfun( x )
%Objective function
P=25.0231; E=2; h=2;
J=((P*h)/E)*(1/(x(1)+sqrt(2)*x(2)));
end
function [ c,ceq ]=confun( x )
%Non-linear constraints
%Constraint functions
S=0.0092; P=25.0231;
c= [(P*(x(2)+x(1)*sqrt(2))/(x(1)^2*sqrt(2)+2*x(1)*x(2)))-17.5;
(P/(x(1)+x(2)*sqrt(2)))-17.5*(1+0.1*S);
(P/x(1)^2*sqrt(2)+2*x(1)*x(2))-1.2;
0.2-x(1);
x(1)-6*(1+0.2*S);
0.2*(1-0.1*S)-x(2);
x(2)-6];
ceq=[];
end
S=0.0092
P=25*(1+0.1*S);
x0=[3 3]; %Starting guess
options=optimset('Algorithm','active-set');
[x,fval]=fmincon(@objfun,x0,[],[],[],[],[],[],@confun,options);
%Solution x and function value fval
yopt=x(1);zopt=x(2);
P.s. I would also like to know how to use the command Global in this exercise, for P and S, as they repeat in both function files and script file; and it looks much better.
2 Kommentare
Walter Roberson
am 21 Feb. 2016
Do not use "global" for that purpose; see http://www.mathworks.com/help/matlab/math/parameterizing-functions.html
George Schwarzenneger
am 21 Feb. 2016
Akzeptierte Antwort
Weitere Antworten (1)
George Schwarzenneger
am 22 Feb. 2016
0 Stimmen
Kategorien
Mehr zu Solver Outputs and Iterative Display finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!