Home > SPlaC v1_0 > Mie > SYM > SymScriptSphBessel.m

SymScriptSphBessel

PURPOSE ^

Script for symbolic expressions for the lowest orders spherical Bessel functions and their Taylor expansions for small argument

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 Script for symbolic expressions for the lowest orders spherical Bessel functions and their Taylor expansions for small argument
 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

EXAMPLE OF OUTPUT ^

Example figure output

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 nNmax=3;
0002 nTaylor=9;
0003 syms x positive; % use x real positive for better simplification
0004 
0005 nm1=0:nNmax;
0006 nu=nm1+0.5;
0007 
0008 fjnm1=besselj(nu,x);
0009 fh1nm1=fjnm1+i*bessely(nu,x);
0010 
0011 sq=sqrt((pi/2)./x); % [R x 1]
0012 sqmat=repmat(sq,1,nNmax+1); % [R x nNmax+1]
0013 fjnm1=fjnm1.*sqmat;
0014 fh1nm1=fh1nm1.*sqmat;
0015 % fjnm1 and fh1nm1  are now matrix of spherical Bessel
0016 % j_n(rho), n=0..nNmax or equivalently j_{n-1}(rho), n=1..nNmax+1
0017 
0018 % Write output:
0019 disp('Functions:')
0020 disp(' ')
0021 for n=1:(nNmax+1)
0022     disp(['j_' int2str(n-1) '(x)= ' char(simplify(fjnm1(n)))])
0023     disp(['h1_' int2str(n-1) '(x)= exp(i*x)* [' char(simple(factor(fh1nm1(n))/(cos(x)+i*sin(x)))) ']'])
0024     disp(' ')
0025 end;
0026 
0027 % Write output:
0028 disp('Taylor expansions around x=0:')
0029 disp(' ')
0030 n=1;
0031 for n=1:(nNmax+1)
0032     disp(['j_' int2str(n-1) '(x)= x^' int2str(n-1) '* [' ...
0033         char(taylor(simplify(fjnm1(n))/x^(n-1),nTaylor+2*n)) ']'])
0034     disp(['h1_' int2str(n-1) '(x)= 1/x^' int2str(n) '* [' ...
0035         char(taylor(simplify(factor(fh1nm1(n))*(x^n)),nTaylor,x)) ']'])
0036     disp(' ')
0037 end;
0038

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)