Question about how HP Math pacs calculate Bessel Functions!



#7

Hello All,

If you look in your HP-65 and HP-67 Math Pac manuals and the HP-41 High Level Math solution book, you may come across programs that calculate the Jn(x) and In(x) Bessel functions. These programs use recursive algorithms that calculate series of a specified number of terms m. The documentation calculates m using an interesting formula:

m = 2 * INT[(6 + max(n,z) + 9z/(z + 2))/2]

Where n is the order of the Bessel function and z = 3x/2.

My question, can anyone find the reference for HP's algorithms to calculate the Jn(x) and In(x) Bessel functions using the above equation?? The HP documentation mentions the "Handbook of Mathematical Functions" by Abramowitz et al. as a reference. I looked in that book and and the closest thing I found was at the bottom of page 385 (under the heading Numerical Methods). The handbook discusses informally the algorithm HP used but does not mention m and how it is calculated. Did I miss something? Or is the equation for m something HP came up with?

I guess you can say that this is a math challenge, with a new twist!

Namir


Edited: 3 Nov 2009, 4:20 p.m.


#8

I don´t know which edition of Abramowitz you have excess to. This source cites the 1972 edition which would fit the HP-67 timewise.

MathWorld

Abramowitz, M. and Stegun, I. A. (Eds.). "Spherical Bessel Functions." §10.1 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 437-442, 1972.


#9

I also have the blue-soft cover version. On page 385 (Bessel functions of integer orders) the book discusses in general terms basically the same algorithm that HP uses, except there is no mention for of m and the equation to calculate it. The discussion does mention the use of recursive iteration to calculate non-normalized Bessel function values, and then briefly hints at how to normalize them.

The HP documentation is much clearer. I was able to implement the algorithm in Excel VBA in two versions: using arrays and without arrays. Both yield accurate results.

Namir


#10

There's programs in the SandMath-5 module to calculate Jn, In, Kn, and Yn for both integer and non-integer indexes, and any real number. I used the usual approach given the relatively fast convergenge of the series.

Cheers,
ÁM

Edited: 4 Nov 2009, 3:35 a.m.


#11

Angel,

Your SandMath ROM looks VERY nice!!!

You calculate the Bessel functions Jn(x), In(x), Kn(x), and Yn(x) in your SandMath ROM. Do you base your calculations for ALL FOUR Bessel functions on an algorithm that is a similar one that HP uses? If yes, how do you calculate Kn(x) and Yn(x)? Sorry for being nosy.

Cheers,

Namir


Edited: 4 Nov 2009, 7:03 a.m.


#12

Hi Namir,

No complex stuff: it's basically just about summing terms until there's no significant contribution to the sum value. The process is sped-up by using a couple of MCODE functions involved in the function term calculation (like obviously GAMMA for non-integer orders, HARMN for the harmonic number, X=YR? for rounded comparisons, CHSYX, etc.), and a couple of re-arranging tricks of the series syntax to optimize the efficiency. It still takes its time, but this is a non-issue if you use V41's TURBO mode of course - it feels instantaneous response.

I considered an ALL-MCODE implementation but so far had no time to implemented, maybe some day...

I'm on the road for a couple of weeks but can send you more details when I'm back if you give me an email address to send it to.

Best,
ÁM.

Edited: 5 Nov 2009, 12:30 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help understanding math.... cyrille de Brébisson 9 3,946 12-13-2013, 02:23 AM
Last Post: Didier Lachieze
  HP Prime - CAS functions in Spreadsheet App CR Haeger 6 2,527 11-11-2013, 12:37 AM
Last Post: Michael de Estrada
  [41CL] New Extra Functions version Monte Dalrymple 0 1,131 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  HP Prime: in need of help with defining functions Alberto Candel 14 4,435 10-27-2013, 10:48 AM
Last Post: Alberto Candel
  HP Prime spreadsheet functions SanS 0 1,925 10-04-2013, 04:23 AM
Last Post: SanS
  Stats functions on the HP34S Nicholas van Stigt 5 2,070 09-24-2013, 02:45 AM
Last Post: Nick_S
  Trig Functions Howard Owen 11 3,647 09-16-2013, 02:53 PM
Last Post: Fred Lusk
  OT: a math competition site Pier Aiello 0 1,078 09-16-2013, 06:03 AM
Last Post: Pier Aiello
  50g piecewise functions Kurt Fankhauser 6 2,392 09-15-2013, 08:01 PM
Last Post: Kurt Fankhauser
  Computer-scientist functions on HP Prime? Michael O. Tjebben 12 3,758 08-22-2013, 06:59 PM
Last Post: plivesey

Forum Jump: