相关文章推荐
爱喝酒的葫芦  ·  Bessel Functions of ...·  4 月前    · 
爱喝酒的葫芦  ·  Bessel functions in ...·  4 月前    · 
爱喝酒的葫芦  ·  "Basics of ...·  4 月前    · 
爱喝酒的葫芦  ·  Python ...·  4 月前    · 
爱喝酒的葫芦  ·  Differentiate ...·  4 月前    · 

besselj

Bessel function of first kind

collapse all in page

Description

example

J = besselj( nu , Z ) computes the Bessel function of the first kind J ν ( z ) for each element in array Z .

example

J = besselj( nu , Z , scale ) specifies whether to exponentially scale the Bessel function of the first kind to avoid overflow or loss of accuracy. If scale is 1 , then the output of besselj is scaled by the factor exp(-abs(imag(Z))) .

Examples

collapse all

Define the domain.

z = 0:0.1:20;

Calculate the first five Bessel functions of the first kind. Each row of J contains the values of one order of the function evaluated at the points in z .

J = zeros(5,201);
for i = 0:4
    J(i+1,:) = besselj(i,z);
end

Plot all of the functions in the same figure.

plot(z,J)
grid on
legend('J_0','J_1','J_2','J_3','J_4','Location','Best')
title('Bessel Functions of the First Kind for $\nu \in [0, 4]$','interpreter','latex')
xlabel('z','interpreter','latex')
ylabel('$J_\nu(z)$','interpreter','latex')

Calculate the unscaled ( J ) and scaled ( Js ) Bessel function of the first kind J 2 ( z ) for complex values of z .

x = -10:0.3:10;
y = x';
z = x + 1i*y;
scale = 1;
J = besselj(2,z);
Js = besselj(2,z,scale);

Compare the plots of the imaginary part of the scaled and unscaled functions. For large values of abs(imag(z)) , the unscaled function quickly overflows the limits of double precision and stops being computable. The scaled function removes this dominant exponential behavior from the calculation, and thus has a larger range of computability compared to the unscaled function.

surf(x,y,imag(J))
title('Bessel Function of the First Kind','interpreter','latex')
xlabel('real(z)','interpreter','latex')
ylabel('imag(z)','interpreter','latex')

surf(x,y,imag(Js))
title('Scaled Bessel Function of the First Kind','interpreter','latex')
xlabel('real(z)','interpreter','latex')
ylabel('imag(z)','interpreter','latex')

Input Arguments

collapse all

Equation order, specified as a scalar, vector, matrix, or multidimensional array. nu is a real number that specifies the order of the Bessel function of the first kind . nu and Z must be the same size, or one of them can be scalar.

Example: besselj(3,0:5)

Data Types: single | double

Functional domain, specified as a scalar, vector, matrix, or multidimensional array. besselj is real-valued where Z is positive. nu and Z must be the same size, or one of them can be scalar.

Example: besselj(1,[1-1i 1+0i 1+1i])

Data Types: single | double
Complex Number Support: Yes

Toggle to scale function, specified as one of these values:

  • 0 (default) — No scaling

  • 1 — Scale the output of besselj by exp(-abs(imag(Z)))

On the complex plane, the magnitude of besselj grows rapidly as the value of abs(imag(Z)) increases, so exponentially scaling the output is useful for large values of abs(imag(Z)) where the results otherwise quickly lose accuracy or overflow the limits of double precision.

Example: besselj(3,0:5,1)

More About

collapse all

Bessel Functions

This differential equation, where ν is a real constant, is called Bessel's equation :

z 2 d 2 y d z 2 + z d y d z + ( z 2 ν 2 ) y = 0.

Its solutions are known as Bessel functions .

The Bessel functions of the first kind , denoted J ν ( z ) and J ν ( z ) , form a fundamental set of solutions of Bessel's equation for noninteger ν . J ν ( z ) is defined by

J ν ( z ) = ( z 2 ) ν ( k = 0 ) ( z 2 4 ) k k ! Γ ( ν + k + 1 ) .

The Bessel functions of the second kind , denoted Y ν ( z ) , form a second solution of Bessel's equation that is linearly independent of J ν ( z ) . Y ν ( z ) is defined by

Y ν ( z ) = J ν ( z ) cos ( ν π ) J ν ( z ) sin ( ν π ) .

You can calculate Bessel functions of the second kind using bessely .

Tips

The Bessel functions are related to the Hankel functions, also called Bessel functions of the third kind:

H ν ( 1 ) ( z ) = J ν ( z ) + i Y ν ( z ) H ν ( 2 ) ( z ) = J ν ( z ) i Y ν ( z ) .

H ν ( K ) ( z ) is besselh , J ν ( z ) is besselj , and Y ν ( z ) is bessely . The Hankel functions also form a fundamental set of solutions to Bessel's equation (see besselh ).

Extended Capabilities

Version History

Introduced before R2006a

Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :

Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.