▼
Posts: 37
Threads: 6
Joined: Apr 2011
this is quite embarrassing: while i was able to calculate mr barbosa's integral on my hp 15, 42 and 71, i completely failed when i tried it on the 41 (with math pac). i get an error due to a division by zero. the 41 seems to handle the stack's content differently than the hp 15 when calculating integrals.
i would be very happy about some help!
thank you very much,
hans
▼
Posts: 591
Threads: 16
Joined: Feb 2012
Hi.
Would you, please, let us know what is the expression/equation you want to integrate and how did you program it in your HP41, I mean, the program listing for the expression/equation?
(after editing) And also the upper and lower integration limits.
Cheers.
Luiz (Brazil)
Edited: 15 May 2012, 2:34 p.m.
▼
Posts: 37
Threads: 6
Joined: Apr 2011
hi luiz,
please follow the link in my first post to mr barbosa's integral.
what i did on my hp 15c:
lbl a
enter
pi
x
cos
x^2
acos
x<>y
pi
x
sin
3
x
/
2
1/x
+
rtn
then calculated the integral between 0 and 1. works perfectly.
the same program on the 41cx with math pac does not work. it prompts a data error because the hp 41 seems to handle the stack content differently. although the "enter" at the beginning duplicates x to the x and the y register, the x register is empty (=0) after the x<>x and therefore i get the data error.
maybe you should also know that i was always last in math...
regards,
hans
Edited: 15 May 2012, 3:12 p.m.
▼
Posts: 591
Threads: 16
Joined: Feb 2012
Hallo, Hans.
Allow me to add a few remarks.
You are correct, after pressing ENTER you duplicate the Xregister contents into Yregister. But as you have the PI entered in the stack right after ENTER  so stack lift is disabled  then you will still have a single copy of the Xregister contents into the Yregister. So, when × (multiplication) after PI is performed, the Yregister contents return to its original value.
In fact this is irrelevant for the HP15C's integral computation because the integral function itself fills the stack registers with the same value, teh one your custom function will be evaluated for, before calling it, so you do not need to worry about stack contents. IIRC, the HP41 Math Pac integral program does the same, i.e., the stack is filled with the number to evaluate, that's why the integral program works fine. If you want to evaluate the program for a single value, you simply fill the stack registers with and run it.
The major difference between the HP15C (and the other Voyagers) in relation to the HP41 is that numbers keyed in as program lines do not terminate digit entry. If you need further explanation about this let me know, it is not relevant related to this subject.
Cheers.
Luiz (Brasilien)
Edited: 15 May 2012, 3:38 p.m.
Posts: 591
Threads: 16
Joined: Feb 2012
Hallo, Hans;
I read my follow up right now and I missed one part I'd have to add (I forgot, sorry).
If you add another ENTER after the one you already have in your listing, the program will work fine with one single value to be evaluated in the Xregister.
Cheers.
Posts: 2,761
Threads: 100
Joined: Jul 2005
Hans,
I think the Math Pack is the worst option in this case, since its numerical integrator is based on the Simpson's Method, which is not the most efficient one, as we you know. The numerical integrator program on the Advantage Pack uses the same method used by the HP15C, so the program need not be changed. Also, the results should be the same. Anyway, if you don't have the Advantage Pack you can try Les Wright's program:
01 LBL'SS
02 PI
03 *
04 ENTER
05 COS
06 STO* X
07 ACOS
08 SWAP
09 SIN
10 3
11 *
12 /
13 .5
14 +
.END.
XEQ ALPHA INTG ALPHA
EEX CHS 10 ENTER CHS 1 + shift A
50 shift B
SS R/S > 0.9892701033
If you choose 1000 subintervals instead of 50 the result will be
0.9952412223
But you won't try this on a real HP41.
Regards,
Gerson.
▼
Posts: 980
Threads: 239
Joined: Aug 2006
Is Les Wright's program an integration method or just the integrand? If he has written an integration program where might I find it?
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
Try the articles section of this site.
Or the original source, the PPC ROM manual.
 Pauli
Posts: 1,368
Threads: 212
Joined: Dec 2006
That's just my approach to the integrand. I use a port of the PPC ROM routine IG on the 34S as one of my integration options. It handles Gerson's integral well enough. However, in experimenting with EMU41, the original PPC ROM IG routine doesn't like Gerson's integral much at all. In watching the interim results, I get a pretty good 5 or 6 digit result in SCI 9, but in subsequent extrapolations (each of which takes twice as long since twice as many points as the last cycle are sampled) things diverge and the results worsen. It's as though the 10digit environment just encourages accumulated roundoff error that works against convergence. Since IG needs two rounded extrapolations that agree in all desired digits, the routine never terminates.
I haven't dug out the HP15CLE or 35S or 34C or Advantage Pac to test things out, so I don't know how they fare. I suspect the Advantage Pac will do better, since it is in MCODE and carries more digits internally.
Les
▼
Posts: 1,253
Threads: 117
Joined: Nov 2005
Yes the MCODE version in the Advantage uses 13digit math routines so it has better accuracy/precision. It's also relatively slow  unless running on the CL or TURBoed emulator, and basically yields the same results posted in the other posts.
There are two other modules available for the 41 dealing with Integration:
 The SOLINTG module, a 4k extract from the Advantage containing just SOLVE and INTEG, plus associates.
 The INTEGRATOR module, an 8kworth of dedicated collection of programs from JM Baillard, featuring different algorithms/methods, simple, double, triple integrals, and much more. A must if you're interested in the subject.
Best,
'AM
Edited: 16 May 2012, 1:53 a.m.
▼
Posts: 1,368
Threads: 212
Joined: Dec 2006
Ángel, I am awaiting a replacement NoV64 from Diego (the first one came with a wonky programmer and wouldn't erase), and when I get it I will be sure to check out the ROMs you mention. I believe they are at TOS? Before then, if I get time, I should check them out in EMU41 or V41.
Les
Posts: 37
Threads: 6
Joined: Apr 2011
thank you all very much for your replies! that was most helpful and instructive! seems like i should get an advantage pac...
best regards,
hans
