Redstone 发表于 2008-4-6 10:40

求积分时遇到 Conversion to double from sym is not possible 的错误

小弟是个刚入门的菜鸟,请高手指点:
其中:%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 编辑 ]

sigma665 发表于 2008-4-6 18:55

回复 2楼 的帖子

Warning: Explicit integral could not be found.
> In sym.int at 58
??? Error using ==> plot
Conversion to double from sym is not possible.

顺便把错误提示贴出来
积分方程太复杂,没有积出来

eight 发表于 2008-4-7 16:06

原帖由 Redstone 于 2008-4-6 10:40 发表 http://www.chinavib.com/forum/images/common/back.gif
小弟是个刚入门的菜鸟,请高手指点:
其中:%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.*(s ... 请按照置顶帖:聚宝盘中的描述来重新整理你的问题,我看半天都不知道你出错在哪行,matlab 命令窗口有完整的错误提示,请先熟悉
页: [1]
查看完整版本: 求积分时遇到 Conversion to double from sym is not possible 的错误