Symbolic differentiation of Bessel functions is incorrect
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sam Spedding
el 11 de Mzo. de 2021
Comentada: David Goodmanson
el 16 de Mayo de 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 comentarios
Respuesta aceptada
David Goodmanson
el 11 de Mzo. de 2021
Editada: David Goodmanson
el 11 de Mzo. de 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 comentarios
Más respuestas (1)
Selçuk Sehitoglu
el 15 de Mayo de 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 comentario
David Goodmanson
el 16 de Mayo de 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.
Ver también
Categorías
Más información sobre Bessel functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!