|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
小弟是个刚入门的菜鸟,请高手指点:
其中:%f1=-u.*ft.*R.*(sin(t));
与
f1=-u.*ft.*R.*cot(b).*((sin(t)).^2.8)+c.*((sin(t)).^5).*cos(t);
为积分函数,当f1=-u.*ft.*R.*(sin(t));时,可以画出图,但是当积分函数是 f1=-u.*ft.*R.*cot(b).*((sin(t)).^2.8)+c.*((sin(t)).^5).*cos(t)时,出现“Conversion to double from sym is not possible.”。请各位高手帮忙解决,小弟不胜感激!
源程序如下:
u0=3.51*10.^9;
ae=12*pi/180;ae0=0;
ft=0.203*10.^(-3);
t0=0.25*10.^(-3);
u=u0.*(1-(ae-ae0)/100).*(t0/ft)^0.2;
c=0.5;b=pi/6;
R=9.53*10.^(-3);
syms t ta tb
%f1=-u.*ft.*R.*(sin(t));
f1=-u.*ft.*R.*cot(b).*((sin(t)).^2.8)+c.*((sin(t)).^5).*cos(t);
y=int(f1,t,ta,tb);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%f1=-u.*ft.*R.*cot(b).*((sin(t)).^1.8)+c.*((sin(t)).^0.8).*cos(t);
%y=trapz(ta,f1)-trapz(tb,f1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 新的积分区域 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%syms t ta tb
%f=inline('-u.*ft.*R.*(sin(t))','t');
%y=quadl(f,ta,tb);
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
w1=pi;w2=26.45*pi/180;
m=4;
Fx=1;
for i=1:120
n=500;
w=i*0.001*n*2*pi/60;
aa(i)=w;
for j=1:m
w3=-w+(j-1)*2*pi/m;
ta= max(0,w3);
tb= min(w1,w2+w3);
ta=double (ta);
tb=double (tb);
if ta<=pi & tb>=0
f2=(y);
else
f2=0;
end
Fx=Fx+f2;
end
bb(i)=Fx;
end
plot(subs(aa),subs(bb));
[ 本帖最后由 eight 于 2008-4-7 16:07 编辑 ] |
|