Home > atmlab > mie > mie_cd.m

mie_cd

PURPOSE ^

Computes a matrix of Mie coefficients, c_n, d_n,

SYNOPSIS ^

function result = mie_cd(m, x)

DESCRIPTION ^

 Computes a matrix of Mie coefficients, c_n, d_n, 
 of orders n=1 to nmax, complex refractive index m=m'+im", 
 and size parameter x=k0*a, where k0= wave number 
 in the ambient medium, a=sphere radius; 
 p. 100, 477 in Bohren and Huffman (1983) BEWI:TDD122
 C. M�zler, July 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_cd.m

SOURCE CODE ^

0001 function result = mie_cd(m, x)
0002 
0003 % Computes a matrix of Mie coefficients, c_n, d_n,
0004 % of orders n=1 to nmax, complex refractive index m=m'+im",
0005 % and size parameter x=k0*a, where k0= wave number
0006 % in the ambient medium, a=sphere radius;
0007 % p. 100, 477 in Bohren and Huffman (1983) BEWI:TDD122
0008 % C. M�zler, July 2002
0009 
0010 z=m.*x;
0011 nmax=round(2+x+4*x.^(1/3));
0012 nmx=round(max(nmax,abs(z))+16);
0013 n=(1:nmax); nu = (n+0.5); msq=m.*m; 
0014 cnx(nmx)=0+0i;
0015 for j=nmx:-1:2
0016     cnx(j-1)=j-z.*z./(cnx(j)+j);
0017 end;
0018 cnn=cnx(n);
0019 sqx= sqrt(0.5*pi./x); sqz= sqrt(0.5*pi./z);
0020 bx = besselj(nu, x).*sqx;
0021 bz = 1./besselj(nu, z)./sqz;
0022 yx = bessely(nu, x).*sqx;
0023 hx = bx+i*yx;
0024 b1x=[sin(x)/x, bx(1:nmax-1)];
0025 y1x=[-cos(x)/x, yx(1:nmax-1)];
0026 h1x= b1x+i*y1x;
0027 ax = x.*b1x-n.*bx;
0028 ahx= x.*h1x-n.*hx;
0029 nenn1=msq.*ahx-hx.*cnn;
0030 nenn2=ahx-hx.*cnn;
0031 cn = bz.*(bx.*ahx-hx.*ax)./nenn2;
0032 dn = bz.*m.*(bx.*ahx-hx.*ax)./nenn1;
0033 result=[cn; dn];

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