- 积分
- 0
- 注册时间
- 2006-11-4
- 仿真币
-
- 最后登录
- 1970-1-1
|
小弟是个刚入门的菜鸟,请高手指点: 其中:%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)); |
|