Solves the problem of dipole emission close to a single sphere with Mie theory The parameters are given as arguments or may also be given in a structure stMP when called as DipSolveSingleSphere(stMP,sPlot,sCoeff) where stMP contains the parameter fields. The dipole is assumed to be on the positive z-axis (theta=0) and aligned in the plane (xOz) (i.e. p_y=0), and at a distance d from the sphere surface (i.e. at r=a+d). Note that in this case, we have for the Mie coefficients: either |m|=1; a,c even in m; b,d odd in m. or |m|=0; a,c=0; only b and d. For example, the scattered field is entirely defined by c_{n,1}, d_{n,1}, and d_{n,0} (c_{n,-1}=c_{n,1}, d_{n,-1}=-d_{n,1}, c_{n,0}=0 and all other coefficients are zero). Results are obtained for a perpendicular and parallel dipole. Results for the case of a general dipole can then be easily derived from them. Parameters: - nNmax: integer [1 x 1] number of n in series - a: integer [1 x 1] radius of sphere (typically in NANOMETERS) - lambda: possibly column vector [L x 1] wavelengths (typically in NANOMETERS) - epsilonM: scalar or column vector [L x 1] epsilon of embedding medium (possibly wavelength-dependent) - epsilonIn: scalar or column vector [L x 1] epsilon of sphere material (possibly wavelength-dependent) - d: integer [1 x 1] distance from sphere (typically in NANOMETERS) - nNmaxESA: integer [1 x 1] number of n in series for evaluation of MTot in the ESA for n>nNmax - sPlot: optional (default does nothing) 'plot' will produce a new figure with a plot of MRad and MTot (Perp and Para cases) - sCoeff: optional (default does nothing) 'coeff' will return the Mie coefficients for the internal field (alphan1, betan1, betan0), for the scattered field (cn1, dn1, dn0), and for the non-modified (incident) dipole radiated field (en1, fn1, fn0); all as fields of the result structure 'suscep' will return the Mie susceptibilities Gamma, Delta, A, and B as fields of the result structure 'both' will return both Mie coefficients and susceptibilities 'coeffSum' will return the coefficients in the sums used to calculate MRad and MTot Returns: structure stMdip with fields containing the parameters for future reference and additional fields for the results - stMdip.nNmax: scalar - stMdip.nNmaxESA: scalar - stMdip.a: scalar - stMdip.lambda: [L x 1] - stMdip.epsilonM: scalar or [L x 1] - stMdip.epsilonIn: scalar or [L x 1] - stMdip.d: scalar - stMdip.x: [L x 1] x=kM*a - stMdip.s: [L x 1] - stMdip.xp: [L x 1] xp=kM*(a+d) - stMdip.MRadPerp: [L x 1] wavelength-dependent radiative decay rate EF for perpendicular dipole - stMdip.MTotPerp: [L x 1] wavelength-dependent total decay rate EF for perpendicular dipole - stMdip.MRadPara: [L x 1] wavelength-dependent radiative decay rate EF for parallel dipole - stMdip.MTotPara: [L x 1] wavelength-dependent total decay rate EF for parallel dipole - stMdip.MRadPerpCoeffs [L x nNmax] (if sCoeff='coeffSum'): coeffs of the sums over n - stMdip.MRadParaCoeffs [L x nNmax] (if sCoeff='coeffSum'): coeffs of the sums over n - stMdip.MTotPerpCoeffs [L x nNmaxESA] (if sCoeff='coeffSum'): coeffs of the sums over n - stMdip.MTotParaCoeffs [L x nNmaxESA] (if sCoeff='coeffSum'): coeffs of the sums over n - stMdip.alphan1 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.betan1 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.betan0 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.cn1 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.dn1 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.dn0 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.en1 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.fn1 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.fn0 (if sCoeff='coeff' or 'both'): [L x nNmax] - stMdip.Gamma (if sCoeff='suscep' or 'both'): [L x nNmax] - stMdip.Delta (if sCoeff='suscep' or 'both'): [L x nNmax] - stMdip.A (if sCoeff='suscep' or 'both'): [L x nNmax] - stMdip.B (if sCoeff='suscep' or 'both'): [L x nNmax] This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 global noCheckSum; 0002 if (isempty(noCheckSum) || ~noCheckSum) 0003 disp 'DipSolveSingleSphere: Solving dipole Mie for single sphere - CheckSum ON' 0004 else 0005 disp 'DipSolveSingleSphere: Solving dipole Mie for single sphere - CheckSum OFF' 0006 end 0007 0008 % rearrange function parameters and define optional parameters 0009 % number of parameters is 1,2, or 3 if called as stMP,sOption,sCoeff 0010 % or 7,8, or 9 if nMax,a,lambda,epsilonM,epsilonIn,d,nNmaxESA,sOption,sCoeff 0011 nNbParam=nargin; 0012 if ((nNbParam==1) || (nNbParam==7)) 0013 sPlot='No'; 0014 sCoeff='No'; 0015 end 0016 if ((nNbParam==2) || (nNbParam==8)) 0017 sCoeff='No'; 0018 end 0019 if (nNbParam<4) 0020 nNmax=stMP.nNmax; 0021 a=stMP.a; 0022 lambda=stMP.lambda; 0023 epsilonM=stMP.epsilonM; 0024 epsilonIn=stMP.epsilonIn; 0025 d=stMP.d; 0026 nNmaxESA=stMP.nNmaxESA; 0027 end 0028 0029 % Calculate x=k_M a where k_M is wavevector outside the sphere 0030 % see Eq. H.45 0031 x=2*pi* sqrt(epsilonM) *a ./ lambda; % [L x 1] 0032 % Calculate s=k_in/k_M where k_in is wavevector inside sphere 0033 % see Eq. H.45 0034 % 0*lambda is used to ensure that s is [L x 1] even when both epsilon are 0035 % scalar 0036 s=sqrt(epsilonIn+0*lambda)./sqrt(epsilonM); % [L x 1] 0037 % Calculate xp=k_M (a+d) for dipole position 0038 xp=x/a*(a+d); 0039 0040 if nNmax>0 0041 0042 % Calculate susceptibilities Gamma_n, Delta_n, A_n, and B_n 0043 % (defined in Eqs. H.12 and H.13) 0044 % for all n and all lambda 0045 % Gamma, Delta, A, and B are matrices [L x Nmax] 0046 stGDAB=GenSuscepGDAB(nNmax,s,x); 0047 0048 % Calculate M coeffs for dipole emission 0049 % return coeffs in the sum if sCoeff='coeffSum' 0050 stMdip=DipMcoeff(xp,stGDAB,a,d,s,nNmaxESA,sCoeff); 0051 else % nNmax=0 means ESA calculation only 0052 stGDAB=0; 0053 stMdip=DipMcoeff(xp,stGDAB,a,d,s,nNmaxESA,'ESAonly'); 0054 sCoeff='No'; % deactive additional options (sCoeff is ignored if nNmax=0) 0055 end 0056 0057 % return results 0058 stMdip.nNmax=nNmax; 0059 stMdip.nNmaxESA=nNmaxESA; 0060 stMdip.a=a; 0061 stMdip.lambda=lambda; 0062 stMdip.epsilonM=epsilonM; 0063 stMdip.epsilonIn=epsilonIn; 0064 stMdip.d=d; 0065 stMdip.x=x; 0066 stMdip.s=s; 0067 stMdip.xp=xp; 0068 0069 0070 if (strcmpi(sCoeff,'suscep') || strcmpi(sCoeff,'both')) 0071 stMdip.Gamma=stGDAB.Gamma; 0072 stMdip.Delta=stGDAB.Delta; 0073 stMdip.A=stGDAB.A; 0074 stMdip.B=stGDAB.B; 0075 end 0076 0077 if (strcmpi(sCoeff,'coeff') || strcmpi(sCoeff,'both')) 0078 % calculate incident field coefficient an1, bn1, and bn0 0079 stIncEabn1bn0=DipIncEabn1bn0(nNmax,xp); 0080 stMdip.cn1=stGDAB.Gamma .* stIncEabn1bn0.an1; 0081 stMdip.dn1=stGDAB.Delta .* stIncEabn1bn0.bn1; 0082 stMdip.dn0=stGDAB.Delta .* stIncEabn1bn0.bn0; 0083 stMdip.alphan1=stGDAB.A .* stIncEabn1bn0.an1; 0084 stMdip.betan1=stGDAB.B .* stIncEabn1bn0.bn1; 0085 stMdip.betan0=stGDAB.B .* stIncEabn1bn0.bn0; 0086 % coefficient of expansion of incident dipole field in far field 0087 stIncEefn1fn0=DipIncEefn1fn0(nNmax,xp); 0088 stMdip.en1=stIncEefn1fn0.en1; 0089 stMdip.fn1=stIncEefn1fn0.fn1; 0090 stMdip.fn0=stIncEefn1fn0.fn0; 0091 end 0092 0093 % plot if required 0094 if strcmpi(sPlot,'plot') 0095 disp 'Drawing plot...' 0096 DipPlotM(stMdip); 0097 end 0098 0099 disp 'DipSolveSingleSphere: done.' 0100 disp ' '