Home > atmlab > mie > miecoated_ab1.m

miecoated_ab1

PURPOSE ^

Computation of Mie Coefficients, a_n, b_n,

SYNOPSIS ^

function result = miecoated_ab1(m1,m2,x,y)

DESCRIPTION ^

 Computation of Mie Coefficients, a_n, b_n, 
 of orders n=1 to nmax, complex refractive index m=m'+im", 
 and size parameters x=k0*a, y=k0*b where k0= wave number 
 in the ambient medium for coated spheres with
 a,b= inner,outer radius, m1,m2= inner,outer refractive index; 
 Equations: Bohren and Huffman (1983) (BEWI:TDD122), p. 483 
 using the recurrence relation (4.89) for Dn on p. 127 and 
 starting conditions as described in Appendix A,
 optimized for lossy materials by carefully selecting the
 numerical computations to avoid overflows and underflows.
 C. M�zler, August 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

miecoated_ab1.m

SOURCE CODE ^

0001 function result = miecoated_ab1(m1,m2,x,y)
0002 
0003 % Computation of Mie Coefficients, a_n, b_n,
0004 % of orders n=1 to nmax, complex refractive index m=m'+im",
0005 % and size parameters x=k0*a, y=k0*b where k0= wave number
0006 % in the ambient medium for coated spheres with
0007 % a,b= inner,outer radius, m1,m2= inner,outer refractive index;
0008 % Equations: Bohren and Huffman (1983) (BEWI:TDD122), p. 483
0009 % using the recurrence relation (4.89) for Dn on p. 127 and
0010 % starting conditions as described in Appendix A,
0011 % optimized for lossy materials by carefully selecting the
0012 % numerical computations to avoid overflows and underflows.
0013 % C. M�zler, August 2002
0014 
0015 m=m2./m1;
0016 u=m1.*x; v=m2.*x; w=m2.*y;      % The arguments of Bessel Functions
0017 nmax=round(2+y+4*y.^(1/3));     % The various nmax values
0018 mx=max(abs(m1*y),abs(m2*y));
0019 nmx=  round(max(nmax,mx)+16);
0020 nmax1=nmax-1;
0021 n=  (1:nmax); 
0022 % Computation of Dn(z), z=u,v,w according to (4.89) of B+H (1983)
0023 dnx(nmx)=0+0i; z=u;
0024 for j=nmx:-1:2     
0025     dnx(j-1)=j./z-1/(dnx(j)+j./z);
0026 end;
0027 dnu=dnx(n);
0028 z=v;
0029 for j=nmx:-1:2      
0030     dnx(j-1)=j./z-1/(dnx(j)+j./z);
0031 end;
0032 dnv=dnx(n);
0033 z=w; 
0034 for j=nmx:-1:2      
0035     dnx(j-1)=j./z-1/(dnx(j)+j./z);
0036 end;
0037 dnw=dnx(n);
0038 % Computation of Psi, Chi and Gsi Functions and their derivatives
0039 nu = (n+0.5); 
0040 sv= sqrt(0.5*pi*v); pv= sv.*besselj(nu, v);
0041 sw= sqrt(0.5*pi*w); pw= sw.*besselj(nu ,w);
0042 sy= sqrt(0.5*pi*y); py= sy.*besselj(nu ,y); 
0043 p1y=[sin(y), py(1:nmax1)];
0044 chv= -sv.*bessely(nu,v); 
0045 chw= -sw.*bessely(nu,w);
0046 chy= -sy.*bessely(nu,y);  
0047 ch1y= [cos(y), chy(1:nmax1)]; 
0048 gsy= py-i*chy;      gs1y= p1y-i*ch1y;
0049 % Computation of U, V, F Functions, avoiding products of Riccati-Bessel Fcts.
0050 uu=m.*dnu-dnv;
0051 vv=dnu./m-dnv;
0052 fv=pv./chv;  
0053 fw=pw./chw;
0054 ku1=uu.*fv./pw; kv1=vv.*fv./pw;
0055 ku2=uu.*(pw-chw.*fv)+(pw./pv)./chv;
0056 kv2=vv.*(pw-chw.*fv)+(pw./pv)./chv;
0057 dns1=ku1./ku2; gns1=kv1./kv2;
0058 % Computation of Dn_Schlange, Gn_Schlange
0059 dns=dns1+dnw;
0060 gns=gns1+dnw;
0061 a1=dns./m2+n./y;
0062 b1=m2.*gns+n./y;
0063 % an and bn
0064 an=(py.*a1-p1y)./(gsy.*a1-gs1y);
0065 bn=(py.*b1-p1y)./(gsy.*b1-gs1y);
0066 result=[an; bn];

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