Home > atmlab > mie > mie_ab.m

mie_ab

PURPOSE ^

Computes a matrix of Mie Coefficients, an, bn,

SYNOPSIS ^

function result = mie_ab(m,x)

DESCRIPTION ^

 Computes a matrix of Mie Coefficients, an, bn, 
 of orders n=1 to nmax, for given complex refractive-index
 ratio m=m'+im" and size parameter x=k0*a where k0= wave number in ambient 
 medium for spheres of radius a;
 Eq. (4.88) of Bohren and Huffman (1983), BEWI:TDD122
 using the recurrence relation (4.89) for Dn on p. 127 and 
 starting conditions as described in Appendix A.
 C. M�zler, July 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

mie_ab.m

SOURCE CODE ^

0001 function result = mie_ab(m,x)
0002 
0003 % Computes a matrix of Mie Coefficients, an, bn,
0004 % of orders n=1 to nmax, for given complex refractive-index
0005 % ratio m=m'+im" and size parameter x=k0*a where k0= wave number in ambient
0006 % medium for spheres of radius a;
0007 % Eq. (4.88) of Bohren and Huffman (1983), BEWI:TDD122
0008 % using the recurrence relation (4.89) for Dn on p. 127 and
0009 % starting conditions as described in Appendix A.
0010 % C. M�zler, July 2002
0011 
0012 z=m.*x;
0013 nmax=round(2+x+4*x.^(1/3));  
0014 nmx=round(max(nmax,abs(z))+16);
0015 n=(1:nmax); nu = (n+0.5); 
0016 
0017 sx=sqrt(0.5*pi*x);
0018 px=sx.*besselj(nu,x);
0019 p1x=[sin(x), px(1:nmax-1)];
0020 chx=-sx.*bessely(nu,x);
0021 ch1x=[cos(x), chx(1:nmax-1)];
0022 gsx=px-i*chx; gs1x=p1x-i*ch1x;
0023 dnx(nmx)=0+0i;
0024 for j=nmx:-1:2      % Computation of Dn(z) according to (4.89) of B+H (1983)
0025     dnx(j-1)=j./z-1/(dnx(j)+j./z);
0026 end;
0027 dn=dnx(n);          % Dn(z), n=1 to nmax
0028 da=dn./m+n./x; 
0029 db=m.*dn+n./x;
0030 
0031 an=(da.*px-p1x)./(da.*gsx-gs1x);
0032 bn=(db.*px-p1x)./(db.*gsx-gs1x);
0033 
0034 result=[an; bn];

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