Home > SPlaC v1_0 > BookFigures > MakeFig6_8.m

MakeFig6_8

PURPOSE ^

Function to reproduce Fig. 6.8

SYNOPSIS ^

function MakeFig6_8()

DESCRIPTION ^

 Function to reproduce Fig. 6.8
 Wavelength dependence of the LFIEF at several points on the sphere surface
 for several cases from Mie theory and in the ES approximation.

 This file is part of the SPlaC v1.0 package (copyright 2008)
 Check the README file for further information

EXAMPLE OF OUTPUT ^

Example figure output

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 global noCheckSum;
0003 noCheckSum=true; % no check for numerical problems (much faster)
0004 % noCheckSum=false; % to check for numerical problems with Mie
0005 
0006 % N_{max} for Mie series
0007 nNmax=50; % same for all plots
0008 
0009 % dielectric constant of outside medium (real positive)
0010 epsilonM=1.77; % water (same for all plots)
0011 
0012 
0013 % create, position, and resize figure
0014 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0015 figAspectRatio=1;
0016 figHeight=scrsz(4)-150;
0017 figWidth=figAspectRatio*figHeight;
0018 figure('Name','Fig. 6.8', ...
0019     'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0020 
0021 % note that ESA results are here obtained for convenience
0022 % from Mie theory with a=0.1 nm
0023 aArray=[10,0.1,25,50,50,0.1];
0024 sTitle={'Silver (a=10 nm) in water', ...
0025     'Silver (ESA) in water', ...
0026     'Silver (a=25 nm) in water', ...
0027     'Silver (a=50 nm) in water', ...
0028     'Gold (a=50 nm) in water', ...
0029     'Gold (ESA) in water'};
0030 CYscale={[0.5 4000], [0.5 4000], [0.5 500], ...
0031     [0.1 80], [0.06 100], [0.06 100]};
0032    
0033 % loop through each of the six plots to create
0034 for nn=1:6
0035     
0036     if (nn<=4) % for silver
0037         lambdamin=200;
0038         lambdamax=600;
0039         % wavelengths (column)
0040         lambda=transpose(lambdamin:1:lambdamax); 
0041         % wavelength-dependent dielectric function of sphere material
0042         % vector column, same size as lambda [L x 1]
0043         epsilonIn=epsAg(lambda); % silver
0044     else % for gold
0045         lambdamin=300;
0046         lambdamax=800;
0047         % wavelengths (column)
0048         lambda=transpose(lambdamin:1:lambdamax); 
0049         % wavelength-dependent dielectric function of sphere material
0050         % vector column, same size as lambda [L x 1]
0051         epsilonIn=epsAu(lambda); % gold
0052     end
0053 
0054     % sphere radius in nm
0055     a=aArray(nn);
0056 
0057     % Solve problem using Mie theory
0058     stM=PweSolveSingleSphere(nNmax,a,lambda,epsilonM,epsilonIn,'noplot','coeff');
0059     % all necessary results are in structure stM
0060 
0061 %     % points can be defined in spherical coordinates as follows
0062 %     stPtO=struct('r',0,'theta',0,'phi',0);
0063 %     stPtA=struct('r',a,'theta',pi/2,'phi',0);
0064 %     stPtB=struct('r',a,'theta',pi/2,'phi',pi/2);
0065 %     stPtC=struct('r',a,'theta',0,'phi',0);
0066 %     stPtCp=struct('r',a,'theta',pi,'phi',0);
0067 
0068     % Note that points can also be defined in Cartesian as follows:
0069     stPtO=struct('x',0,'y',0,'z',0);
0070     stPtA=struct('x',a,'y',0,'z',0);
0071     stPtB=struct('x',0,'y',a,'z',0);
0072     stPtC=struct('x',0,'y',0,'z',a);
0073     stPtCp=struct('x',0,'y',0,'z',-a);
0074     
0075     
0076     % inside points
0077     stAbn1.an1=stM.alphan1;
0078     stAbn1.bn1=stM.betan1;
0079     stEptO=PweEpts(lambda,epsilonIn,stAbn1,stPtO,'Inside');
0080     
0081     % outside points, stM already contains fields cn1 and dn1
0082     stPtArray=[stPtA,stPtB,stPtC,stPtCp];
0083     stEptsOut=PweEpts(lambda,epsilonM,stM,stPtArray,'Outside');
0084  
0085     % plot results
0086     subplot(3,2,nn);
0087     hg=semilogy(lambda,stEptO.MLoc,'-', lambda,stEptsOut(1).MLoc,'-', ...
0088         lambda,stEptsOut(2).MLoc,'--', lambda,stEptsOut(3).MLoc,':', ...
0089         lambda,stEptsOut(4).MLoc,'-.');
0090     set(hg(2),'LineWidth',1.5);
0091     axis([[lambdamin lambdamax] CYscale{nn}]);
0092     title(sTitle{nn});
0093     legend({'O','A','B','C','C'''});
0094     xlabel('Wavelength [nm]');
0095     ylabel('M_{Loc}');
0096 end

This web page is part of the SPlaC package © 2008. Contact: Eric Le Ru
Generated on Wed 03-Dec-2008 11:10:14 by m2html © 2003 (adapted)