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

PwePinTaun

PURPOSE ^

Computes angle functions pi_n(cos(theta)) and tau_n(cos(theta)) for n=1..nNmax

SYNOPSIS ^

function stPinTaun=PwePinTaun(nNmax, theta)

DESCRIPTION ^

 Computes angle functions pi_n(cos(theta)) and tau_n(cos(theta)) for n=1..nNmax

 Parameters:
 - nNmax: scalar integer [1 x 1]
 - theta: column vector [T x 1]
          with theta (in radians)
          all theta's must be between 0 and pi
 
 Returns: structure with fields:
 - pin: matrix [T x nNmax] with pi_n(cos(theta)) n=1..nNmax
 - taun: matrix [T x nNmax] with tau_n(cos(theta)) n=1..nNmax

 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 if size(theta,2)>1
0002     disp 'Warning: theta must be a column vector in PwePinTaun...';
0003 end
0004 if ~isempty(find(theta<0 , 1))
0005     disp 'Warning: theta must be >0 in PwePinTaun...';
0006 end
0007 
0008 nrows=length(theta);
0009 mu=cos(theta);
0010 % Initialize recurrence pi_0=0, pi_1=1
0011 % pinm1 contains pi_{n-1} n=1..nNmax+1
0012 pinm1=zeros(nrows,nNmax+1);
0013 pinm1(:,2)=ones(nrows,1);
0014 
0015 % Get pi_2 to pi_nNmax by recurrence (see SPlaC guide)
0016 % pi_n is pinm1(:,n+1)
0017 for n=2:(nNmax)
0018     pinm1(:,n+1)=(2*n-1)/(n-1)*mu.*pinm1(:,n)-n/(n-1)*pinm1(:,n-1);
0019 end;
0020 
0021 % return pi_n matrix (except n=0)
0022 stPinTaun.pin=pinm1(:,2:(nNmax+1));
0023 
0024 % return tau_n matrix
0025 nmat=repmat(1:nNmax,nrows,1);
0026 mumat=repmat(mu,1,nNmax);
0027 stPinTaun.taun=nmat.*mumat.*(stPinTaun.pin) - (nmat+1).*pinm1(:,1:nNmax);
0028

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)