请教fmincon,No feasible solution found。
Show older comments
程序代码:global l xc;%全局变量
l=0.3;
xc =[3.4200;1.7100];
g1=@(x)(((x(1)-xc(1))/l)^2*(x(2)-xc(2))/l/20-1)
x0=xc;
XW=[0.9;0.9];
xl=xc-XW
xr=xc+XW
opts=optimset('Algorithm','active-set');
[x1,gx1]=fmincon(g1,x0,[],[],[],[],[xl(1);xl(2)],[xr(1);xr(2)],@Reliability_Assessment,opts);
function [cx,ceqx]=Reliability_Assessment(x)
%xc=[3.1623;4.7434;3.1623];
global l xc;%全局变量
cx=[];
% ceqx=[-gst1];
ceqx(1)=((x(1)-xc(1))/l)^2+((x(2)-xc(2))/l)^2-9;
出现的问题:不能求解,请问该如何修改,谢谢。具体提示如下
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
were not satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
Accepted Answer
More Answers (0)
Categories
Find more on Aerospace Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!