24小时热门版块排行榜    

查看: 379  |  回复: 1

mz1179

新虫 (初入文坛)

[求助] 优化模型出现错误,各位大神帮忙指导下,谢谢 已有1人参与

function f=bibi_mubiao(x)
f=pi*(x(2)^2+0.875*x(1)^2)*x(3)+x(3)*x(4)*(x(1)-x(2))^2*(0.5-(x(1)-x(2))/(96*x(5))-(x(1)-x(2))^3/(10240*x(5)^3));

function [g,ceq]=bibi_yueshu(x)
g(1)=3082131360*(x(2)+x(5))-3200*x(2)^2*x(3)*x(4)*x(5)*tan(4*pi/180);
g(2)=210000-506.25*x(2)^3;
g(3)=x(1)-x(2)-4*cos(4*pi/180)*tan(5*pi/(6*x(4)))*(x(2)-x(5)-sqrt(x(5)^2-((x(2)-x(5))/(4*cos(4*pi/180)))^2));
ceq=[];

x0=[35.135,27.3825,6.6500,24,4.5000];
A=[-1,1,0,0,1;1,-1,0,0,-2];
b=[0;0];
[x,fval,exitflag,outflag]=fmincon(@bibi_mubiao,x0,A,b,[],[],[],[],@bibi_yueshu)

我编辑了三个M文件,但是在命令窗口输出bibi运行时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 500
  In bibi at 4
Warning: Your current settings will run a different algorithm (interior-point)
in a future release.
> In fmincon at 505
  In bibi at 4
matlab完全没什么基础,照着一个例子编的。这是出现什么问题?各位大神帮忙看看程序编辑哪里有问题?万分感谢

优化模型出现错误,各位大神帮忙指导下,谢谢
模型.jpg
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

shenyxtata

金虫 (正式写手)

【答案】应助回帖

感谢参与,应助指数 +1
这些信息本身不意味着有问题,但是你的g6没有加到约束里。第7个参数应该是zeros(5,1),第8个参数Inf
2楼2015-10-22 21:02:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 mz1179 的主题更新
信息提示
请填处理意见