Symbolic differentiation of Bessel functions is incorrect
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sam Spedding
am 11 Mär. 2021
Kommentiert: David Goodmanson
am 16 Mai 2022
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 Kommentare
Akzeptierte Antwort
David Goodmanson
am 11 Mär. 2021
Bearbeitet: David Goodmanson
am 11 Mär. 2021
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 Kommentare
Weitere Antworten (1)
Selçuk Sehitoglu
am 15 Mai 2022
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 Kommentar
David Goodmanson
am 16 Mai 2022
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.
Siehe auch
Kategorien
Mehr zu Bessel functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!