Home > SPlaC v1_0 > BookFigures > MakeFig6_7.m

MakeFig6_7

PURPOSE ^

Function to reproduce Fig. 6.7

SYNOPSIS ^

function MakeFig6_7()

DESCRIPTION ^

 Function to reproduce Fig. 6.7
 Imaginary parts of epsilon for silver and gold (left)
 and quality factor of the LSP resonances
 in the ES approximation from Eq. 6.38 (right).

 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 % Computations
0003 %%%%%%%%%%%%%%%%%%
0004 
0005 % lambda in nm (column)
0006 lambdaStep=0.5; % in nm
0007 lambda=transpose(200:lambdaStep:1200);
0008 
0009 % calculate epsilon for Ag and Au
0010 eAg=epsAg(lambda);
0011 eAu=epsAu(lambda);
0012 
0013 eAgReal=real(eAg);
0014 eAgImag=imag(eAg);
0015 eAuReal=real(eAu);
0016 eAuImag=imag(eAu);
0017 
0018 % calculate d\epsilon'/d\lambda = 0.5/step *(eAgReal_{n+1} - eAgReal_{n-1})
0019 nNbLambda=length(lambda);
0020 deAgReal=0*lambda; % L x 1
0021 deAgReal(2:(nNbLambda-1))=0.5/lambdaStep*(eAgReal(3:nNbLambda)-eAgReal(1:(nNbLambda-2)));
0022 deAgReal(1)=deAgReal(2);
0023 deAgReal(nNbLambda)=deAgReal(nNbLambda-1);
0024 deAuReal=0*lambda; % L x 1
0025 deAuReal(2:(nNbLambda-1))=0.5/lambdaStep*(eAuReal(3:nNbLambda)-eAuReal(1:(nNbLambda-2)));
0026 deAuReal(1)=deAuReal(2);
0027 deAuReal(nNbLambda)=deAuReal(nNbLambda-1);
0028 
0029 QAg=-lambda.*deAgReal./(2*eAgImag);
0030 QAu=-lambda.*deAuReal./(2*eAuImag);
0031 
0032 % calculate values for small sphere in water
0033 lambdaResAg=387;
0034 lambdaResAu=518;
0035 
0036 indResAg=find(lambda==lambdaResAg);
0037 indResAu=find(lambda==lambdaResAu);
0038 
0039 
0040 %%%%%%%%%%%%%%%%%%
0041 % Drawing
0042 %%%%%%%%%%%%%%%%%%
0043 
0044 % create, position, and resize figure
0045 scrsz = get(0,'ScreenSize'); % scrsz(3) contains screen width
0046 figAspectRatio=3;
0047 figWidth=3/4*scrsz(3);
0048 figure('Name','Fig. 6.7', ...
0049     'Position',[(scrsz(3)-figWidth)/2 scrsz(4)-150-figWidth/figAspectRatio figWidth figWidth/figAspectRatio]);
0050 
0051 % plot imag(epsilon)
0052 subplot(1,2,1);
0053 plot(lambda,eAuImag,'r',lambda,eAgImag,'b');
0054 % format graph
0055 axis([200 1200 0 6]);
0056 xlabel('Wavelength [nm]');
0057 ylabel('Im(\epsilon(\omega)');
0058 legend('Gold','Silver');
0059 title('Optical absorption');
0060 
0061 % plot Q
0062 subplot(1,2,2);
0063 plot(lambda,QAu,'r',lambda,QAg,'b');
0064 hold on;
0065 plot([lambda(1) lambda(indResAg) lambda(indResAg)], ...
0066     [QAg(indResAg) QAg(indResAg) 0],'b:');
0067 plot([lambda(1) lambda(indResAu) lambda(indResAu)], ...
0068     [QAu(indResAu) QAu(indResAu) 0],'r:');
0069 % format graph
0070 axis([300 1000 0 60]);
0071 xlabel('Wavelength [nm]');
0072 ylabel('Q-factor');
0073 legend('Gold','Silver');
0074 title('Resonance quality factor');
0075 
0076 
0077 
0078

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)