7.3 Program Details and Applications
109
7.3.2 The SPECFUNPHYS Class coulombscatt
The values of the Coulomb wave function, Eqs. (7.16), (7.17a), and (7.17b),
can be computed via obj = coulombscatt(gamma,k,r,z,ip). The input
arguments are “gamma” (see above), and the second one is the wave number “k.” In
case “k” is a vector with three components, the computation is based on kr −kr, and
thus, “r” has to be a 3×n array and no z-coordinate is needed. If “k” is a scalar input,
“r” and “z” represent the radial and z-coordinates. Either they are of the same size
(arbitrary arrays) or one is a scalar. The input argument “ip” is optional with value
“plot” or “p” and reduces the accuracy of z − r to 12 digits. The output argument is
the object of the class with properties “psi,” Eq. (7.16), “psik,” Eq. (7.17a), the input
parameters “gamma,” and “z,” the radial coordinate “R,” “z” with either the input
values z or k · r/|k|, and “info” with general information about the computation.
Examples
r = 20;
z = linspace(-20,20,250);
k = 2;
gamma = 1;
obj = coulombscatt(gamma,k,r,z);
%
plot(z,abs(obj.psik)), shg
Coulomb scattering is uncovered in Fig. 7.1. This figure was plotted via
Coulscatt_example.m:
% coordinates
np = 100;
% resolution
z = linspace(-20,40,np);
% coordinates
x = linspace(-40,40,np);
% y=0
k=2;
% wave number
gamma = 1;
[X,Z] = meshgrid(x,z);
R = sqrt(X.^2 + Z.^2);
%
wave function:
obj = coulombscatt(gamma,k,R,Z,’p’); % evaluation
%
surf(X,Z,real(obj.psik))
% visualization
view(90,90), shading flat
ylabel(’z’), shg
Figure 7.3 visualizes the Coulomb function by color coding ψ k (r, z), Eq. (7.17a),
on a sphere of radius 100. The script used (CoulscattSphere_example.m)
reads
% visualization: Coulomb wave function on sphere
[X,Y,Z] = sphere(100);
% unit sphere coordinates
X=100 * X;
% radius 100
109
7.3.2 The SPECFUNPHYS Class coulombscatt
The values of the Coulomb wave function, Eqs. (7.16), (7.17a), and (7.17b),
can be computed via obj = coulombscatt(gamma,k,r,z,ip). The input
arguments are “gamma” (see above), and the second one is the wave number “k.” In
case “k” is a vector with three components, the computation is based on kr −kr, and
thus, “r” has to be a 3×n array and no z-coordinate is needed. If “k” is a scalar input,
“r” and “z” represent the radial and z-coordinates. Either they are of the same size
(arbitrary arrays) or one is a scalar. The input argument “ip” is optional with value
“plot” or “p” and reduces the accuracy of z − r to 12 digits. The output argument is
the object of the class with properties “psi,” Eq. (7.16), “psik,” Eq. (7.17a), the input
parameters “gamma,” and “z,” the radial coordinate “R,” “z” with either the input
values z or k · r/|k|, and “info” with general information about the computation.
Examples
r = 20;
z = linspace(-20,20,250);
k = 2;
gamma = 1;
obj = coulombscatt(gamma,k,r,z);
%
plot(z,abs(obj.psik)), shg
Coulomb scattering is uncovered in Fig. 7.1. This figure was plotted via
Coulscatt_example.m:
% coordinates
np = 100;
% resolution
z = linspace(-20,40,np);
% coordinates
x = linspace(-40,40,np);
% y=0
k=2;
% wave number
gamma = 1;
[X,Z] = meshgrid(x,z);
R = sqrt(X.^2 + Z.^2);
%
wave function:
obj = coulombscatt(gamma,k,R,Z,’p’); % evaluation
%
surf(X,Z,real(obj.psik))
% visualization
view(90,90), shading flat
ylabel(’z’), shg
Figure 7.3 visualizes the Coulomb function by color coding ψ k (r, z), Eq. (7.17a),
on a sphere of radius 100. The script used (CoulscattSphere_example.m)
reads
% visualization: Coulomb wave function on sphere
[X,Y,Z] = sphere(100);
% unit sphere coordinates
X=100 * X;
% radius 100
