Home > SPlaC v1_0 > BookFigures > MakeFig4_3.m

MakeFig4_3

PURPOSE ^

Function to reproduce Fig. 4.3

SYNOPSIS ^

function MakeFig4_3()

DESCRIPTION ^

 Function to reproduce Fig. 4.3
 Example of modification of dipole emission on the surface (at d=1 nm)
 of a glass and silver sphere of radius 25 nm.
 Note that the third column (dimer) cannot be reproduced with these codes.

 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 % N_{max} for Mie series
0010 nNmax=50; 
0011 % N_{max} for Mtot in the ESA (not used here)
0012 nNmaxESA=50; 
0013 
0014 % sphere radius in nm
0015 a=25;
0016 % distance of dipole from sphere in nm
0017 d=1;
0018 
0019 % wavelengths (column)
0020 lambda=transpose(300:1:600);
0021 
0022 % dielectric constant of outside medium (real positive)
0023 epsilonM=1.0; % air
0024 
0025 % create, position, and resize figure
0026 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0027 figAspectRatio=1;
0028 figHeight=scrsz(4)-150;
0029 figWidth=figAspectRatio*figHeight;
0030 figure('Name','Fig. 4.3', ...
0031     'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0032 
0033 % loop twice for Ag and Glass
0034 for gg=1:2
0035 
0036     % wavelength-dependent dielectric function of sphere material
0037     % vector column, same size as lambda [L x 1] or scalar
0038     if gg==1
0039         epsilonIn=2.25; % glass
0040         sTitle='Glass sphere in air';
0041         sYscale='linear';
0042         axScale=[275 625 0.3 2.8];
0043         sLegLoc='East';
0044     else
0045         epsilonIn=epsAg(lambda); % silver
0046         sTitle='Silver sphere in air';
0047         sYscale='log';
0048         axScale=[275 625 0.09 600];
0049         sLegLoc='NorthEast';
0050 end
0051     
0052     % Solve problem for all wavelength using Mie theory
0053     stMdip=DipSolveSingleSphere(nNmax,a,lambda,epsilonM,epsilonIn,d,nNmaxESA,'noplot','coeff');
0054     % all necessary results are in structure stMdip
0055 
0056     % Calculate radiation profiles (for all lambda here, even if not needed
0057     % for the plots)
0058     nNbTheta=361;
0059     stEfarAllP=DipFarFieldAllP(stMdip,nNbTheta);
0060     theta=stEfarAllP.theta;
0061     % create negative theta for a 2pi plot
0062     indNegTheta=length(theta):-1:2;
0063     indAllTheta=[indNegTheta,1:length(theta)];
0064     % substract pi/2 from all to rotate graph as in Fig. 4.2
0065     thetaAll=[-theta(indNegTheta), theta] - pi/2;
0066     
0067     %%%%%%%%%%%%%%%%%%
0068     % Drawing
0069     %%%%%%%%%%%%%%%%%%
0070 
0071     % plot MRad
0072     subplot(3,2,gg);
0073     plot(lambda,stMdip.MRadPerp,lambda,stMdip.MRadPara);
0074     set(gca,'YScale',sYscale);
0075     axis(axScale);
0076     title(sTitle);
0077     legend({'M_{Rad}^{perp}','M_{Rad}^{//}'},'Location',sLegLoc);
0078     xlabel('Wavelength [nm]');
0079     ylabel('M_{Rad}');
0080     
0081     % plot radiation profile modification, M^d_Rad,
0082     % for lambda=360 for perpendicular dipole
0083     indlambda=find(lambda==360);
0084     subplot(3,2,2+gg);
0085     polar(thetaAll,stEfarAllP.MdRadPerpAllPhi(indlambda,indAllTheta));
0086     ylabel('M^{d-Perp}_{Rad}');
0087     title([sTitle '- \lambda=360nm - M^{Perp}_{Rad}=' ...
0088         num2str(stMdip.MRadPerp(indlambda))]);
0089 
0090     % plot radiation profile modification, M^d_Rad,
0091     % for lambda=360 for perpendicular dipole
0092     subplot(3,2,4+gg);
0093     polar(thetaAll,stEfarAllP.MdRadParaPhi0(indlambda,indAllTheta));
0094     ylabel('M^{d-Para}_{Rad}');
0095     title([sTitle '- \lambda=360nm - M^{Para}_{Rad}=' ...
0096         num2str(stMdip.MRadPara(indlambda))]);
0097 
0098 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)