Home > atmlab > mie > besselplot4.m

besselplot4

PURPOSE ^

Computation and plot of difference of Logarithmic Derivatives

SYNOPSIS ^

function result = besselplot4(n, m, xmin, dx, nx)

DESCRIPTION ^

 Computation and plot of difference of Logarithmic Derivatives 
 of Riccati-Bessel Functions Psi_n of Order n for complex 
 argument z=m*x, computed in 2 different ways: dz is computed
 from the built-in Matlab Bessel Functions, and dn from the 
 recurrence relation (4.89) of BH.
 input: order n, refractive index m, minimum x value xmin, 
 x interval dx, number of x values nx.
 C. M�zler, August 2002

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

besselplot4.m

SOURCE CODE ^

0001 function result = besselplot4(n, m, xmin, dx, nx)
0002 
0003 % Computation and plot of difference of Logarithmic Derivatives
0004 % of Riccati-Bessel Functions Psi_n of Order n for complex
0005 % argument z=m*x, computed in 2 different ways: dz is computed
0006 % from the built-in Matlab Bessel Functions, and dn from the
0007 % recurrence relation (4.89) of BH.
0008 % input: order n, refractive index m, minimum x value xmin,
0009 % x interval dx, number of x values nx.
0010 % C. M�zler, August 2002
0011 
0012 xmax=xmin+dx*nx;
0013 m1=real(m);m2=imag(m);
0014 nn=(1:nx);
0015 x=xmin+dx*nn;
0016 nu=n+0.5;
0017 z=m.*x;
0018 zmax=m.*xmax;
0019 sqz= sqrt(0.5*pi*z); 
0020 pz = besselj(nu, z).*sqz;       % Psi_n Function
0021 p1z= besselj(nu-1, z).*sqz;     % Psi_n-1 Function
0022 dz=p1z./pz-n./z;                % D_n =Psi_n'/Psi_n Function
0023 
0024 nmx= round(max(2+xmax+4*xmax.^(1/3),abs(zmax))+16);
0025 dnx(1:nmx,nn)=0;
0026 dnx(nmx,nn)=0+0i;
0027 for j=nmx:-1:n+1      % Computation of Dn(z) according to (4.89) of B+H (1983)
0028     dnx(j-1,nn)=j./z-1./(dnx(j,nn)+j./z);
0029 end;
0030 dn=dnx(n,nn);
0031 
0032 dz1=real(dz-dn);
0033 dz2=imag(dz-dn);
0034 
0035 r=[dz1;dz2];
0036 
0037 plot(x,r(1:2,:))
0038 legend('real(deltad_n_p_s(mx))','imag(deltad_n_p_s(mx))')
0039 title(sprintf('Differences of Log. Derivatives n=%g, for m=%g+%gi',n,m1,m2))
0040 xlabel('x')
0041 % result=[dz1;dz2];
0042 result=[x;dn;log10(pz)];
0043

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005