马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
不太会用matlab,问一个问题,大家帮忙看一下,很着急的,谢谢
这样的方程(j=1,2,3........11),我编了一个程序,但是解不出结果
方程组的程序
function F=myfunlh(x)
fe=0.52;
fi=0.515;
Fa=1000;
Fr=2000;
Ki=381447.0905;
Ke=329428.2257;
a=15*pi/180;
Db=11;
Dm=82;
w=1046;
p=7800;
r=11/82;
My=200;
Ri=41;
for m=0:1:10
y(m+1)=m*18*pi/180; %y为滚球在轴承中所处的角位置
end
%输入方程组
for j=0:1:10
F(j*1+1,1)=Ki*(x(23+j)^1.5)*sin(x(j+1))-Ke*(x(34+j)^1.5)*sin(x(12+j))-(pi*p*((Db/1000)^4)*(w^2)/(30))*(sin(x(12+j))*cos(x(12+j))/r)*(((1-r*cos(x(j+1)))/(1+cos(x(j+1)-x(12+j))))^2);
F(j*1+2,1)=Ki*(x(23+j)^1.5)*cos(x(j+1))-Ke*(x(34+j)^1.5)*cos(x(12+j))+(p*pi*((Db/1000)^4)*(w^2)/(30*r))*((sin(x(12+j)))^2)*(((1-r*cos(x(j+1)))/(1+cos(x(j+1)-x(12+j))))^2)+(pi*p*((Db/1000)^3)*(Dm/1000)*(w^2)/12)*(((1-r*cos(x(j+1)))/(1+cos(x(j+1)-x(12+j))))^2);
F(j*1+3,1)=((fe-0.5)*Db+x(34+j))*sin(x(12+j))+((fi-0.5)*Db+x(23+j))*sin(x(j+1))-(fe+fi-1)*Db*sin(a)-x(45);
F(j*1+4,1)=((fe-0.5)*Db+x(34+j))*cos(x(12+j))+((fi-0.5)*Db+x(23+j))*cos(x(j+1))-(fe+fi-1)*Db*cos(a)-x(46)*cos(y(j+1));
end
F(45,1)=Fa-Ki*(x(23)^1.5)*sin(x(1))-2*Ki*(x(24)^1.5)*sin(x(2))-2*Ki*(x(25)^1.5)*sin(x(3))-2*Ki*(x(26)^1.5)*sin(x(4))-2*Ki*(x(27)^1.5)*sin(x(5))-2*Ki*(x(28)^1.5)*sin(x(6))-2*Ki*(x(29)^1.5)*sin(x(7)*pi/180)-2*Ki*(x(30)^1.5)*sin(x(8))-2*Ki*(x(31)^1.5)*sin(x(9))-2*Ki*(x(32)^1.5)*sin(x(10))-Ki*(x(33)^1.5)*sin(x(11));
F(46,1)=Fr-Ki*(x(23)^1.5)*cos(x(1))-2*Ki*(x(24)^1.5)*cos(x(2))-2*Ki*((x(25)^1.5)*cos(x(3))-2*Ki*(x(26)^1.5)*cos(x(4))-2*Ki*(x(27)^1.5)*cos(x(5))-2*Ki*(x(28)^1.5)*cos(x(6))-2*Ki*(x(29)^1.5)*cos(x(7)*pi/180)-2*Ki*(x(30)^1.5)*cos(x(8))-2*Ki*(x(31)^1.5)*cos(x(9))-2*Ki*(x(32)^1.5)*cos(x(10))-Ki*(x(33)^1.5)*cos(x(11));
F(47,1)=My-2*(Ri*(Ki*(Si(1)^1.5)*sin(ai(1)*pi/180)*cos(y(1))-Ki*(Si(2)^1.5)*sin(ai(2)*pi/180)*cos(y(2))-Ki*(Si(3)^1.5)*sin(ai(3)*pi/180)*cos(y(3))-Ki*(Si(4)^1.5)*sin(ai(4)*pi/180)*cos(y(4))-Ki*(Si(5)^1.5)*sin(ai(5)*pi/180)*cos(y(5))-Ki*(Si(6)^1.5)*sin(ai(6)*pi/180)*cos(y(6))-Ki*(Si(7)^1.5)*sin(ai(7)*pi/180)*cos(y(7))-Ki*(Si(8)^1.5)*sin(ai(8)*pi/180)*cos(y(8))-Ki*(Si(9)^1.5)*sin(ai(9)*pi/180)*cos(y(9))-Ki*(Si(10)^1.5)*sin(ai(10)*pi/180)*cos(y(10))-Ki*(Si(11)^1.5)*sin(ai(11)*pi/180)*cos(y(11))));
然后在命令框中输入
x0=[0.43 0.425 0.42 0.415 0.41 0.405 0.4 24.5*pi/180 24.5*pi/180 24.5*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 9*pi/180 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.002 0.0037 0.0037 0.0037 0.0037 0.0037 0.0037 0.0037 0.0037 0.0037 0.0037 0.0037 0.004 0.004];
>> options=optimset('Display','iter');
>> [x,fval] = fsolve(@myfunlh,x0,options);
为什么算不出结果啊
??? Error: File: d:\MATLAB7\work\myfunlh.m Line: 25 Column: 314
Incomplete or misformed expression or statement.
Error in ==> fsolve at 180
fuser = feval(funfcn{3},x,varargin{:}); |