Home > SPlaC v1_0 > BookFigures > MakeFig6_18.m

MakeFig6_18

PURPOSE ^

Function to reproduce Fig. 6.18

SYNOPSIS ^

function MakeFig6_18()

DESCRIPTION ^

 Function to reproduce Fig. 6.18
 Spheroid's aspect ratio dependence of the SERS EFs (average
 and maximum) at the dipolar resonance wavelength in the ES approximation
 for excitation along the long axis (x-axis)
 for gold and silver spheroids in water (a) or air (b).
 the resonance wavelength are also shown with scale on the right axis.

 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 % aspect ratios [1 x G]
0002 hArray=[1.01 1.1:0.1:10];
0003 zeroh=0*hArray;
0004 oneArray=1+zeroh; % [1 x G]
0005 
0006 % get geometrical factors for oblate and prolate spheroids
0007 stEllGobl=EllOblateGeomFact(hArray,oneArray,'x');
0008 stEllGpro=EllProlateGeomFact(hArray,oneArray,'x');
0009 
0010 % create, position, and resize figure
0011 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0012 figAspectRatio=1;
0013 figHeight=scrsz(4)-100;
0014 figWidth=figAspectRatio*figHeight;
0015 figure('Name','Fig. 6.18', ...
0016     'Position',[(scrsz(3)-figWidth)/2 0 figWidth figHeight]);
0017 
0018 % lambda in reverse order since we want to find the largest
0019 % lambda meeting the resonance condition
0020 lambda=transpose(1500:-0.2:200);
0021 eAg=epsAg(lambda);
0022 eAu=epsAu(lambda);
0023 % -real(epsilon) for silver and gold
0024 emrAg=-(real(eAg));
0025 emrAu=-(real(eAu));
0026 ind=find(emrAg<0); % remove negative values
0027 emrAg(ind)=ind*0;
0028 ind=find(emrAu<0);
0029 emrAu(ind)=ind*0;
0030 
0031 nNbH=length(hArray);
0032 
0033 indResAgObl=zeroh; indResAgPro=zeroh;
0034 indResAuObl=zeroh; indResAuPro=zeroh;
0035 % FMaxAgObl=zeroh; FMaxAgPro=zeroh;
0036 % FAveAgObl=zeroh; FAveAgPro=zeroh;
0037 % FMaxAuObl=zeroh; FMaxAuPro=zeroh;
0038 % FAveAuObl=zeroh; FAveAuPro=zeroh;
0039 
0040 % loop twice for each plot
0041 for nn=1:2
0042     if nn==1 % in water
0043         epsilonM=1.77;
0044         sTitle='(a) Spheroids in water';
0045     else % in air
0046         epsilonM=1.0;
0047         sTitle='(b) Spheroids in air';
0048     end
0049 
0050     for nh=1:nNbH
0051         % find resonance conditions for Ag
0052         ind=find(emrAg < (epsilonM*(1/stEllGobl.L1(nh)-1)),1);
0053         if (ind), indResAgObl(nh)=ind; end % will be zero if not found
0054         ind=find(emrAg < (epsilonM*(1/stEllGpro.L1(nh)-1)),1);
0055         if (ind), indResAgPro(nh)=ind; end % will be zero if not found
0056         % find resonance conditions for Au
0057         ind=find(emrAu < (epsilonM*(1/stEllGobl.L1(nh)-1)),1);
0058         if (ind), indResAuObl(nh)=ind; end % will be zero if not found
0059         ind=find(emrAu < (epsilonM*(1/stEllGpro.L1(nh)-1)),1);
0060         if (ind), indResAuPro(nh)=ind; end % will be zero if not found
0061     end
0062 
0063     % note that an error will occur if no resonance condition is found
0064     % For this figure, the resonance condition is always found, so we do not
0065     % check for such problems
0066     
0067     % calculate EM properties for each of the 4 cases
0068     % oblate Ag
0069     stEllEM=EllEMproperties(stEllGobl,epsilonM,eAg(indResAgObl),'x');
0070     % fields in stEllEM are [H x H]
0071     % only the diagonal terms are of interest, they correspond to the
0072     % values at the resonance condition
0073     % note that the code could be much faster if only what was needed was
0074     % computed
0075     FMaxAgObl=(diag(stEllEM.Aperp1)).^2; % [1 x H]
0076     FAveAgObl=diag(stEllEM.F0E4Ave1); % [1 x H]
0077 
0078     % prolate Ag
0079     stEllEM=EllEMproperties(stEllGpro,epsilonM,eAg(indResAgPro),'x');
0080     FMaxAgPro=(diag(stEllEM.Aperp1)).^2; % [1 x H]
0081     FAveAgPro=diag(stEllEM.F0E4Ave1); % [1 x H]
0082 
0083     % obolate Au
0084     stEllEM=EllEMproperties(stEllGobl,epsilonM,eAu(indResAuObl),'x');
0085     FMaxAuObl=(diag(stEllEM.Aperp1)).^2; % [1 x H]
0086     FAveAuObl=diag(stEllEM.F0E4Ave1); % [1 x H]
0087 
0088     % prolate Ag
0089     stEllEM=EllEMproperties(stEllGpro,epsilonM,eAu(indResAuPro),'x');
0090     FMaxAuPro=(diag(stEllEM.Aperp1)).^2; % [1 x H]
0091     FAveAuPro=diag(stEllEM.F0E4Ave1); % [1 x H]
0092     
0093     % plot results
0094     axtmp=subplot(2,1,nn);
0095     postmp=get(axtmp,'Position');
0096     delete(axtmp);
0097     ax1=axes('Position',postmp.*[1,1,0.7,1],...
0098         'XAxisLocation','bottom','XColor','k', ...
0099         'YAxisLocation','left','Ycolor','k', ...
0100         'YScale','Log', ...
0101         'XLim', [1.01 10], 'YLim', [10 1e12]);
0102     set(get(ax1,'XLabel'),'String','Aspect ratio, h');
0103     set(get(ax1,'YLabel'),'String','SERS EF at resonance');
0104     set(ax1,'YGrid','on','YMinorGrid','off');
0105     
0106     line(hArray,FMaxAgPro,'Color','r','LineStyle','-','LineWidth',0.5);
0107     line(hArray,FMaxAgObl,'Color','b','LineStyle','-','LineWidth',0.5);
0108     line(hArray,FAveAgPro,'Color','r','LineStyle','-','LineWidth',1.5);
0109     line(hArray,FAveAgObl,'Color','b','LineStyle','-','LineWidth',1.5);
0110     line(hArray,FMaxAuPro,'Color','r','LineStyle','--','LineWidth',0.5);
0111     line(hArray,FMaxAuObl,'Color','b','LineStyle','--','LineWidth',0.5);
0112     line(hArray,FAveAuPro,'Color','r','LineStyle','--','LineWidth',1.5);
0113     line(hArray,FAveAuObl,'Color','b','LineStyle','--','LineWidth',1.5);
0114     h=legend({'F_{Max} (prolate)', 'F_{Max} (oblate)',...
0115         '<F_0^{E4}> (prolate)', '<F_0^{E4}> (oblate)'},'Location','NorthEast');
0116     % move legend
0117     tmploc=get(h,'Position');
0118     tmploc(1)=0.95-tmploc(3);
0119     set(h,'Position',tmploc);
0120     title(sTitle);
0121     text(1.2,1e11,0,{'Ag (solid lines)','Au (dashed lines)'});
0122 
0123     
0124     ax2=axes('Position',get(gca,'Position'),...
0125         'XAxisLocation','top','XColor','k', ...
0126         'XTickLabel',[], ...
0127         'YAxisLocation','right','Ycolor','k', ...
0128         'Color','none', ...
0129         'YScale','Linear', ...
0130         'YLim',[300 1990],'XLim',[1.01 10]);
0131     set(get(ax2,'Ylabel'),'String','Resonance wavelength, \lambda_{Res} [nm]');
0132 
0133     line(hArray,lambda(indResAgPro),'Color','c','LineStyle','-');
0134     line(hArray,lambda(indResAgObl),'Color','m','LineStyle','-');
0135     line(hArray,lambda(indResAuPro),'Color','c','LineStyle','--');
0136     line(hArray,lambda(indResAuObl),'Color','m','LineStyle','--');
0137     h=legend({'\lambda_{Res} (prolate)','\lambda_{Res} (oblate)'}, ...
0138         'Location','SouthEastOutside','Color','w');
0139     tmploc=get(h,'Position');
0140     tmploc(1)=0.95-tmploc(3);
0141     set(h,'Position',tmploc);
0142 
0143 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)