|
汽车零部件采购、销售通信录 填写你的培训需求,我们帮你找 招募汽车专业培训老师
目标函数
function f=myfun(x)
f =(x(4)/(8*0.3))*((x(2)-sin(x(2))*cos(x(3)))/(sin(x(2)/2)*sin(x(3)/2)))-((2*x(1)^2*0.3)/(x(4)*x(5))*((sin(x(2)/2)*sin(x(3)/2))/(x(2)-sin(x(2))*cos(x(3))))*(1-(x(4)/x(1))*cos(x(2)/2)*cos(x(3)/2))^2);
约束条件
function[c,ceq]=myconfun(x)
c(1) =0.3-(2*x(2)*(x(4)^2)-(x(4)*(2*(x(4))^2-(x(5))^2)*sin(x(2))))/((4*x(1)*x(5)*sin(x(2)/2))-(x(5)*sqrt(4*(x(4)^2)-(x(5)^2)*sin(x(2)))));
c(2) =(x(4)*x(2))/(x(5)*sin(x(2)/2))-2;
c(3) =(1500*(27.8^2))/(8*4.73*x(1)*50*x(2))-1.8;
c(4) =((2*x(5)^2*311*sin(x(2)/2))/(50*x(2)*(2*x(4)^2*x(2)-(2*x(4)^2-x(5)^2+0.3*x(5)*sqrt(4*x(4)^2-x(5)^2))*sin(x(2))-4*x(1)*0.3*x(5)*sin(x(2)/2))))-1.6;
c(5) =(1134*4)/(1500*x(1))-0.9;
ceq=[];
运行
x0=[121,1.6,3.7,102,195];
lb=[120;1.59;3.5;100;192];
ub=[130;2.09;4.37;108;208];
[x,fval,exitflag,output]=fmincon('myfun',x0,[],[],[],[],lb,ub,'myconfun');
为什么运行之后显示的是
Warning: Trust-region-reflective algorithm does not solve this type of
problem, using active-set algorithm. You could also try the interior-point
or sqp algorithms: set the Algorithm option to 'interior-point' or 'sqp'
and rerun. For more help, see Choosing the Algorithm in the documentation.
> In fmincon at 472
In Untitled5 at 4
我是MATLAB的新手,有点搞不懂了,请各位高手帮帮忙,分析分析
|
|