帮忙看一下带参数积分的程序,有什么错误
我想画一条D-Q的曲线,表达式如下图所示:其中,
Q的取值为Q=,u的值为7,最后我画出来的曲线感觉不太对,请高手帮忙看一下,程序有什么错误..谢谢~~
程序如下:
clear;clc
u=7;
%%%%%%%%%%%%%%%%%%%i>0时%%%%%%%%%%%%%%%%%%%%%%%%%
fch1=@(Q) arrayfun(@(i) quadl(@(x) abs(x-i.*Q).*1/pi*u./(u^2+x.^2),(i-1/2).*Q,(i+1/2).*Q),1:100);
Q=;
ych1=zeros(size(Q));
for j=1:length(Q)
ych1(j)=sum(fch1(Q(j)));
end
%%%%%%%%%%%%%%%%%%i=0时%%%%%%%%%%%%%%%%%%%%%%%%%%
fch2=@(Q) quadl(@(x) abs(x).*1/pi*u./(u^2+x.^2),0,0.5.*Q);
Q=;
ych2=zeros(size(Q));
for j=1:length(Q)
ych2(j)=sum(fch2(Q(j)));
end
dch=2*ych1+2*ych2;
plot(Q,dch,'-sg')
画出的曲线如下:
[ 本帖最后由 maigicku 于 2009-10-26 17:27 编辑 ]
页:
[1]