HP Forums
Bessel Function by integrals - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP-41C Software Library (/forum-11.html)
+--- Thread: Bessel Function by integrals (/thread-20863.html)



Bessel Function by integrals - Namir - 11-19-2023 03:47 PM

Bessel Jn(x) for integer n order. The Advantage ROM is needed to use the INTEG routine.

The program uses:

Jn(x) = 1/pi * integral_of(cos(n*t - x*sin(t)) dt for t from 0 to pi.

Memory Map
==========
Code:
R00 = n
R01 = x

Program Listing
===============

Code:
01 LBL "BSLINT"
02 LBL A
03 RAD
04 "N?"
05 PROMPT
06 STO 00
07 "X?"
08 PROMPT
09 STO 01
10 "JN"
11 0
12 PI
13 INTEG
14 PI
15 /
16 RTN
17 LBL "JN"
18 RCL 00
19 X<>Y
20 *
21 LASTX
22 SIN
23 RCL 01
24 *
25 -
26 COS
27 RTN

Example
=======

To calculate J3(4):

1. Set display using FIX 7.
2. Press [A]. The program displays the prompt "N?".
3. Enter 3 and then press [R/S].
4. The program displays the prompt "X?".
5. Enter 4 and then press [R/S].
6. The program calculates the Bessel function and displays 0.4301715.