Home > SPlaC v1_0 > BookFigures > MakeFig6_6.m

MakeFig6_6

PURPOSE ^

Function to reproduce Fig. 6.6

SYNOPSIS ^

function MakeFig6_6()

DESCRIPTION ^

 Function to reproduce Fig. 6.6
 Extinction, scattering, and absorption coefficients from Mie theory
 for gold spheres of radii 10, 25, and 50 nm 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 
0002 global noCheckSum;
0003 noCheckSum=true; % no check for numerical problems (much faster)
0004 % noCheckSum=false; % to check for numerical problems with Mie
0005 
0006 % wavelengths (column)
0007 lambda=transpose(300:1:800); 
0008 
0009 % N_{max} for Mie series
0010 nNmax=50;
0011 
0012 % wavelength-dependent dielectric function of sphere material
0013 % vector column, same size as lambda [L x 1]
0014 epsilonIn=epsAu(lambda); % gold
0015 
0016 
0017 % create, position, and resize figure
0018 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0019 figAspectRatio=1;
0020 figHeight=scrsz(4)-150;
0021 figWidth=figAspectRatio*figHeight;
0022 figure('Name','Fig. 6.6', ...
0023     'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0024 
0025 % dielectric constant of outside medium (real positive)
0026 epsilonMArray=[1.0, 1.77, 1.0, 1.77, 1.0, 1.77]; % air or water
0027 
0028 % sphere radius in nm
0029 aArray=[10, 10, 25, 25, 50, 50];
0030 
0031 sLegendCell={'air', 'water', 'air', 'water', 'air', 'water'};
0032 
0033 % loop through each of the six plots to create
0034 for nn=1:6
0035     
0036     epsilonM=epsilonMArray(nn);
0037     a=aArray(nn);
0038     
0039     % Solve problem using Mie theory
0040     stM=PweSolveSingleSphere(nNmax,a,lambda,epsilonM,epsilonIn,'noplot');
0041     % all necessary results are in structure stM
0042 
0043     % plot results
0044     axtmp=subplot(3,2,nn);
0045     postmp=get(axtmp,'Position');
0046     delete(axtmp);
0047     
0048     ax1=axes('Position',postmp,...
0049         'XAxisLocation','bottom','XColor','k', ...
0050        'YAxisLocation','left','Ycolor','b');
0051 
0052    if mod(nn,2)==0
0053         xlim1=[300 800];
0054         set(ax1,'XLim',xlim1,'YLim',[0 8]);
0055     else
0056         xlim1=[300 800];
0057         set(ax1,'XLim',xlim1,'YLim',[0 4.5]);
0058     end
0059 
0060     if mod(nn,3)==0
0061         set(get(ax1,'XLabel'),'String','Wavelength [nm]');
0062     end
0063     set(get(ax1,'YLabel'),'String','Q_{ext},Q_{sca},Q_{abs}');
0064 
0065     line(lambda,stM.Qext,'Color','b','LineWidth',1.5);
0066     line(lambda,stM.Qsca,'Color',[0 0.5 0]); % darker green
0067     line(lambda,stM.Qabs,'Color','k','LineStyle','--');
0068     
0069     if nn==1
0070         legend({'Q_{ext}','Q_{sca}','Q_{abs}'});
0071     end
0072     title(['Au in ' sLegendCell{nn} '  - a=' num2str(stM.a) 'nm']);
0073     ax2=axes('Position',get(ax1,'Position'),...
0074        'XAxisLocation','top','XColor','k', ...
0075        'XTickLabel',[], ...
0076        'YAxisLocation','right','Ycolor','r', ...
0077        'Color','none', ...
0078        'YScale','linear', ...
0079        'YLim',[0 1],'XLim',xlim1);
0080     set(get(ax2,'Ylabel'),'String','Q_{abs}/Q_{ext}');
0081 
0082     line(lambda,stM.Qabs./stM.Qext,'Color','r','LineStyle',':');
0083 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)