Root Finder (Root) - HP -20S Owner's Manual

Scientific calculator
Hide thumbs Also See for HP-20S:
Table of Contents

Advertisement

Root Finder (root)
This program finds a solution for f(x) = 0 using the secant method,
which is derived from Newton's method with a numerical approxima-
tion for the derivative f'(x). You must define the function f(x) by
entering the program lines to calculate f(x), assuming x is in the dis-
play. You must also supply an initial guess, x;, for the solution. The
closer the initial guess is to the actual solution, the faster the program
converges to an answer.
The main program is 62 lines long, and uses registers Rs through Rq
and labels A, F, 8, and 9. The remaining program lines, registers, and
labels can be used for defining f(x). You can replace the default values
of Ax limit (relative error), e (f(x) tolerance), and count (number ofit-
erations) with different values depending on the desired accuracy and
solution speed. Refer to the equations on page 91 to see how these
values are used.
Program Instructions:
1. Press () ([PRGM], then [H]
A tc load the program. Then
press (3] (o] once to move to the last line of the program.
2. After the LBL F on line 62 (62- 61 41 F), enter the keystrokes to
calculate the value of f(x) using a value of x in the display. See
the example below.
3. Press () [PRGM].
4. To calculate a root, enter your initial guess (x;) and press
A.
5. To enter a new function, repeat the instructions starting at
step 1.
6. Optional: To change ¢, change the default value of 102 at lines
51 through 53.
7. Optional: To change Ax limit, change the default value of 1010
at lines 39 through 42.
8. Optional: To change count, change the default value of 100 at
lines 09 through 10.
7: Built-in Program Library
89

Advertisement

Table of Contents
loading

Table of Contents