本帖最后由 zuobinjstu 于 2010-4-28 10:41 编辑
22# rocwoods
我运行出来图像了,可让我纳闷的是,这个图像和理论所要的图像完全不一样,不知道怎么回事。我的导师曾经将那个公式用手算化简出来然后汇出的图像应该在90左右,(见20楼附件)而我运行出来图像完全不一样,我在想难道是程序哪里有偏差还是matlab运算图像的算法不一样。还请你帮忙看下,谢谢!
代码如下是为了算这个:
当(r*sin(90*t)-rho*sin(3*B)*cos(theta))*(cos(beta)-sin(beta)*sin(theta)*cos(3*B)*cos(theta)-...
sin(beta)*sin(3*B)*tan(B)*sin(theta))-(r*cos(90*t)-rho*cos(beta)*cos(3*B)+...
rho*sin(beta)*sin(theta))*tan(B)*cos(theta)=0时, B的一阶导数关于t的图像(应该是90左右)
参照你的代码如下:
syms A B ;
r=37;L=140.5;beta=pi/18;
rho=r/2*(1/cos(beta)-1);
theta=asin(rho/L);
f=(r*sin(A)-rho*sin(3*B)*cos(theta))*(cos(beta)-sin(beta)*sin(theta)*cos(3*B)*cos(theta)-...
sin(beta)*sin(3*B)*tan(B)*sin(theta))-(r*cos(A)-rho*cos(beta)*cos(3*B)+...
rho*sin(beta)*sin(theta))*tan(B)*cos(theta);
F = subs(f,{'A','B'},{'90*t','B(t)'});
dFt = diff(F,'t');
dFt = subs(dFt,'diff(B(t), t)','dBt');
dBt = solve(dFt,'dBt');
B = @(t) fzero(@(B) (r*sin(90*t)-rho*sin(3*B)*cos(theta))*(cos(beta)-...
sin(beta)*sin(theta)*cos(3*B)*cos(theta)-...
sin(beta)*sin(3*B)*tan(B)*sin(theta))-(r*cos(90*t)-rho*cos(beta)*cos(3*B)+...
rho*sin(beta)*sin(theta))*tan(B)*cos(theta) ,90);
eval(['dBt = @(t) ',char(dBt),';' ])
t = 0:0.5:12;
plot(t,arrayfun(@(T) dBt(T),t) )
|