非线性约束规划 我编制了 目标函数和约束函数 为什么在matlab中还是出错 求大神看看这不给力的
functionf=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)...
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.
求解时出现以上问题,求大神帮忙! 展开
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.
求解时出现以上问题,求大神帮忙! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询