Root Finding (Solver) - HP 15C Quick Reference Manual

Scientific calculator
Hide thumbs Also See for 15C:
Table of Contents

Advertisement

X=0
Always returns false if X contains a matrix descriptor
TEST 0 (X≠0)
Always returns true if X contains a matrix descriptor
TEST 5 (X=Y)
Returns true if X and Y contain the same matrix descriptor. This does
not compare any matrix elements!
TEST 6 (X≠Y)
Returns true if X and Y contain a different matrix descriptor or if X or Y
doesn't contain a matrix at all
Last X
Operations which affect the RESULT matrix or produce a scalar in X also
affect Last X in the usual way
Maxtrix operations in a program
USER mode
When USER mode is on STO & RCL operations on matrix elements
increment the R1/R0 register (see above).
When such an instruction is entered in a program a "u" replaces the
dash after the program line number to indicate that the command will
increment R1/R0.
If in programmed USER STO & USER RCL mode the R1/R0 registers
wrap around to (1,1) the next program line is skipped. This can be
helpful when accessing all matrix elements without explicit knowledge of
the matrix dimensions
MATRIX 7
Row norm & Frobenius norm. Puts original X into Last X. Then if X is a
MATRIX 8
matrix the norm is calculated and placed in X and the next program line
is executed. If X is a scalar it remains unchanged and the next program
line is skipped. This can be used to test whether X contains a matrix or
a scalar
Memory
The solver needs 5 registers. These are allocated from the uncommitted
registers space, see MEM. The solver and the numerical integrator (see
below) share their registers
SOLVE 0-9,
Finds real root of a function. This is a value X where the function f(X)
.0-.9, A-E
evaluates to 0.
Complex mode
SOLVE ignores the complex stack and can only calculate real roots

Root Finding (Solver)

SOLVE expects two initial guesses for X in X and Y. These values can
be used to narrow down the serach for a root in case f(x) has
multiple roots. X=Y is permissable
It then makes repeated GSB calls to the label with the current X
value being present in the stack's X, Y, Z and T register
The program at the label must calculate the function f(X) and return
the result in X before it executes the RTN
When SOLVE finally ends the stack will contain the following values:
X: Value for which f(X)=0, this is the "root"
Y: X value of the 2
nd
Z: f(X) at the root value – should be 0!
If no root can be found Error 8 occurs (in RUN mode)
Note that SOLVE eats up two of the seven possible GSB levels: One
for SOLVE and one for the calls to the user function
The program which calculates f(x) must not call SOLVE (no nesting)
HP-15C
to last evaluation step
10

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents