有约束非线性最优问题求解出现错误

目标函数m文件为
function f=myfun(x)
f=0.192457*1e-4*(x(2)+2)*x(1)^2*x(3);
end
非线性约束m文件为
function [c,ceq]=mycon(x)
c(1)=350-163*x(1)^(-2.86)*x(3)^0.86;
c(2)=10-0.4*0.01*x(1)^(-4)*x(2)*x(3)^3;
c(3)=(x(2)+1.5)*x(1)+0.44*0.01*x(1)^(-4)*x(2)*x(3)^3-3.7*x(3);
c(4)=375-0.356*1e6*x(1)*x(2)^(-1)*x(3)^(-2);
c(5)=4-x(3)/x(1);
ceq=[];
end
设置线性约束系数,
A=[-1 0 0
1 0 0
0 -1 0
0 1 0
0 0 -1
0 0 1];
b=[-1;4;-4.5;50;-10;30]; %线性约束
x0=[2.0;5.0;25.0]; %初值
lb=zeros(3,1); %变量下限约束
[x,fval,exitflag,output,lambda]=fmincon(@myfun,x0,A,b,[],[],lb,[],@mycon); %调用优化过程
总是报错:
Warning: The default trust-region-reflective algorithm does not solve
problems with the constraints you have specified. FMINCON will use the
active-set algorithm instead. For information on applicable algorithms,
see Choosing the Algorithm in the documentation.
> In fmincon at 504
Warning: Your current settings will run a different algorithm
(interior-point) in a future release.
> In fmincon at 509
Local minimum possible. Constraints satisfied.
fmincon stopped because the predicted change in the objective function
is less than the default value of the function tolerance and constraints
are satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
Active inequalities (to within options.TolCon = 1e-06):
lower upper ineqlin ineqnonlin
3

 采纳的回答

N/A
N/A 2022-11-15

0 个投票

trust-region-reflective算法不合适,换换算法。fmincon前面加一句: options=optimset('Algorithm','sqp')
然后:[x,fval,exitflag,output,lambda]=fmincon(@myfun,x0,A,b,[],[],lb,[],@mycon,options)

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Surrogate Optimization 的更多信息

标签

提问:

N/A
2022-11-15

回答:

N/A
2022-11-15

Community Treasure Hunt

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

Start Hunting!