HP Forums
Bessel Function of the First Kind - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: Bessel Function of the First Kind (/thread-6033.html)



Bessel Function of the First Kind - Eddie W. Shore - 04-13-2016 01:13 PM

Blog post: http://edspi31415.blogspot.com/2016/04/hp-prime-casio-classpad-bessell.html

HP Prime Program BESS1:

Code:
EXPORT BESS1(n,t)
BEGIN
// Bessel 1st Kind
LOCAL b;
// Integrate
b:=(1/π)*CAS.int(COS(n*X-t*SIN(X)),X,0,π);
// Approximate
b:=approx(b);
RETURN b;

END;

bess1(1,2) ≈ 0.576724807756
bess1(0,6.3) ≈ 0.223812006132
bess1(2,4) ≈ 0.364128145852


RE: Bessel Function of the First Kind - roadrunner - 04-17-2016 04:30 PM

Nice program!

Here's a modification that's good for non integer values of order as well:

Code:

#cas
J_n(n,x):=
BEGIN
 LOCAL b, t;
 b:=(1/π)*int(cos(n*t-x*sin(t)),t,0,π);
 IF TYPE(n)≠1 THEN
  b:=b-(sin(n*π)/π)*int(e^(-x*sinh(t)-n*t),t,0,∞);
 END;
 RETURN approx(b);
END;
#end

And a cool chart for n= -1, -0.5, 0, 0.5, and 1 that only took a few minutes to draw on the prime:

[attachment=3396]

-road


RE: Bessel Function of the First Kind - salvomic - 10-30-2017 09:57 PM

Thank you both of you!

There is some simple way to get also the 2nd kind Bessel function?

Salvo