您好,欢迎访问三七文档
matlab程序clc;clearn=4+1i*(-2);re=4;im=-2;l=100;fid1=fopen('C:\Users\USER\Desktop\΢²¨\y1.txt','w');fid2=fopen('C:\Users\USER\Desktop\΢²¨\y2.txt','w');forx=0.1:0.15:15m1=cos(x)-1i*sin(x);m2=sin(x)+1i*cos(x);w(1)=1/x*m2-m1;A0=(sin(re*x)*cos(re*x)+1i*sinh(abs(im)*x)*cosh(abs(im)*x))/(power(sin(re*x),2)+power(sinh(abs(im)*x),2));A(1)=-1/(n*x)+1/(1/(n*x)-A0);a(1)=((A(1)/n+1/x)*real(w(1))-real(m2))/((A(1)/n+1/x)*w(1)-m2);b(1)=((n*A(1)+1/x)*real(w(1))-real(m2))/((n*A(1)+1/x)*w(1)-m2);y1(1)=3*((abs(a(1)))^2+(abs(b(1)))^2);y2(1)=3*real(a(1)+b(1));forj=2:lif(j==2)w(2)=(3/x)*w(1)-m2;elsew(j)=((2*j-1)/x)*w(j-1)-w(j-2);endA(j)=-j/(n*x)+1/(j/(n*x)-A(j-1));a(j)=((A(j)/n+j/x)*real(w(j))-real(w(j-1)))/((A(j)/n+j/x)*w(j)-w(j-1));b(j)=((n*A(j)+j/x)*real(w(j))-real(w(j-1)))/((n*A(j)+j/x)*w(j)-w(j-1));y1(j)=y1(j-1)+(2*j+1)*(abs(a(j))^2+abs(b(j))^2);y2(j)=y2(j-1)+(2*j+1)*real(a(j)+b(j));endif(y1(j)-y1(j-1)10^(-12)&&y2(j)-y2(j-1)10^(-12))fprintf(fid1,'%f\n',2/(x^2)*y1(j));fprintf(fid2,'%f\n',2/(x^2)*y2(j));endendfclose(fid1);fclose(fid2);
本文标题:米散射程序
链接地址:https://www.777doc.com/doc-6130446 .html