高阶贝塞尔函数计算与大变量 [英] high order bessel function computation with large variables

查看:185
本文介绍了高阶贝塞尔函数计算与大变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作涉及大变量值的高阶贝塞尔函数的计算。在MATLAB中,这是没有问题。但是,为了扩大这个问题,我调整了用MPI编写C ++代码。当然,生成bessel函数的步骤是通过调用一些库来完成的。

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.

在matlab中,假设我想计算$ J_46341(86840.0)$和

In matlab, suppose I wish to compute $J_46341(86840.0)$, and


matlab给我:besselj(46341,86840)= 0.001309896212292

matlab gives me: besselj(46341,86840)=0.001309896212292

但是,一个简单的测试示例来调用

However, a simple test example to call


gsl_sf_bessel_Jn_e返回ERROR:NaN

gsl_sf_bessel_Jn_e returns "ERROR: NaN"

并且我已经在46340订单检查,matlab和gsl在可接受的准确度内返回相同的答案0.00292895。

and I have checked at order 46340, both matlab and gsl returns the same answer 0.00292895 within acceptable accuracies. One more step in GSL results in the NaN error while matlab still retains a good accurate numerical answer.

我试图使用递归关系生成更高的阶数值,从一个 - 不是那么小的订单,说从20000及以上的订单,然而,这只延迟NaN错误,而没有完全解决问题。

I did try to use recurrence relations to generate higher order values, from a-not-so-small-order, say from order of 20000 and up, however, this only delays the NaN error without completely solving the problem.

将我的注意力转移到其他可用的软件库,我试过NAG,但对我完全失望,

Switching my attention to other available software libraries out there, I tried NAG, but to my utter disappointment,

nag_bessel_j_alpha(s18ekc)的约束为abs(nl)<= 101

nag_bessel_j_alpha (s18ekc) has constraint of abs(nl)<=101

所以,我的问题很简单:

So, my question is fairly simple:


是否有更可靠的库方法来获取高阶贝塞尔
大x的函数值?

Is there a more reliable library approach to obtain high order bessel function value for large x?

渐近地,bessel函数接近0,如果尾部接近下溢限制,我可以确保将这些值设置为零。然而,NaN问题似乎发生在强烈振荡曲线和渐近衰减尾部之间。

Asymptotically, bessel function approaches 0, I can surely set those values to zero if the tail is approaching the underflow limit. However, the NaN problem seems to occur somewhat between strongly oscillating curve and asymptotically decaying tail.

推荐答案

问题解决。非常感谢你的社区工作,非常感谢你的知识和贡献!!!

Problem solved. Thank you for the community work and it really amazed me with your knowledge and contributions!!!

请看这里,
如何从C ++调用fortran例程?

http:// mathoverflow .net / questions / 225121 / calculate-of-high-order-bessel-function-at-large-variable-value

MATLAB,R,Python和JuliaLang / openspecfun都建立在Dr. Donald E. Amos(sandia国家实验室)原始Fortron源代码基础上,引用文章:

MATLAB, R, Python and JuliaLang/openspecfun all build upon the original fortran source code by Dr. Donald E. Amos (sandia national lab), cited paper:

D. E. Amos, "A subroutine package for Bessel functions of a complex
argument and nonnegative order", Sandia National Laboratory Report,
SAND85-1018, May, 1985.
D. E. Amos, "A portable package for Bessel functions of a complex
argument and nonnegative order", Trans. Math. Software, 1986.

现在称为ACM收集的Amos算法644。

Now known as Amos Algorithm 644 collected by ACM.

http://dl.acm.org/citation.cfm?id=212078
http://dl.acm.org/citation.cfm?id=1268783
http://dl.acm.org/citation.cfm?id=98299

但是,在netlib上托管的源代码不是没有bug的,可能不是最新的。

However, the source codes hosted on netlib are not bug free and probably not up-to-date,

http://netlib.sandia.gov/master/index.html
http://netlib.sandia.gov/amos/

openspecfun采用的版本是固定的,

While the version adopted by openspecfun works as solid,

https://github.com/JuliaLang/openspecfun

这篇关于高阶贝塞尔函数计算与大变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆