Symbolic differentiation of Bessel functions is incorrect

16 次查看(过去 30 天)
The output of the below code gives an incorrect equation for the derivative of the modified Bessel function of the second kind.
syms x n
y = besselk(n,x);
diff(y,x)
It says the derivative of is
but as I understand, the formula for the derivative of the K bessel functions is given by
.
What's going on?!?

采纳的回答

David Goodmanson
David Goodmanson 2021-3-11
编辑:David Goodmanson 2021-3-11
Hi Sam,
There is really nothing going on. Both of those identities are correct, as you can check numerically. There are several recurrence relations available for Bessel functions. Another one is
K'(n,x) = -nK(n,x)/x - K(n-1,x)

更多回答(1 个)

Selçuk Sehitoglu
Selçuk Sehitoglu 2022-5-15
Hello,
i am dealing with the same problem for besselj.
syms nu x
y=besselj(nu,x);
d_y=diff(y,x);
subs(d_y,x,0); % At this row i get "Division by zero." error, because derivative is defined as -nJ(n,x)/x - J(n-1,x) ans it is undefined at x=0.
However, the answer is available with the following expression:
-(J(n-1,x) - J(n+1,x))/2
Is there a way to use this expression?
Thanks in advance,
Ozi
  1 个评论
David Goodmanson
David Goodmanson 2022-5-16
Hi Ozi,
Yes there is. The expression works as is. It looks like n = 0 might be an exception because you will need J(-1,x) but for real n the besselj function works for negative n.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Bessel functions 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by