Home > atmlab > mie > besselplot1.m

besselplot1

PURPOSE ^

Computation and plot of Riccati-Bessel Functions of Order n

SYNOPSIS ^

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

DESCRIPTION ^

 Computation and plot of Riccati-Bessel Functions of Order n
 for complex argument z=m*x, used in Mie Theory. 
 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 ^

besselplot1.m

SOURCE CODE ^

0001 function result = besselplot1(n, m, xmin, dx, nx)
0002 
0003 % Computation and plot of Riccati-Bessel Functions of Order n
0004 % for complex argument z=m*x, used in Mie Theory.
0005 % input: order n, refractive index m, minimum x value xmin,
0006 % x interval dx, number of x values nx.
0007 % C. M�zler, August 2002
0008 
0009 m1=real(m); m2=imag(m);
0010 nn=(1:nx);
0011 x=xmin+dx*nn;
0012 nu=n+0.5;
0013 z=m.*x;
0014 sqx= sqrt(0.5*pi*z); 
0015 psx = besselj(nu, z).*sqx;
0016 chx = -bessely(nu, z).*sqx;
0017 dpic=psx-i*chx;
0018 r=[real(psx);-imag(psx);real(chx);imag(chx);real(dpic);imag(dpic)];
0019 if abs(m2)<0.1
0020     plot(x,r(1:4,:))
0021     legend('real(psi_n(mx))','-imag(psi_n(mx))','real(chi_n(mx))','imag(chi_n(mx))')
0022     title(sprintf('Riccati-Bessel Functions of Order n=%g, for m=%g+%gi',n,m1,m2))
0023     xlabel('x')
0024 else
0025     semilogy(x,r(1:6,:))
0026     legend('real(psi_n(mx))','-imag(psi_n(mx))','real(chi_n(mx))','imag(chi_n(mx))','real(dpic(mx))','imag(dpic(mx))')
0027     title(sprintf('Riccati-Bessel Functions of Order n=%g, for m=%g+%gi',n,m1,m2))
0028     xlabel('x')
0029 end;
0030 result=[x;r];

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