-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return sequences of Bessel functions for many orders #52
Comments
I also seem to remember that one direction of recursion is numerical unstable for Bessels and the other for Neumanns/Hankels. You probably have much deeper insight in this than me but I thought I'd mention it for completeness... |
Yes thank you! It should be noted that since the regular Bessel functions are oscillatory there are some regions where they are stable in both directions. For instance We use this a lot already for particularly difficult regions ( Lines 126 to 138 in 372120a
complex(besselj, bessely) needs some additional care. It's a hard function to just arbitrarily use recurrence. The continued fraction approach will be useful here.
|
See similar issue at JuliaMath/SpecialFunctions.jl#26.
This is a feature request from discourse. Essentially it would be nice to take arguments like
besselj(nu:Vector, x::T)
that returns a sequence of Bessel functions with step size equal to 1. Essentially a fast way to generate besselj(n, x) for n = 0, 1, 2, 3, ....I'd probably pose we have two options a non allocating version where the user can preallocate the memory like
besselj!(out, nu, x)
and then one that allocates forbesselj(nu, x)
ifnu
is someAbstractVector
.Of course these are all filled by recurrence relations. Downward recurrence for
besselj
andbesseli
and upward recurrence usingbessely
andbesselk
.There's a couple things to make sure we get right...
nu[end]
) be zero if nu >> x. Not sure we want to just compute until there is a finite value as we move down the vector as that is inefficient...nu=-10:10
shouldn't be allowed as it will not be numerically stable crossing zero.length(nu) >> 1
the computation time of a two bessel calls will be a fraction of total runtime....Just some quick thoughts on things to be careful about. The code is already here though just need to figure out finer details.
The text was updated successfully, but these errors were encountered: