Calculates the surface-averaged local field intensity EF for PWE from the Mie susceptibilities using Eq. (H.79). Parameters: - x: column vector [L x 1] wavelength-dependent x=kM*a (Eq. H.45) - stGD: structure with two fields, Gamma and Delta each a matrix [L x nNmax] with suceptibilities Gamma_n and Delta_n can be obtained from function GenSuscepGDAB Returns: - MLocAve: [L x 1] wavelength-dependent average LFIEF This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 nNmax=size(stGD.Gamma,2); 0002 0003 % get psi_n(x), xi_n(x) and derivatives 0004 stRBx=GenRBall(nNmax,x); 0005 0006 n=transpose(1:nNmax); % [nNmax x 1] 0007 0008 cc1 = 2.*n+1; % [nNmax x 1] 0009 % Get sums and check loss of precision during sums 0010 tmp1=GenCheckSum2Mat(stRBx.psi, stGD.Gamma .* stRBx.xi,'tmp1_1','PweMLocAve'); 0011 tmp2=GenCheckSum2Mat(stRBx.Dpsi, stGD.Delta .* stRBx.Dxi,'tmp2_1','PweMLocAve'); 0012 summat1=abs(tmp1).^2 + abs(tmp2).^2; % [L x nNmax] 0013 0014 clear tmp2; 0015 cc2 = cc1.*n.*(n+1); % [nNmax x 1] 0016 tmp1=GenCheckSum2Mat(stRBx.psi, stGD.Delta .* stRBx.xi,'tmp1_2','PweMLocAve'); 0017 summat2=abs(tmp1).^2; % [L x nNmax] 0018 0019 % From Eq. H.79 0020 MLocAve= 1./(2*(x).^2) .* (summat1 * cc1) ... 0021 + 1./(2*(x).^4) .* (summat2 * cc2) ; % [L x 1] 0022 % sums over positive numbers: no loss of precision issue 0023