beautypg.com

Obtaining the current approximation to an integral – HP 15c User Manual

Page 257

background image

Appendix E: A Detailed Look at

f

257

Obtaining the Current Approximation
to an Integral

When the calculation of an integral is requiring more time than you care to
wait, you may want to stop and display the current approximation. You can
obtain the current approximation, but not its uncertainty.

Pressing ¦ while the HP-15C is calculating an integral halts the
calculation, just as it halts the execution of a running program. When you
do so, the calculator stops at the current program line in the subroutine you
wrote for evaluating the function, and displays the result of executing the
preceding program line. Note that after you halt the calculation, the current
approximation to the integral is not the number in the X-register nor the
number in any other stack register. Just as with any program, pressing
¦ again starts the calculation from the program line at which it was
stopped.

The f algorithm updates the current approximation and stores it in the
LAST X register after evaluating the function at each new sample point. To
obtain the current approximation, therefore, simply halt the calculator,
single-step if necessary through your function subroutine until the calculator
has finished evaluating the function and updating the current
approximation. Then recall the contents of the LAST X register, which are
updated when the n instruction in the function subroutine is executed.

While the calculator is updating the current approximation, the display is
blank and does not show running. (While the calculator is executing your
function subroutine, running is displayed.) Therefore, you might avoid
having to single-step through your subroutine by halting the calculator at a
moment when the display is blank.

In summary, to obtain the current approximation to an integral, follow the
steps below.

1. Press ¦ to halt the calculator, preferably while the display is

blank.

2. When the calculator halts, switch to Program mode to check the

current program line.

If that line contains the subroutine label, return to Run
mode and view the LAST X register (step 3).