找回密码
 注册
Simdroid-非首页
查看: 90|回复: 0

上下限带有参数积分中遇到:Conversion to double from sym is not possible.

[复制链接]
发表于 2008-4-6 10:56:59 | 显示全部楼层 |阅读模式 来自 辽宁沈阳
小弟是个刚入门的菜鸟,请高手指点: 其中:%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));
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-29 10:15 , Processed in 0.030275 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表