Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
初级会员
注册日期: 2010-05-21
年龄: 36
帖子: 2
声望力: 0 ![]() |
![]()
程序1:
eps = (0.1:0.1:5); %epsilon Fai_L = acos(1-2*eps); %积分限。 Fai_L(eps>1)=pi; %epsilon 大于1积分限设为pi syms f e int_f = (1-(1-cos(f))/(2*e))^(3/2)*cos(f)/(2*pi); %被积函数 Jr = zeros(size(eps)); %初始化Jr for i=1:length(eps) Jr(i) = double(int(subs(int_f,e,eps(i)),f,-Fai_L(i),Fai_L(i))); %积分 end plot(eps,real(Jr)); %画图 xlabel 'ε' ylabel 'Jr' 程序1运行后可画出图形。 稍微改动下变为程序2 eps = (0.1:0.1:5); %epsilon Fai_L = acos(1-2*eps); %积分限。 Fai_L(eps>1)=pi; %epsilon 大于1积分限设为pi syms f e int_f = (1-(1-cos(f))/(2*e))^(1.1)*cos(f)/(2*pi); %被积函数 Jrl = zeros(size(eps)); %初始化Jr for i=1:length(eps) Jrl(i) = double(int(subs(int_f,e,eps(i)),f,-Fai_L(i),Fai_L(i))); %积分 end plot(eps,real(Jrl)); %画图 xlabel 'ε' ylabel 'Jr' 就无法运行了。显示错误,两个的改动之处是将1中的1.5改为1.1,我的目的是想解出2中的那个积分方程,但是总是出现错误 ??? Error using ==> mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use the VPA function instead. Error in ==> sym.sym>sym.double at 927 Xstr = mupadmex('mllib::double', S.s, 0); Error in ==> jrlimage at 13 Jrl(i) = double(int(subs(int_f,e,eps(i)),f,-Fai_L(i),Fai_L(i))); %积分 |
![]() |
![]() |