目标函数 function y =myfun11(x)Z=10;m=5;ha=1;PI=3.;th=20*PI/180;rb1=m*Z*cos(th)/2;rb2=m*Z*cos(th)/2;ra1=m*Z/2+ha*m+x(1)*m;ra2=m*Z/2-ha*m+x(2)*m;rfa1=acos(rb1https://muchong.com/ra1);rfa2=acos(rb2https://muchong.com/ra2);y=-(Z*(tan(rfa1)-tan(rfa2))/2/PI+(m*((x(2)-x(1))*sin(th)-(x(3)+x(4))*(cos(th))/2))/PI/m/cos(th));/约束函数:
function [c] =mycon11(x)
Z=10;
m=5;
ha=1;
PI=3.;
th=20*PI/180;
rb1=m*Z*cos(th)/2;
rb2=m*Z*cos(th)/2;
ra1=m*Z/2+ha*m+x(1)*m;
ra2=m*Z/2-ha*m+x(2)*m;
rfa1=acos(rb1https://muchong.com/ra1);
rfa2=acos(rb2https://muchong.com/ra2);
da1=m*Z+2*ha*m+x(1)*m;
da2=m*Z-2*ha*m+x(2)*m;
c=[ x(2)-x(1)-(Z*tan(rfa2)-(x(3)+x(4)))/2/(tan(th));
0.1*m-(da1/Z)https://muchong.com/(PI/2+2*x(1)*tan(th)-x(3)+Z*(tan(th)-th-tan(rfa1)+rfa1));
0.1*m-(da2/Z)https://muchong.com/(PI/2-2*x(2)*tan(th)-x(4)-Z*(tan(th)-th-tan(rfa2)+rfa2));
abs(m*((x(2)-x(1))*sin(th)-(x(3)+x(4))*(cos(th))/2)-2.5)-0.001];
帮忙看看啥 问题啊???谢谢了
到此这篇matlab中ga函数输入参数太多(matlab函数输入参数不足)的文章就 介绍到这了,更多相关 内容请继续浏览下面的相关 推荐文章,希望大家都能在 编程的领域有一番成就!
版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/matlabbc/21198.html