HP Forums
(71B) Bessel function for the HP-71B - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (71B) Bessel function for the HP-71B (/thread-6706.html)



(71B) Bessel function for the HP-71B - Namir - 08-19-2016 02:42 PM

Here is a BASIC program that calculates the Bessel functions of the first kind for any integer order n and value x:

Code:
10 RECURSIVE BESSEL
20 DIM T(100)
30 INTEGER K, M, P
40 INPUT "ENTER X? ";X
50 INPUT "ENTER N? ";N
60 A= 7.34
70 IF N>X THEN Y=N ELSE Y=X
80 M=INT(1 + 3 * x ^ (1 / 12) + 9 * x ^ (1 / 3) + Y)
90 T(M+1)=0
100 T(M)=A
110 FOR K=M TO 1 STEP -1
120 T(K-1) = 2*K/X*T(K) - T(K+1)
130 NEXT K
140 P = INT(M/2)
150 S=0
160 FOR K=1 TO P
170 S = S + T(2*K)
180 NEXT K
190 S = T(0) + 2 * S
200 DISP "BESSEL = ";T(N)/S
210 END

The above code is based on the algorithm used in HP-65 Math Pac II to calculate the Bessel function Jn(x).