Home > SPlaC v1_0 > Mie > DIP > DipPlotM.m

DipPlotM

PURPOSE ^

Plots the results of DipSolveSingleSphere as lambda-dependence of MRad and MTot

SYNOPSIS ^

function DipPlotM(stMdip,px,pz)

DESCRIPTION ^

 Plots the results of DipSolveSingleSphere as lambda-dependence of MRad and MTot
 If px and pz are not specified then results are plotted
 for both Para and Perp dipoles.

 Parameters:
 - stMdip: obtained from DipSolveSingleSphere or MulDipSolveMultiSphere
 - px,pz: optional vectors (same lengths) with components of dipole moment

 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 lambda=stMdip.lambda;
0002 
0003 figure('Name','Decay rate EFs');
0004     title(['Mie dipole emission: nNmax=' ...
0005         int2str(stMdip.nNmax) ', a=' num2str(stMdip.a) 'nm, d=' num2str(stMdip.d) 'nm']);
0006 
0007 if nargin<3
0008     semilogy(lambda,stMdip.MRadPerp,'b-',lambda,stMdip.MTotPerp,'b:', ...
0009      lambda,stMdip.MRadPara,'r-',lambda,stMdip.MTotPara,'r:');
0010     xlabel('Wavelength [nm]');
0011     ylabel('Decay rate EFs');
0012     legend({'M_{Rad}^{Perp}','M_{Tot}^{Perp}', ...
0013             'M_{Rad}^{Para}','M_{Tot}^{Para}'});
0014 else
0015     pxnorm2=px.^2./(px.^2+pz.^2);
0016     pznorm2=pz.^2./(px.^2+pz.^2);
0017     nNbP=length(px);
0018     pxnorm2=reshape(pxnorm2,1,nNbP); % ensures it is a row vector [1xP]
0019     pznorm2=reshape(pznorm2,1,nNbP); % ensures it is a row vector [1xP]
0020     % matrix products to obtain [L x P] matrices for plot
0021     MRad=(stMdip.MRadPara * pxnorm2) + (stMdip.MRadPerp * pznorm2);
0022     MTot=(stMdip.MTotPara * pxnorm2) + (stMdip.MTotPerp * pznorm2);
0023     
0024     hg=semilogy(lambda,MRad(:,1),'-');
0025     line(lambda,MTot(:,1),'LineStyle',':','Color',get(hg(1),'Color'));
0026     xlabel('Wavelength [nm]');
0027     ylabel('Decay rate EFs');
0028     CsLegend=cell(1,2*nNbP);
0029     CsLegend{1}=['M_{Rad} - px=' num2str(px(1)) ',pz=' num2str(pz(1))];
0030     CsLegend{2}=['M_{Tot} - px=' num2str(px(1)) ',pz=' num2str(pz(1))];
0031     % loop through additional cases for legend and colors
0032     hold on;
0033     colVec=get(gca,'ColorOrder');
0034     nNbCol=length(colVec);
0035     for pp=2:nNbP
0036         CsLegend{2*pp-1}=['M_{Rad} - px=' num2str(px(pp)) ',pz=' num2str(pz(pp))];
0037         CsLegend{2*pp}=['M_{Tot} - px=' num2str(px(pp)) ',pz=' num2str(pz(pp))];
0038         line(lambda,MRad(:,pp),'LineStyle','-','Color',colVec(1+mod(pp-1,nNbCol),:));
0039         line(lambda,MTot(:,pp),'LineStyle',':','Color',colVec(1+mod(pp-1,nNbCol),:));
0040     end
0041     legend(CsLegend);
0042 end
0043 title(['Mie dipole: nNmax=' int2str(stMdip.nNmax) ...
0044     ', nNmaxESA=' int2str(stMdip.nNmaxESA) ', a=' num2str(stMdip.a) 'nm' ...
0045     ', d=' num2str(stMdip.d) 'nm']);
0046 
0047

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)