Bessel function of the first kind of integer order.

View versions (1)

Interface

#include <codecogs/maths/special/bessel/j/j.h>

using namespace Maths::Special::Bessel::J;

Overview

These function return solutions to the Bessel Function of the first kind. They are defined as solutions to the Bessel differential equation

$$x^2 \frac{d^2y}{dx^2} + x \frac{dy}{dx} + (x^2 - v^2)y = 0$$
(1)

which are both nonsingular at the origin. They are are sometimes called cylinder functions or cylindrical harmonics.

Bessel function of the first kind
Figure 1: Bessel function of the first kind

References

http://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html

GPL Licence — free for non commercial use. See Licence details.

FUNCTION

J

Returns Bessel function of the first kinds for any integer order (v)

The ratio of jn(x) to j0(x) is computed by backward recurrence. First the ratio jn/jn-1 is found by a continued fraction expansion. Then the recurrence relating successive orders is applied until j0 or j1 is reached.

If n = 0 or 1 the routine for j0 or j1 is called directly.

Accuracy:

<pre> Relative error: arithmetic domain # trials peak rms DEC 0, 30 5500 6.9e-17 9.3e-18 IEEE 0, 30 5000 4.4e-16 7.9e-17 </pre>

Example:

#include <stdio.h>
#include <codecogs/maths/special/bessel/j/j.h>
int main()
{
  printf("\n  x      v=0      v=1      v=2      v=3      v=4      v=5");
  for(double x=0; x<6; x++)
  {
    printf("\nx=%.1lf",x);
    for(int v=0;v<=5;v++)
      printf(" %8.6lf", Maths::Special::Bessel::J::J(x,v));
  }
  return 0;
}

Output:

x      v=0      v=1      v=2      v=3      v=4      v=5
x=0.0 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000
x=1.0 0.765198 0.440051 0.114903 0.019563 0.002477 0.000250
x=2.0 0.223891 0.576725 0.352834 0.128943 0.033996 0.007040
x=3.0 -0.260052 0.339059 0.486091 0.309063 0.132034 0.043028
x=4.0 -0.397150 -0.066043 0.364128 0.430171 0.281129 0.132087
x=5.0 -0.177597 -0.327579 0.046565 0.364831 0.391232 0.261141

See also J1 and J0

Not suitable for large n or x. Use J() with real v instead.

References

Cephes Math Library Release 2.8: June, 2000

Parameters

x
value to be transformed.
v
order of bessel function (integer).
Author

Stephen L. Moshier. Copyright 1984, 1987, 2000

Author

Documentation by Will Bateman

Interactive Calculator

x
v
Result –

FUNCTION

J

Returns the Bessel function of the first kinds for any order (v)

Several expansions are included: the ascending power series, the Hankel expansion, and two transitional expansions for large v. If v is not too large, it is reduced by recurrence to a region of best accuracy.

The transitional expansions give 12D accuracy for v > 500.

Accuracy:

Results for integer v are calculated with x varying from -125 to +125. Otherwise, x ranges from 0 to 125. Error criterion is absolute, except relative when |J()| > 1. <pre> arithmetic v domain x domain # trials peak rms IEEE 0,125 0,125 100000 4.6e-15 2.2e-16 IEEE -125,0 0,125 40000 5.4e-11 3.7e-13 IEEE 0,500 0,500 20000 4.4e-15 4.0e-16 Integer v: IEEE -125,125 -125,125 50000 3.5e-15 1.9e-16 </pre>

Example:

#include <stdio.h>
#include <codecogs/maths/special/bessel/j/j.h>

int main()
{
  printf("\n  x      v=0.5    v=1.5    v=2.5    v=3.5    v=4.5");
  for(double x=0; x<6; x++)
  {
    printf("\nx=%.1lf",x);
    for(double v=0.5;v<=5;v++)
      printf(" %8.6lf", Maths::Special::Bessel::J::J(x,v));
  }
  return 0;
}

Output:

x      v=0.5    v=1.5    v=2.5    v=3.5    v=4.5
x=0.0 0.000000 0.000000 0.000000 0.000000 0.000000
x=1.0 0.671397 0.240298 0.049497 0.007186 0.000807
x=2.0 0.513016 0.491294 0.223925 0.068518 0.015887
x=3.0 0.065008 0.477718 0.412710 0.210132 0.077598
x=4.0 -0.301921 0.185286 0.440885 0.365820 0.199300
x=5.0 -0.342168 -0.169651 0.240377 0.410029 0.333663

References

Cephes Math Library Release 2.8: June, 2000

Parameters

x
input argument.
v
order of bessel function.
Author

Stephen L. Moshier. Copyright 1984, 1987, 2000

Author

Documentation by Will Bateman

Interactive Calculator

x
v
Result –