Home > atmlab > mie > mie_esquare.m

mie_esquare

PURPOSE ^

Computation of nj+1 equally spaced values within (0,x)

SYNOPSIS ^

function result = mie_esquare(m, x, nj)

DESCRIPTION ^

 Computation of nj+1 equally spaced values within (0,x)
 of the mean-absolute-square internal 
 electric field of a sphere of size parameter x, 
 complex refractive index m=m'+im", 
 where the averaging is done over teta and phi,
 with unit-amplitude incident field;
 Ref. Bohren and Huffman (1983) BEWI:TDD122,
 and my own notes on this topic;
 k0=2*pi./wavelength;
 x=k0.*radius;
 C. M�zler, May 2002, revised July 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_esquare.m

SOURCE CODE ^

0001 function result = mie_esquare(m, x, nj)
0002 
0003 % Computation of nj+1 equally spaced values within (0,x)
0004 % of the mean-absolute-square internal
0005 % electric field of a sphere of size parameter x,
0006 % complex refractive index m=m'+im",
0007 % where the averaging is done over teta and phi,
0008 % with unit-amplitude incident field;
0009 % Ref. Bohren and Huffman (1983) BEWI:TDD122,
0010 % and my own notes on this topic;
0011 % k0=2*pi./wavelength;
0012 % x=k0.*radius;
0013 % C. M�zler, May 2002, revised July 2002
0014 
0015 nmax=round(2+x+4*x^(1/3));
0016 n=(1:nmax);  nu =(n+0.5); 
0017 m1=real(m); m2=imag(m);
0018 abcd=Mie_cd(m,x);
0019 cn=abcd(1,:);dn=abcd(2,:);
0020 cn2=abs(cn).^2;
0021 dn2=abs(dn).^2;
0022 dx=x/nj;
0023 es=[];
0024 for j=1:nj,
0025     xj=dx.*j;
0026     z=m.*xj;
0027     sqz= sqrt(0.5*pi./z);
0028     bz = besselj(nu, z).*sqz;      % This is jn(z)
0029     bz2=(abs(bz)).^2;
0030     b1z=[sin(z)/z, bz(1:nmax-1)];  % Note that sin(z)/z=j0(z)
0031     az = b1z-n.*bz./z;
0032     az2=(abs(az)).^2;
0033     z2=(abs(z)).^2;
0034     n1 =n.*(n+1);
0035     n2 =2.*(2.*n+1);
0036     mn=real(bz2.*n2);
0037     nn1=az2;
0038     nn2=bz2.*n1./z2;
0039     nn=n2.*real(nn1+nn2);
0040     es=[es 0.25*(cn2*mn'+dn2*nn')];
0041 end;
0042 xxj=[0:dx:xj]; een=[es(1) es];
0043 
0044 plot(xxj,een);
0045 
0046 legend('Radial Dependence of (abs(E))^2')
0047 title(sprintf('Squared Amplitude E Field in a Sphere, m=%g+%gi, x=%g',m1,m2,x))
0048 xlabel('r k')
0049 
0050 result=een;

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