BesselJ in .net accord can't accept complex number

50 views Asked by At

I want to pass complex number to bassel function in .net as you can see :

 Complex[,] F_k = new Complex[M, N];
 F_k[m,n] = ((2 * Bessel.J(1, new Complex(1, -1) * (2 * 0.0110/ 122))));

but I get this error :

Error CS1503 Argument 2: cannot convert from 'System.Numerics.Complex' to 'double'

Is any Bessel function in .NET which can accept complex types?

1

There are 1 answers

1
Stéphane Laurent On

Since you mention Matlab, here is a way.

The Bessel J function can be expressed in terms of the 0F1 generalized hypergeometric function:

enter image description here

Here is a demonstration with R:

library(Bessel)
library(hypergeo)

z <- 1 + 1i
alpha <- 2

BesselJ(z, nu = alpha)
# 0.0415799+0.2473976i
(z/2)^alpha / gamma(alpha+1) * genhypergeo(NULL, alpha + 1, -z^2/4)
# 0.0415799+0.2473976i

The generalized hypergeometric functions are available for Matlab.

I don't speak Matlab, but I think 0F1(beta, y) should be hypergeom([], beta, y).