Script for symbolic expressions for the lowest orders pi_n and tau_n angular functions pi_n and tau_n are defined as in Bohren and Huffman (Ref. 146). See also the SPlaC supplementary information. This script requires the Matlab symbolic toolbox to run. This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 nNmax=8; 0002 syms t positive; % t for theta 0003 0004 % This code follows the method of PwePinTaun 0005 0006 mu=cos(t); 0007 nrows=1; % only one theta here 0008 % Initialize recurrence pi_0=0, pi_1=1 0009 % pinm1 contains pi_{n-1} n=1..nNmax+1 0010 pinm1=zeros(nrows,nNmax+1) * t; % for symbolic zeros 0011 pinm1(:,2)=zeros(nrows,1) * t +1; % for symbolic ones 0012 0013 % Get pi_2 to pi_nNmax by recurrence (see SPlaC guide) 0014 % pi_n is pinm1(:,n+1) 0015 for n=2:(nNmax) 0016 pinm1(:,n+1)=(2*n-1)/(n-1)*mu.*pinm1(:,n)-n/(n-1)*pinm1(:,n-1); 0017 end; 0018 0019 % return pi_n matrix (except n=0) 0020 pin=pinm1(:,2:(nNmax+1)); 0021 0022 % return tau_n matrix 0023 nmat=repmat(1:nNmax,nrows,1); 0024 mumat=repmat(mu,1,nNmax); 0025 taun=nmat.*mumat.*pin - (nmat+1).*pinm1(:,1:nNmax); 0026 0027 % Write output: 0028 disp(' ') 0029 for n=1:(nNmax) 0030 disp(['pi_' int2str(n) '(t)= ' char(factor(pin(1,n)))]) 0031 disp(['tau_' int2str(n) '(t)= ' char(factor(taun(1,n)))]) 0032 disp(' ') 0033 end;