Calculates the Mie susceptibilities Gamma_n, Delta_n, A_n, and B_n for n=1:nNmax for a single sphere Parameters: - nNmax: integer scalar - s: column vector [L x 1] wavelength-dependent relative refractive index (Eq. H.45) - x: column vector [L x 1] wavelength-dependent x=kM*a (Eq. H.45) Returns: structure with 4 fields each a matrix [L x nNmax] with susceptibilities defined in Eqs. H.12, H.13 stSuscep.Gamma: Gamma_n stSuscep.Delta: Delta_n stSuscep.A: A_n stSuscep.B: B_n This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 z=s.*x; 0002 0003 % get psi_n(z) and psi'_n(z) 0004 stRBz=GenRBpsi2(nNmax,z); 0005 0006 % get psi_n(x), xi_n(x) and derivatives 0007 stRBx=GenRBall(nNmax,x); 0008 0009 % auxialiary functions 0010 smat=repmat(s,1,nNmax); 0011 PP1 = stRBz.psi .* stRBx.Dpsi; 0012 PP2 = stRBx.psi .* stRBz.Dpsi; 0013 PP3 = stRBz.psi .* stRBx.Dxi; 0014 PP4 = stRBx.xi .* stRBz.Dpsi; 0015 0016 % numerators 0017 NumGam = GenCheckSum2Mat(- PP1, smat .* PP2,'NumGam','GenSuscepGDAB'); 0018 NumDel = GenCheckSum2Mat(PP2, - smat .* PP1,'NumDel','GenSuscepGDAB'); 0019 0020 % denominators 0021 DenDelB = GenCheckSum2Mat(- PP4, smat .* PP3,'DenDelB','GenSuscepGDAB'); 0022 DenGamA = GenCheckSum2Mat(PP3, - smat .* PP4,'DenGamA','GenSuscepGDAB'); 0023 0024 % calculates susceptibilities from Eqs. H.46, H.47, H. 51, H.52 0025 % Make the cell to return 0026 stSuscep.Gamma = NumGam ./ DenGamA; 0027 stSuscep.Delta = NumDel ./ DenDelB; 0028 stSuscep.A = i*smat./DenGamA; 0029 stSuscep.B = i*smat./DenDelB; 0030