Post Reply 
WP34s Integration and flashing RCL
09-23-2015, 11:40 PM (This post was last modified: 09-23-2015 11:45 PM by Lode.)
Post: #1
WP34s Integration and flashing RCL
Hello,

When integrating the function 1/ln(x), that is, ln followed by 1/x, from 2 to 5, it outputs 2.58942452991 while RCL (running program) is blinking. That number happens to be correct, but I guess it didn't realize it yet itself Smile

But RCL keeps blinking. So in an attempt to stop it from blinking, I press exit. But then, it stops with some random value, e.g. 0.67...

The beginners manual doesn't have a section about integration. And the 3.1 PDF manual has only one thing to say about integration: refer to the HP15C manual. The HP15C stops quickly with this integral though, the situation is not applicable.

Does anyone know what's happening here, and how to use its correct result?

Thanks Smile
Find all posts by this user
Quote this message in a reply
09-24-2015, 12:08 AM
Post: #2
RE: WP34s Integration and flashing RCL
Trying this on my WP 34S, the RCL annunciator stops flashing after approximately one minute.
Find all posts by this user
Quote this message in a reply
09-24-2015, 03:10 AM
Post: #3
RE: WP34s Integration and flashing RCL
The 34S is showing its best estimate for the integral as it goes. It is doing an extra iteration to see if this estimate changes or not which gives the flashing RCL. When you interrupt it, you stop the integration process and you'll get whatever is in the stack at the time.

- Pauli
Find all posts by this user
Quote this message in a reply
09-26-2015, 09:41 PM (This post was last modified: 09-26-2015 10:11 PM by Dieter.)
Post: #4
RE: WP34s Integration and flashing RCL
(09-23-2015 11:40 PM)Lode Wrote:  When integrating the function 1/ln(x), that is, ln followed by 1/x, from 2 to 5, it outputs 2.58942452991 while RCL (running program) is blinking. That number happens to be correct, but I guess it didn't realize it yet itself Smile

Your 34s realizes that 2.58942452991 is almost correct, so it adds one or two more iterations.

(09-23-2015 11:40 PM)Lode Wrote:  Does anyone know what's happening here, and how to use its correct result?

"Integrate" determines the integral in an iterative way. The current approximation after every iteration step is displayed, so you can see the result converge.
In ALL mode, this is what you'll see:

Code:
∫ ≈ 2.58808349458
∫ ≈ 2.59110867475
∫ ≈ 2.58939075912
∫ ≈ 2.58942437481
∫ ≈ 2.58942453193
∫ ≈ 2.58942452991
∫ ≈ 2.58942452992
∫ ≈ 2.58942452992  <= final result (actually 2.589424529915154)

At the beginning the displayed intermediate results will change quickly, but since the number of subintervals doubles (!) with every iteration step, the display is updated more and more slowly.

The iteration will stop as soon as the new approximation agrees with the previous one when rounded to display precision. Take a look at the values above: The next value after 2.58942452991 is 2.58942452992, so the iteration has not converged yet. The next iteration will require twice the time of the previous one, so be patient – the last step may take 15...20 seconds – and finally see 2.58942452992 again. Now the iteration terminates and RCL stops flashing.

All this will take some time since you told the 34s you want 12 correct digits, like they are displayed in ALL mode. Set it to FIX 4 and the iteration will stop after three seconds with the result ∫≈2.5894. At this point the last, fourth approximation agrees with the third one as they both round to 2.5894. Or if eight decimals are fine for you, simply set FIX 8 and get 2.58942453 in merely 10 seconds. Or set SCI 5 to get a result with six valid significant digits (2.58942 E+00).

Yes, the exit condition could be somewhat less strict, e.g. "exit as soon as the last two results do not differ by more than 1 or 2 ULP", but the 34s plays safe here and it prefers a correct result over a fast one. In fact the final result here has 15 correct digits. Or even 19 digits in double precision mode.

In this case, of course, you can be quite sure to see the correct result as soon as 2.58942452992 is displayed – here only the last digit changed by one unit. Just wait a few seconds to have it confirmed by the 34s after one more iteration.

Pauli: what about displaying the final result with "∫ =" instead of "∫ ≈" ? This way the user would not have to observe that small flashing RCL annunciator. Do you think this would be a good idea? Yes, of course I know that even the final result is just an approximation. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
09-26-2015, 11:45 PM
Post: #5
RE: WP34s Integration and flashing RCL
(09-26-2015 09:41 PM)Dieter Wrote:  Pauli: what about displaying the final result with "∫ =" instead of "∫ ≈" ? This way the user would not have to observe that small flashing RCL annunciator. Do you think this would be a good idea? Yes, of course I know that even the final result is just an approximation. ;-)

It would be possible, but this doesn't seem easily distinguishable to me.


Pauli
Find all posts by this user
Quote this message in a reply
09-27-2015, 09:50 AM
Post: #6
RE: WP34s Integration and flashing RCL
Does the wp34s use the same Romberg's method as the 15C? Even with the "warping" of the integration interval in order to enhance precision with periodic integrands?

Regards.
Find all posts by this user
Quote this message in a reply
09-27-2015, 11:59 AM
Post: #7
RE: WP34s Integration and flashing RCL
(09-27-2015 09:50 AM)emece67 Wrote:  Does the wp34s use the same Romberg's method as the 15C? Even with the "warping" of the integration interval in order to enhance precision with periodic integrands?

The 34s uses the classic Romberg method, while the 34C and 15C apply a few tweaks (e.g. irregularly spaced nodes) to prevent certain problems. You can inspect the code on sourgeforge.net and see what it does. It's an XROM routine, so it looks like a regular 34s user program.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)