Home > SPlaC v1_0 > BookFigures > MakeFig6_5.m

MakeFig6_5

PURPOSE ^

Function to reproduce Fig. 6.5

SYNOPSIS ^

function MakeFig6_5()

DESCRIPTION ^

 Function to reproduce Fig. 6.5
 Summary of LSP resonances from Mie theory
 for silver spheres in air or water as a function of radius.

 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 global noCheckSum;
0006 noCheckSum=true; % no check for numerical problems (much faster)
0007 % noCheckSum=false; % to check for numerical problems with Mie
0008 
0009 % wavelengths (column)
0010 lambda=transpose(300:1:800); 
0011 
0012 % N_{max} for Mie series
0013 nNmax=50;
0014 
0015 % wavelength-dependent dielectric function of sphere material
0016 % vector column, same size as lambda [L x 1]
0017 epsilonIn=epsAg(lambda); % silver
0018 
0019 
0020 % sphere radius in nm (column vector)
0021 aArray=[2;10;15;20;25;30;35;40;50;60;80;100];
0022 
0023 nba=length(aArray);
0024 
0025 % preallocate arrays
0026 QextResAir=0*aArray;
0027 indResAir=0*aArray;
0028 QextResWat=0*aArray;
0029 indResWat=0*aArray;
0030 
0031 nNbLambda=length(lambda);
0032 indForMaxAir=transpose(1:nNbLambda);
0033 indForMaxWat=indForMaxAir;
0034 
0035 % loop through each of the radii
0036 for nn=1:nba
0037     
0038     % dielectric constant of outside medium (real positive)
0039     epsilonM=1.0; % air first
0040     a=aArray(nn);
0041     
0042     % Solve problem using Mie theory
0043     stM=PweSolveSingleSphere(nNmax,a,lambda,epsilonM,epsilonIn,'noplot');
0044 
0045     % Look for maximum of Q_{ext} that is redshifted compared to previous
0046     % radius (to isolate dipolar LSP rather than multipolar)
0047     % the zeros are added to make sure the vector in max is same length as
0048     % lambda
0049     [QextResAir(nn),indResAir(nn)]=max([zeros(nNbLambda-length(indForMaxAir),1); stM.Qext(indForMaxAir)]);
0050     indForMaxAir=transpose(indResAir(nn):nNbLambda);
0051     
0052     % repeat for water
0053     epsilonM=1.77; % water
0054     stM=PweSolveSingleSphere(nNmax,a,lambda,epsilonM,epsilonIn,'noplot');
0055     % Look for maximum of Q_{ext}
0056     [QextResWat(nn),indResWat(nn)]=max([zeros(nNbLambda-length(indForMaxWat),1); stM.Qext(indForMaxWat)]);
0057     indForMaxWat=transpose(indResWat(nn):nNbLambda);
0058 end
0059 
0060 %%%%%%%%%%%%%%%%%
0061 % Drawing
0062 %%%%%%%%%%%%%%%%%
0063 
0064 % create, position, and resize figure
0065 scrsz = get(0,'ScreenSize'); % scrsz(3) contains screen width
0066 figAspectRatio=1.5;
0067 figWidth=3/4*scrsz(3);
0068 figure('Name','Fig. 6.5', ...
0069     'Position',[(scrsz(3)-figWidth)/2 scrsz(4)-150-figWidth/figAspectRatio figWidth figWidth/figAspectRatio]);
0070 
0071 % plot results
0072 
0073 ax1=axes('XAxisLocation','bottom','Xcolor','k', ...
0074        'YAxisLocation','left','Ycolor','b', ...
0075        'XLim',[0 118],'YLim',[302 800]);
0076 set(get(ax1,'XLabel'),'String','Radius, a [nm]');
0077 set(get(ax1,'YLabel'),'String','Dipolar LSPR wavelength [nm]');
0078 
0079 line(aArray,lambda(indResAir),'Color','b','Marker','s','LineStyle','-');
0080 line(aArray,lambda(indResWat),'Color','b','Marker','o','LineStyle','-');
0081 
0082 legend({'\lambda_{Res} (air)','\lambda_{Res} (water)'},'Location','NorthEast');
0083 
0084 title('Summary of dipolar LSP resonance wavelengths for silver spheres');
0085 
0086 axes('Position',get(ax1,'Position'),...
0087        'XAxisLocation','top','XColor','k', ...
0088        'YAxisLocation','right','Ycolor','r', ...
0089        'Color','none', ...
0090        'YScale','linear', ...
0091        'YLim',[1.8 23.8],'XLim',[0 118], ...
0092        'XTickLabel',[]);
0093 line(aArray,QextResAir,'Color','r','LineStyle','--','Marker','s');
0094 line(aArray,-real(epsilonIn(indResAir)),'Color','m','LineStyle',':','Marker','s');
0095 
0096 legend({'Q_{ext}(\lambda_{Res}) (air)','-Re(\epsilon(\lambda_{Res})) (air)'},'Location','SouthEast','Color','w');

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)