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?!?
댓글 수: 0
채택된 답변
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)
댓글 수: 0
추가 답변 (1개)
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
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 Center 및 File Exchange에서 Bessel functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!