Home > atmlab > mie > mie2_esquare.m

mie2_esquare

PURPOSE ^

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

SYNOPSIS ^

function result = mie2_Esquare(eps1, mu1, 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, 
 for given complex permittivity and permeability
 ratios eps1=eps1'+ieps1", mu1=mu1'+imu1" between inside and outside 
 of the sphere and size parameter x=k0*a 
 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; x=k0.*radius; 
 Input: eps1, mu1, x, nj (number of radial values)
 C. M�zler, July 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie2_esquare.m

SOURCE CODE ^

0001 function result = mie2_Esquare(eps1, mu1, 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 % for given complex permittivity and permeability
0007 % ratios eps1=eps1'+ieps1", mu1=mu1'+imu1" between inside and outside
0008 % of the sphere and size parameter x=k0*a
0009 % where the averaging is done over teta and phi,
0010 % with unit-amplitude incident field;
0011 % Ref. Bohren and Huffman (1983) BEWI:TDD122,
0012 % and my own notes on this topic; x=k0.*radius;
0013 % Input: eps1, mu1, x, nj (number of radial values)
0014 % C. M�zler, July 2002
0015 
0016 m=sqrt(eps1.*mu1);            % refractive index ratio
0017 nmax=round(2+x+4*x^(1/3));
0018 n=(1:nmax);  nu =(n+0.5); 
0019 m1=real(m); m2=imag(m);
0020 abcd=mie2_cd(eps1,mu1,x);
0021 cn=abcd(1,:);dn=abcd(2,:);
0022 cn2=abs(cn).^2;
0023 dn2=abs(dn).^2;
0024 dx=x/nj;
0025 for j=1:nj,
0026     xj=dx.*j;
0027     z=m.*xj;
0028     sqz= sqrt(0.5*pi./z);
0029     bz = besselj(nu, z).*sqz;      % This is jn(z)
0030     bz2=(abs(bz)).^2;
0031     b1z=[sin(z)/z, bz(1:nmax-1)];  % Note that sin(z)/z=j0(z)
0032     az = b1z-n.*bz./z;
0033     az2=(abs(az)).^2;
0034     z2=(abs(z)).^2;
0035     n1 =n.*(n+1);
0036     n2 =2.*(2.*n+1);
0037     mn=real(bz2.*n2);
0038     nn1=az2;
0039     nn2=bz2.*n1./z2;
0040     nn=n2.*real(nn1+nn2);
0041     en(j)=0.25*(cn2*mn'+dn2*nn');
0042 end;
0043 xxj=[0:dx:xj]; een=[en(1) en];
0044 
0045 plot(xxj,een);
0046 
0047 legend('Radial Dependence of (abs(E))^2')
0048 title(sprintf('Squared Amplitude Field in a Sphere, m=%g+%gi, x=%g',m1,m2,x))
0049 xlabel('r k')
0050 
0051 result=een;

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