Home > SPlaC v1_0 > Mie > PWE > PweScriptPlotPinTaun.m

PweScriptPlotPinTaun

PURPOSE ^

Script showing the angular dependence of the functions pi_n and tau_n

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Script showing the angular dependence of the functions pi_n and tau_n
 The first figure reproduces Fig. 4.3 of Bohren and Huffman (Ref. 146),
 while the second is the same for the absolute values of the functions.

 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 N=4;
0002 theta=(0:0.01:pi)'; % column
0003 stPinTaun=PwePinTaun(N,theta);
0004 
0005 % create, position, and resize figure for pi_n
0006 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0007 figAspectRatio=1;
0008 figHeight=scrsz(4)-150;
0009 figWidth=figAspectRatio*figHeight;
0010 figure('Name','PweScriptPlotPinTaun: pi_n(theta) and tau_n(theta)', ...
0011     'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0012 for n=1:N;
0013     % plot tau_n (assumed even of theta)
0014     hax=subplot(N,2,2*n-1);
0015     polar([-theta(end:-1:1);theta],[(stPinTaun.taun(end:-1:1,n));(stPinTaun.taun(:,n))]);
0016     set(hax,'Outerposition',[0,1-n/N,0.5,1.0/N]);
0017     title(['\tau_n, n=' int2str(n) ]);
0018     % plot pi_n (assumed even of theta)
0019     hax=subplot(N,2,2*n);
0020     polar([-theta(end:-1:1);theta],[(stPinTaun.pin(end:-1:1,n));(stPinTaun.pin(:,n))]);
0021     set(hax,'Outerposition',[0.5,1-n/N,0.5,1.0/N]);
0022     title(['\pi_n, n=' int2str(n) ]);
0023 end;
0024 % Note that to reproduce Bohren, we take pi_n and tau_n even of theta as
0025 % above
0026 % By defintion pi_n and tau_n should be odd of theta (although we only use
0027 % them for theta>0
0028 % Another vizualization is to plot the modulus of pi_n and tau_n as follows:
0029 % create, position, and resize figure for pi_n
0030 scrsz = get(0,'ScreenSize'); % scrsz(4) contains screen height
0031 figAspectRatio=1;
0032 figHeight=scrsz(4)-150;
0033 figWidth=figAspectRatio*figHeight;
0034 figure('Name','PweScriptPlotPinTaun: abs(pi_n(theta)) and abs(tau_n(theta))', ...
0035     'Position',[(scrsz(3)-figWidth)/2 50 figWidth figHeight]);
0036 for n=1:N;
0037     % plot abs(tau_n)
0038     hax=subplot(N,2,2*n-1);
0039     polar([-theta(end:-1:1);theta],[abs(stPinTaun.taun(end:-1:1,n));abs(stPinTaun.taun(:,n))]);
0040         set(hax,'Outerposition',[0,1-n/N,0.5,1.0/N]);
0041     title(['|\tau_n|, n=' int2str(n) ]);
0042     % plot abs(pi_n)
0043     hax=subplot(N,2,2*n);
0044     polar([-theta(end:-1:1);theta],[abs(stPinTaun.pin(end:-1:1,n));abs(stPinTaun.pin(:,n))]);
0045     set(hax,'Outerposition',[0.5,1-n/N,0.5,1.0/N]);
0046     title(['|\pi_n|, n=' int2str(n) ]);
0047 end;
0048

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)