非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的function f=jsq_f(x);f=pi*(4.14*x(1)+2.5)^2*x(2)*x(3)^2/4;function[c,ceq]=jsq_y(x);c(1)=5*x(3)-x(2);c(2)=x(2)-17*x(3);c(3)=6
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 09:57:13
非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的function f=jsq_f(x);f=pi*(4.14*x(1)+2.5)^2*x(2)*x(3)^2/4;function[c,ceq]=jsq_y(x);c(1)=5*x(3)-x(2);c(2)=x(2)-17*x(3);c(3)=6
非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的
function f=jsq_f(x);
f=pi*(4.14*x(1)+2.5)^2*x(2)*x(3)^2/4;
function[c,ceq]=jsq_y(x);
c(1)=5*x(3)-x(2);
c(2)=x(2)-17*x(3);
c(3)=6.35*10^5-x(1)^2*x(2)*x(3)^2;
c(4)=13432.29*(4.69-0.63*log(x(1)))-x(1)*x(2)*x(3)^2;
ceq=[];
x0=[17;87;5];
lb=[17;10;2];
ub=[50;100;6];
a=zeros(6,3);
a(1,1)= -1;a(2,1)=1;
a(3,2)= -1;a(4,2)=1;
a(5,3)= -1;a(6,3)=1;
b=[-17;50;-10;100;-2;6];
[x,fval]=fmincon(@jsq_f,x0,a,b,[ ],[ ],lb,ub,@jsq_y);
出现
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
In jsq_fy at 9
Warning:Your current settings will run a different algorithm (interior-point) in a future release.
> In fmincon at 509
In jsq_fy at 9
Local minimum possible.Constraints satisfied.
fmincon stopped because the size of the current search direction is less than
twice the default value of the step size tolerance and constraints are
satisfied to within the default value of the constraint tolerance.
非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的function f=jsq_f(x);f=pi*(4.14*x(1)+2.5)^2*x(2)*x(3)^2/4;function[c,ceq]=jsq_y(x);c(1)=5*x(3)-x(2);c(2)=x(2)-17*x(3);c(3)=6
目标函数和约束函数