Home > atmlab > mie > mie_esquare3.m

mie_esquare3

PURPOSE ^

Test of term-wise equality of absorption efficiency

SYNOPSIS ^

function result = mie_esquare3(m, x, n)

DESCRIPTION ^

 Test of term-wise equality of absorption efficiency
 as computed by two different methods
 n is the term number of the vector-wave mode,
 x size parameter, m refractive index of sphere, 
 Qabsa=abs.efficiency due to an-term
 Qabsb=abs.efficiency due to bn-term
 Qabsc=abs.efficiency due to cn-term
 Qabsd=abs.efficiency due to dn-term
 Sept. 13, 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_esquare3.m

SOURCE CODE ^

0001 function result = mie_esquare3(m, x, n)
0002 
0003 % Test of term-wise equality of absorption efficiency
0004 % as computed by two different methods
0005 % n is the term number of the vector-wave mode,
0006 % x size parameter, m refractive index of sphere,
0007 % Qabsa=abs.efficiency due to an-term
0008 % Qabsb=abs.efficiency due to bn-term
0009 % Qabsc=abs.efficiency due to cn-term
0010 % Qabsd=abs.efficiency due to dn-term
0011 % Sept. 13, 2002
0012 
0013 nj=100*round(2+x+4*x.^(1/3))+100;
0014 nu =(n+0.5); 
0015 m1=real(m); m2=imag(m);e2=imag(m.*m);
0016 abcd=mie_ab(m,x);
0017 an=abcd(1,n);bn=abcd(2,n);
0018 an2=abs(an).^2;
0019 bn2=abs(bn).^2;
0020 
0021 abcd=mie_cd(m,x);
0022 cn=abcd(1,n);dn=abcd(2,n);
0023 cn2=abs(cn).^2;
0024 dn2=abs(dn).^2;
0025 dx=x/nj;
0026 cs=[];ds=[];
0027 for j=1:nj,
0028     xj=dx.*j;
0029     z=m.*xj;
0030     sqz= sqrt(0.5*pi./z);
0031     bz = besselj(nu, z).*sqz;      % This is j_n(z)
0032     bz2=(abs(bz)).^2;
0033     b1z = besselj(nu-1, z).*sqz;   % This is j_n-1(z)
0034     az = b1z-n.*bz./z;
0035     az2=(abs(az)).^2;
0036     z2=(abs(z)).^2;
0037     n1 =n*(n+1);
0038     n2 =2*(2*n+1);
0039     mn=real(bz2.*n2);
0040     nn1=az2;
0041     nn2=bz2.*n1./z2;
0042     nn=n2.*real(nn1+nn2);
0043     cs=[cs 0.25*(cn2*mn)]; 
0044     ds=[ds 0.25*(dn2*nn)]; 
0045 end;
0046 xxj=[0:dx:x];
0047 ccn=[cs(1) cs];
0048 ddn=[ds(1) ds];
0049 ef=[ccn;ddn];
0050 plot(xxj,ef(1:2,:));
0051 title(sprintf('Sq. Ampl. Field in Sphere of cn and dn Modes, n=%g, m=%g+%gi, x=%g',n,m1,m2,x))
0052 legend('cn Term','dn Term')
0053 xlabel('r k')
0054 
0055 x2=x.*x;
0056 nj1=nj+1;
0057 cn1=0.5*ccn(nj1).*x2;     % End-Term correction in integral
0058 cnx=ccn*(xxj.*xxj)'-cn1;    % Trapezoidal radial integration
0059 intc=dx.*cnx;
0060 Qabsc=4.*e2.*intc./x2;
0061 dn1=0.5*ddn(nj1).*x2;     % End-Term correction in integral
0062 dnx=ddn*(xxj.*xxj)'-dn1;    % Trapezoidal radial integration
0063 intd=dx.*dnx;
0064 Qabsd=4.*e2.*intd./x2;
0065 
0066 Qabsb=(n2/x2)*(real(bn)-bn2);
0067 Qabsa=(n2/x2)*(real(an)-an2);
0068 result=[Qabsa;Qabsb;Qabsc;Qabsd];

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005