Bessel function of first kind
J = besselj(nu,Z)
J = besselj(nu,Z,1)
J = besselj(nu,Z) computes
the Bessel function of the first kind, Jν(z),
for each element of the array
Z. The order
not be an integer, but must be real. The argument
be complex. The result is real where
Z is positive.
Z are arrays
of the same size, the result is also that size. If either input is
a scalar, it is expanded to the other input's size.
J = besselj(nu,Z,1) computes
Create a column vector of domain values.
z = (0:0.2:1)';
Calculate the function values using
nu = 1.
ans = 0 0.0995 0.1960 0.2867 0.3688 0.4401
Define the domain.
X = 0:0.1:20;
Calculate the first five Bessel functions of the first kind.
J = zeros(5,201); for i = 0:4 J(i+1,:) = besselj(i,X); end
Plot the results.
plot(X,J,'LineWidth',1.5) axis([0 20 -.5 1]) grid on legend('J_0','J_1','J_2','J_3','J_4','Location','Best') title('Bessel Functions of the First Kind for v = 0,1,2,3,4') xlabel('X') ylabel('J_v(X)')
The differential equation
where ν is a real constant, is called Bessel's equation, and its solutions are known as Bessel functions.
Jν(z) and J–ν(z) form a fundamental set of solutions of Bessel's equation for noninteger ν. Jν(z) is defined by
where Γ(a) is the gamma function.
a second solution of Bessel's equation that is linearly independent
It can be computed using
The Bessel functions are related to the Hankel functions, also called Bessel functions of the third kind, by the formula
besselh, Jν(z) is
and Yν(z) is
The Hankel functions also form a fundamental set of solutions to Bessel's
This function fully supports tall arrays. For more information, see Tall Arrays.
Usage notes and limitations:
If the order
nu is less than
then it must be an integer.
Always returns a complex result.