bessel-functions

Plotting and finding roots of bessel functions

前提是你 提交于 2020-01-16 04:15:06
问题 I am trying to plot roots of a function that is composed of multiple bessel functions being added and multiplied in Matlab. The equation is Jm(omega)*Ik(omega)+Im(omega)*Jk(omega) where Jm is the bessel function of the first kind of order m (besselj). Im is the modified bessel function of the first kind of order m (besseli). For each mode m=o,1,2,...and n=1,2,3... The frequency omega(mn) is the corresponding root of the listed equation. m=0,1,2 n-1,2,3,4. I need to solve the equation for the

Why won't boost's bessel function compile with a complex input?

自作多情 提交于 2019-12-12 21:13:57
问题 According to the boost documentation, the boost special functions bessel function (specifically the modified bessel function) should be able to accept a complex input. However, when I attempt to feed it one, I get a compile error complaining that there is no < operator for operand types float and std::complex<float> . Here is my code: using namespace boost::math; std::complex<float> cpxTerm = std::complex<float>(m_u1 * cos(az), -wbar * cos(sin(lim))); std::complex<float> besselTerm = cyl

high order bessel function computation with large variables

若如初见. 提交于 2019-12-08 19:41:29
My work involves computation of high order bessel function at large variable value. Within MATLAB, this has been done without problems. However, in order to scale up the problem, I have tuned to writing C++ code with MPI. Of course, the step to generate bessel function is done by invoking some libraries. To put the problem concrete, let me consider this very specific bug. In matlab, suppose I wish to compute $J_46341(86840.0)$, and matlab gives me: besselj(46341,86840)=0.001309896212292 However, a simple test example to call gsl_sf_bessel_Jn_e returns "ERROR: NaN" and I have checked at order

high order bessel function computation with large variables

末鹿安然 提交于 2019-12-08 07:06:58
问题 My work involves computation of high order bessel function at large variable value. Within MATLAB, this has been done without problems. However, in order to scale up the problem, I have tuned to writing C++ code with MPI. Of course, the step to generate bessel function is done by invoking some libraries. To put the problem concrete, let me consider this very specific bug. In matlab, suppose I wish to compute $J_46341(86840.0)$, and matlab gives me: besselj(46341,86840)=0.001309896212292

Density plot with python making a Diffraction pattern with Bessel Integrals but it wont stop running

别说谁变了你拦得住时间么 提交于 2019-12-08 01:01:56
问题 I am trying to make a circular diffraction pattern, which has a central spot surrounded by a series of rings. It involves a Bessel integral to do it which is defined in the code. My problems is that it takes too long like I waited 10 min for the code to run but didn't get anything to display. I understand it is because my Bessel integral has 1000 iterations per point can any one help with this ? Am I on the right track? I am trying to self teach myself python and computational physics via

Density plot with python making a Diffraction pattern with Bessel Integrals but it wont stop running

筅森魡賤 提交于 2019-12-06 11:21:31
I am trying to make a circular diffraction pattern, which has a central spot surrounded by a series of rings. It involves a Bessel integral to do it which is defined in the code. My problems is that it takes too long like I waited 10 min for the code to run but didn't get anything to display. I understand it is because my Bessel integral has 1000 iterations per point can any one help with this ? Am I on the right track? I am trying to self teach myself python and computational physics via Mark Newmans book Computational Physics the exercise is 5.4 of Computational Physics.Here is a link to the

What is the exact equivalent of “Matlab besselk(x,y,1)” in c++?

依然范特西╮ 提交于 2019-12-06 09:49:14
问题 I have tried boost::math::cyl_bessel_k(x,y) * exp(y) . In most cases, this is equal to Matlab's scaled besselk(x,y,1) . But in some cases (e.g., x=1 , y=2000 ) when both besselk(x,y)=0 and boost::math::cyl_bessel_k(x,y)=0 , Matlab's scaled version besselk(x,y,1) gives me different values varies around 10^-3 . But boost::math::cyl_bessel_k(x,y) * exp(y) returns -nan . I'd like to find an equivalent statement for Matlab's besselk(x,y,1) . How can I handle this? 回答1: I'm not seeing anything in

What is the exact equivalent of “Matlab besselk(x,y,1)” in c++?

走远了吗. 提交于 2019-12-04 18:06:23
I have tried boost::math::cyl_bessel_k(x,y) * exp(y) . In most cases, this is equal to Matlab's scaled besselk(x,y,1) . But in some cases (e.g., x=1 , y=2000 ) when both besselk(x,y)=0 and boost::math::cyl_bessel_k(x,y)=0 , Matlab's scaled version besselk(x,y,1) gives me different values varies around 10^-3 . But boost::math::cyl_bessel_k(x,y) * exp(y) returns -nan . I'd like to find an equivalent statement for Matlab's besselk(x,y,1) . How can I handle this? I'm not seeing anything in Boost that does what you need (though you might be able to implement it yourself by using lower-level