Numeric integration on 34s Message #1 Posted by Gene Wright on 13 June 2011, 4:49 p.m.
Ok, so I started trying the examples from the IG routine in the PPC rom manual using the built-in integration function on the 34s.
Less than nice results. :-) Of course, this was expected.
So, I then decided...why not just adapt the PPC ROM IG routine and key it into the 34s.
Everything keyed properly with a couple of exceptions. The HP 41 puts numbers on one program line while the 34s puts each digit on a separate line. Not usually a problem even though not as readable as the HP 41 way.
However, it did cause a problem until I spotted it in the IG listing.
Lines 17 and 18 in IG are E and then 2, which enters a 1 and then a 2 into Y and X, respectively.
My first attempt was to key a 1 then ENTER and a 2 and go back and delete the ENTER. Oops. That made the 1 2 a 12. So, if you have things like 1 and 2 to be entered as two numbers, the ENTER is needed. No hidden "null" like on the HP 41 series.
That said, IG runs like a charm with one change (Ok, some other changes too like RCL L for LastX, but those are not real changes):
IG looked for alpha labels for the function to be integrated. I found that XEQ ind 10 with a 3 letter alpha label inside errored out...so I changed the program to simply XEQ 99 and used label 99 for the function.
It is very fast, but even the 34s is taking its time right now solving the integral from 0 to 1 of x^(-1/2). The "Answer" is 2. So far, after about 4-5 minutes, the 34s has 1.9999678... and it is still going. Of course, I put it in SCI 9, so I am being a real pain to the poor 34s.
The program IG on the 34s takes 93 program steps/lines. If you want to do numerical integration, that is probably worth it.
I plan to show the results from the IG program and the built-in integration command when I can.
Hey 34s team... those "internal" constants in the manual for the 34s integration... do they take up more/less space than a 93 step program? Or is it that the constants are not in a similar memory location than an IG program-like function would be?
Edited: 13 June 2011, 4:52 p.m.
|