[Visual Basic] 纯文本查看 复制代码
clear all
circletend=401;
circlewend=101;
tend=50;
for circlew=1:circlewend;
w0(circlew)=-50+2*50/(circlewend-1)*(circlew-1);
w=w0(circlew);
s=0;
for circlet=1:circletend-1;
t0(circlet)=tend/(circletend-1)*(circlet-1);
t10(circlet)=tend/(circletend-1)*(circlet);
t=t0(circlet);
t1=t10(circlet);
s=s+0.5*(expm(-i*w*t)*expm(-2*t)+expm(-i*w*t1)*expm(-2*t1))*tend/(circletend-1);
end
ss(circlew)=s;
end
figure(18);hold on; plot(w0,ss,'g-');xlabel('','fontsize',16),ylabel('','fontsize',16);
clear all
circletend=1001;
circlewend=1001;
for circlew=1:circlewend;
w0(circlew)=-50+2*50/(circlewend-1)*(circlew-1);
w=w0(circlew);
ss(circlew)=1/(2+i*w);
end
figure(18);hold on; plot(w0,ss,'b-');xlabel('','fontsize',16),ylabel('','fontsize',16);