-1

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?

Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
  • 1
    Interesting question, maybe you can find an identity which relates Bessel J with a complex argument to other functions with real arguments. I haven't tried it, but it's something to look for. You might look at packages which implement Bessel functions for complex arguments and see how they do it -- whether they're applying identities, and, if so, which ones, or whether they are doing the whole computation over again. E.g. Sympy, Maxima, that kind of thing. – Robert Dodier May 12 '23 at 17:26

1 Answers1

0

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).

Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
  • Thank you for your answer .I had a mistake in my question ,I asked there is any function in matlab , but actually I am looking for a function in .net – Ehsan Akbar May 13 '23 at 09:26