Home > SPlaC v1_0 > BookFigures > MakeFig6_10a.m

MakeFig6_10a

PURPOSE ^

Function to reproduce Fig. 6.10(a)

SYNOPSIS ^

function MakeFig6_10a()

DESCRIPTION ^

 Function to reproduce Fig. 6.10(a)
 Spatial distribution of the local field,
 characterized by the enhancement factor log10(MLoc) (left),
 and the proportion of the normal component |Eperp|2/|ELoc|2 (right),
 computed at the quadrupolar LSP resonance of a 50 nm radius silver
 sphere in water at 393 nm.

 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 global noCheckSum;
0002 noCheckSum=true; % no check for numerical problems (much faster)
0003 % noCheckSum=false; % to check for numerical problems with Mie
0004 
0005 % N_{max} for Mie series
0006 nNmax=50; % same for all plots
0007 
0008 % dielectric constant of outside medium (real positive)
0009 epsilonM=1.77; % water (same for all plots)
0010 
0011 % create, position, and resize figure
0012 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0013 figAspectRatio=2;
0014 figWidth=3/4*scrsz(3);
0015 figure('Name','Fig. 6.10(a)', ...
0016     'Position',[(scrsz(3)-figWidth)/2 scrsz(4)-150-figWidth/figAspectRatio figWidth figWidth/figAspectRatio]);
0017 
0018 nNbTheta=31; % = T
0019 theta=transpose(linspace(0,pi,nNbTheta)); % col [T x 1]
0020 nNbPhi=nNbTheta;
0021 phi=linspace(-pi,pi,nNbPhi); % row [1 x F]
0022 % point coordinates on sphere, matrices [T x F]
0023 xs=sin(theta) * cos(phi); 
0024 ys=sin(theta) * sin(phi); 
0025 zs=repmat(cos(theta),1,nNbPhi); 
0026 
0027 % wavelenght in nm
0028 lambda=393; 
0029 % dielectric function of sphere material
0030 % vector column, same size as lambda [1 x 1] here
0031 epsilonIn=epsAg(lambda); % silver
0032 
0033 % sphere radius in nm
0034 a=50;
0035 
0036 % Solve problem using Mie theory
0037 stM=PweSolveSingleSphere(nNmax,a,lambda,epsilonM,epsilonIn,'noplot','coeff');
0038 % all necessary results are in structure stM
0039 % stM contains fields cn1 and dn1
0040 % calculate field for all points on the surface (just outside)
0041 stEsurf=PweEsurf(lambda,epsilonM,stM,a,nNbTheta,'Outside');
0042     
0043 % theta dependence
0044 Ecr2=transpose(abs(stEsurf.Ecr).^2); % col [T x 1]
0045 Ec2=Ecr2+transpose(abs(stEsurf.Ect).^2); % col [T x 1]
0046 Es2=transpose(abs(stEsurf.Esf).^2); % col [T x 1]
0047 
0048 % phi-and-theta dependence
0049 % these are matrices [T x F]
0050 MLoc=Ec2 * (cos(phi).^2) + Es2 * (sin(phi).^2); 
0051 MLocPerp=Ecr2 * (cos(phi).^2);
0052     
0053 % plot results
0054 
0055 hpl1=subplot(1,2,1);
0056 set(hpl1,'Outerposition',[0,0,0.5,1]);
0057 % main surface plot
0058 surf(xs,ys,zs,log10(MLoc));
0059 axis tight; axis equal; axis off;
0060 colormap gray; colorbar('eastOutside','fontsize',8);
0061 set(hpl1,'CameraViewAngle',8.5);
0062 hold on;
0063 line([-1.6;1.6], [0;0],[0;0],'LineStyle','--','Color','k');
0064 line([0;0],[-1.8;1.8], [0;0],'LineStyle','--','Color','k');
0065 line([0;0],[0;0],[-1.4;1.4], 'LineStyle','--','Color','k');
0066 quiver3(-1.7,0,0,0.5,0,0,'k');
0067 text(-1.55,-0.1,-0.07,'\bf E_0');
0068 quiver3(-1.7,0,0,0,0,0.5,'k');
0069 text(-1.9,0,0.3,'\bf k');
0070 text(-0.9,0,1.85,'\bf log_{10}( M_{Loc}=|E_{Loc}|^2/|E_{Inc}|^2 )');
0071 ht=title('Silver sphere in water - a=50nm - \lambda=393 nm');
0072 set(ht,'Position',get(ht,'Position')+[1.4 -1.1 0]);
0073 hold off;
0074     
0075 hpl2=subplot(1,2,2);
0076 set(hpl2,'Outerposition',[0.5,0,0.5,1])
0077 surf(xs,ys,zs,MLocPerp./MLoc);
0078 axis tight; axis equal;axis off;
0079 colormap gray; colorbar('eastOutside','fontsize',8);
0080 set(hpl2,'CameraViewAngle',8.5);
0081 hold on;
0082 line([-1.6;1.6], [0;0],[0;0],'LineStyle','--','Color','k');
0083 line([0;0],[-1.8;1.8], [0;0],'LineStyle','--','Color','k');
0084 line([0;0],[0;0],[-1.4;1.4], 'LineStyle','--','Color','k');
0085 quiver3(-1.7,0,0,0.5,0,0,'k');
0086 text(-1.55,-0.1,-0.07,'\bf E_0');
0087 quiver3(-1.7,0,0,0,0,0.5,'k');
0088 text(-1.9,0,0.3,'\bf k');
0089 text(-0.6,0,1.85,'\bf |E^{Perp}_{Loc}|^2/|E_{Loc}|^2');
0090 hold off;

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)