Home > SPlaC v1_0 > BookFigures > MakeFig6_15.m

MakeFig6_15

PURPOSE ^

Function to reproduce Fig. 6.15

SYNOPSIS ^

function MakeFig6_15()

DESCRIPTION ^

 Function to reproduce Fig. 6.15
 Spheroid's aspect ratio dependence of the geometrical factors
 and of the dipolar resonance wavelength in the ES approximation
 for gold and silver spheroids in air or water.

 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,'L');
0008 stEllGpro=EllProlateGeomFact(hArray,oneArray,'L');
0009 
0010 % create, position, and resize figure
0011 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0012 figAspectRatio=1.3;
0013 figHeight=scrsz(4)-150;
0014 figWidth=figAspectRatio*figHeight;
0015 figure('Name','Fig. 6.15', ...
0016     'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0017 
0018 % plot results
0019 % (a) simple ellipsoid plots
0020 subplot(2,2,1);
0021 ellipsoid(-2,0,0,1,1,3)
0022 hold on;
0023 ellipsoid(1,-3,-2,3,3,1)
0024 ellipsoid(5,0,0,1,1,1)
0025 hold off;
0026 text(-1.5,2,2.5,'(a)');
0027 text(-1,0,2.5,{'Prolate','spheroid','(h=3)'});
0028 text(2.5,0,1.8,{'Sphere','(h=1)'});
0029 text(-0.2,0,-0.75,{'Oblate spheroid','(h=3)'});
0030 axis([-3 3 -3 3 -2.5 2.5]);
0031 axis equal;axis off;
0032 colormap gray;
0033 
0034 % (b) aspect ratio dependence of geometrical factors L's
0035 subplot(2,2,2);
0036 h=plot(hArray,stEllGobl.L3, ':', ...
0037      hArray,stEllGpro.L3, '-', ...
0038      hArray,stEllGobl.L1, ':', ...
0039      hArray,stEllGpro.L1, '-', ...
0040      hArray,oneArray*1/3, '-');
0041 set(h,'LineWidth',1.5);
0042 axis([1 10 -0.03 0.93]);
0043 title('(b) Geometrical factors, L');
0044 xlabel('Aspect ratio, h');
0045 ylabel('Geometrical factor, L_i');
0046 legend({'L_{3o}', 'L_{3p}=L_{2p}', 'L_{1o}=L_{2o}', 'L_{1p}'},'Location','NorthWest');
0047  
0048  
0049 % (c-d) LSP resonance wavelength for silver and gold
0050 % in air (c) and water (d)
0051 
0052 % lambda in reverse order since we want to find the largest
0053 % lambda meeting the resonance condition
0054 lambda=transpose(1500:-0.2:200);
0055 % -real(epsilon) for silver and gold
0056 emrAg=-(real(epsAg(lambda)));
0057 emrAu=-(real(epsAu(lambda)));
0058 ind=find(emrAg<0); % remove negative values
0059 emrAg(ind)=ind*0;
0060 ind=find(emrAu<0);
0061 emrAu(ind)=ind*0;
0062 
0063 nNbH=length(hArray);
0064 
0065 ResAgL1o=zeroh; ResAgL3o=zeroh;
0066 ResAgL1p=zeroh; ResAgL3p=zeroh;
0067 ResAuL1o=zeroh; ResAuL3o=zeroh;
0068 ResAuL1p=zeroh; ResAuL3p=zeroh;
0069 
0070 % loop twice for each plot
0071 for nn=1:2
0072     if nn==1 % in air
0073         epsilonM=1.0;
0074         sTitle='(c) Ellipsoid in air';
0075         lambdaMax=1050;
0076     else % in water
0077         epsilonM=1.77;
0078         sTitle='(c) Ellipsoid in water';
0079         lambdaMax=1350;
0080     end
0081 
0082     for nh=1:nNbH
0083         % find resonance conditions for Ag
0084         ind=find(emrAg < (epsilonM*(1/stEllGobl.L1(nh)-1)),1);
0085         if (ind), ResAgL1o(nh)=lambda(ind); end % will be zero if not found
0086         ind=find(emrAg < (epsilonM*(1/stEllGobl.L3(nh)-1)),1);
0087         if (ind), ResAgL3o(nh)=lambda(ind); end
0088         ind=find(emrAg < (epsilonM*(1/stEllGpro.L1(nh)-1)),1);
0089         if (ind), ResAgL1p(nh)=lambda(ind); end
0090         ind=find(emrAg < (epsilonM*(1/stEllGpro.L3(nh)-1)),1);
0091         if (ind), ResAgL3p(nh)=lambda(ind); end
0092         % find resonance conditions for Au
0093         ind=find(emrAu < (epsilonM*(1/stEllGobl.L1(nh)-1)),1);
0094         if (ind), ResAuL1o(nh)=lambda(ind); end
0095         ind=find(emrAu < (epsilonM*(1/stEllGobl.L3(nh)-1)),1);
0096         if (ind), ResAuL3o(nh)=lambda(ind); end
0097         ind=find(emrAu < (epsilonM*(1/stEllGpro.L1(nh)-1)),1);
0098         if (ind), ResAuL1p(nh)=lambda(ind); end
0099         ind=find(emrAu < (epsilonM*(1/stEllGpro.L3(nh)-1)),1);
0100         if (ind), ResAuL3p(nh)=lambda(ind); end
0101     end
0102 
0103     % plot results
0104     subplot(2,2,nn+2);
0105 
0106     h=plot(hArray,ResAgL3o, '-', ...
0107         hArray,ResAgL3p, '-', ...
0108         hArray,ResAgL1o, '-', ...
0109         hArray,ResAgL1p,'-');
0110     set(h,'LineWidth',1.5);
0111     line(hArray,ResAuL3o,'LineStyle','--', ...
0112         'LineWidth',1.5,'Color',get(h(1),'Color'));
0113     line(hArray,ResAuL3p,'LineStyle','--', ...
0114         'LineWidth',1.5,'Color',get(h(2),'Color'));
0115     line(hArray,ResAuL1o,'LineStyle','--', ...
0116         'LineWidth',1.5,'Color',get(h(3),'Color'));
0117     line(hArray,ResAuL1p,'LineStyle','--', ...
0118         'LineWidth',1.5,'Color',get(h(4),'Color'));
0119     axis([1.01 10 250 lambdaMax]);
0120     set(gca,'YGrid','on','YMinorGrid','off');
0121     title(sTitle);
0122     xlabel('Aspect ratio, h');
0123     ylabel('Resonance wavelength [nm]');
0124     legend({'L_{3o} (Ag)', 'L_{3p}=L_{2p}', 'L_{1o}=L_{2o}', ...
0125         'L_{1p}', 'L_{3o} (Au)'},'Location','NorthWest');
0126 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)