Home > atmlab > mie > mie_esquare2.m

mie_esquare2

PURPOSE ^

Test of term-wise equality of absorption efficiency

SYNOPSIS ^

function result = mie_esquare2(m, x, n)

DESCRIPTION ^

 Test of term-wise equality of absorption efficiency
 n is term number, x size parameter,
 m refractive index of sphere, Sept. 13, 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_esquare2.m

SOURCE CODE ^

0001 function result = mie_esquare2(m, x, n)
0002 
0003 % Test of term-wise equality of absorption efficiency
0004 % n is term number, x size parameter,
0005 % m refractive index of sphere, Sept. 13, 2002
0006 
0007 nj=100*round(2+x+4*x.^(1/3))+100;
0008 nu =(n+0.5); 
0009 m1=real(m); m2=imag(m);e2=imag(m.*m);
0010 abcd=mie_ab(m,x);
0011 an=abcd(1,n);bn=abcd(2,n);
0012 an2=abs(an).^2;
0013 bn2=abs(bn).^2;
0014 
0015 abcd=mie_cd(m,x);
0016 cn=abcd(1,n);dn=abcd(2,n);
0017 cn2=abs(cn).^2;
0018 dn2=abs(dn).^2;
0019 dx=x/nj;
0020 es=[];
0021 for j=1:nj,
0022     xj=dx.*j;
0023     z=m.*xj;
0024     sqz= sqrt(0.5*pi./z);
0025     bz = besselj(nu, z).*sqz;      % This is j_n(z)
0026     bz2=(abs(bz)).^2;
0027     b1z = besselj(nu-1, z).*sqz;   % This is j_n-1(z)
0028     az = b1z-n.*bz./z;
0029     az2=(abs(az)).^2;
0030     z2=(abs(z)).^2;
0031     n1 =n*(n+1);
0032     n2 =2*(2*n+1);
0033     mn=real(bz2.*n2);
0034     nn1=az2;
0035     nn2=bz2.*n1./z2;
0036     nn=n2.*real(nn1+nn2);
0037     es=[es 0.25*(cn2*mn+dn2*nn)];
0038 end;
0039 xxj=[0:dx:x];
0040 een=[es(1) es];
0041 
0042 plot(xxj,een);
0043 title(sprintf('Sq. Ampl. Field in Sphere of Mode n=%g, m=%g+%gi, x=%g',n,m1,m2,x))
0044 xlabel('r k')
0045 
0046 x2=x.*x;
0047 nj1=nj+1;
0048 en1=0.5*een(nj1).*x2;     % End-Term correction in integral
0049 enx=een*(xxj.*xxj)'-en1;    % Trapezoidal radial integration
0050 inte=dx.*enx;
0051 Qabs=4.*e2.*inte./x2;
0052 Qab=(n2/x2)*(real(an)-an2+real(bn)-bn2);
0053 result=[Qabs;Qab];

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