1.4 The psi Function
7
with the value “value” (default) for the Pochhammer result, or “inz” for the first
input, or “inw” for the second input.
The class [obj,erg] = pochC(z,w) returns the Pochhammer value by
calling the class pochlnC and using the MATLAB exp-function. Arguments and
methods are equivalent to the description above for pochlnC.
Example
x = [-6.2:0.1000:5.25];
y = -5:0.1:5;
[X,Y] = meshgrid(x,y);
% complex plane
Z = X+i * Y;
w = 2 * rand;
objp = pochC(Z,w);
% Pochhammer value
% abs-method alternative
Zp = abs(objp,’value’);
% objp.abs(’value’)
Zp(Zp>35)=35;
% limit peaks
surf(X,Y,Zp)
1.4
The psi Function
The psi or digamma function is the logarithmic derivative of the gamma function.
ψ(z) =
d(lnΓ (z))
dz
=
1
Γ (z)
dΓ (z)
dz
.
(1.9)
The psi function holds the following recurrence equation:
ψ(z + 1) = ψ(z) +
1
z
,
(1.10)
and reflection formula
ψ(1 − z) = ψ(z) + π cot(πz).
(1.11)
The MATLAB-function psi is restricted to positive real arguments and the
SPECFUNPHYS-class psiC works also for complex arguments. obj=psiC(z)
is computed from the logarithmic derivative of the Γ Lanczos series, Eq. (1.7),
with the coefficients from [2]. For the left complex half plane Euler’s reflection
formula, Eq. (1.4), is used. The input “z” is an arbitrary complex array and “obj” an
object of the class psiC with the properties “value” (ψ-value) and “inz” (input
variable). Like gammalnC psiC supports the methods abs for computing the
absolute value, angle to compute the phase angle in radians, conj for complex
conjugation, and imag for computing the imaginary part and real for the real part
of the psiC object. All methods have two inputs. The first one is the object and the
7
with the value “value” (default) for the Pochhammer result, or “inz” for the first
input, or “inw” for the second input.
The class [obj,erg] = pochC(z,w) returns the Pochhammer value by
calling the class pochlnC and using the MATLAB exp-function. Arguments and
methods are equivalent to the description above for pochlnC.
Example
x = [-6.2:0.1000:5.25];
y = -5:0.1:5;
[X,Y] = meshgrid(x,y);
% complex plane
Z = X+i * Y;
w = 2 * rand;
objp = pochC(Z,w);
% Pochhammer value
% abs-method alternative
Zp = abs(objp,’value’);
% objp.abs(’value’)
Zp(Zp>35)=35;
% limit peaks
surf(X,Y,Zp)
1.4
The psi Function
The psi or digamma function is the logarithmic derivative of the gamma function.
ψ(z) =
d(lnΓ (z))
dz
=
1
Γ (z)
dΓ (z)
dz
.
(1.9)
The psi function holds the following recurrence equation:
ψ(z + 1) = ψ(z) +
1
z
,
(1.10)
and reflection formula
ψ(1 − z) = ψ(z) + π cot(πz).
(1.11)
The MATLAB-function psi is restricted to positive real arguments and the
SPECFUNPHYS-class psiC works also for complex arguments. obj=psiC(z)
is computed from the logarithmic derivative of the Γ Lanczos series, Eq. (1.7),
with the coefficients from [2]. For the left complex half plane Euler’s reflection
formula, Eq. (1.4), is used. The input “z” is an arbitrary complex array and “obj” an
object of the class psiC with the properties “value” (ψ-value) and “inz” (input
variable). Like gammalnC psiC supports the methods abs for computing the
absolute value, angle to compute the phase angle in radians, conj for complex
conjugation, and imag for computing the imaginary part and real for the real part
of the psiC object. All methods have two inputs. The first one is the object and the
