HP 15C Quick Reference Manual Download Page 10

HP-15C

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
MATRIX 8

Row norm & Frobenius norm. Puts original X into Last X. Then if X is a 
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

Root Finding (Solver)

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, 
.0-.9, A-E

Finds real root of a function. This is a value X where the function f(X) 
evaluates to 0.

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

 to last evaluation step

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)

Complex mode SOLVE ignores the complex stack and can only calculate real roots

10

Summary of Contents for 15C

Page 1: ...umber of uncommitted registers Use DIM to commit them to storage registers Uncommitted registers are automatically converted to program space when needed pp Number of registers containing program instructions One register consists of 7 bytes and can hold 7 program steps except for a few instructions that occupy two bytes n Number of bytes left before next uncommitted register is converted to progr...

Page 2: ...L 0 9 0 9 Recall number from storage register to X register RCL 0 9 0 9 RCL 0 9 0 9 RCL x 0 9 0 9 RCL 0 9 0 9 Register recall arithmetic X OP Register X X 0 9 0 9 Exchange X with one of the storage registers STO I Store X in index register STO x I Register store arithmetic with index reister RCL I Recall value from index register RCL x I Register recall arithmetic with index reister X I Exchange X...

Page 3: ...of X INT Returns the integer part of X yx Y to the power of X Works also for negative Y in case X is integer Calculates X percent of Y Does not pop the stack Percential difference from Y to X Does not pop the stack Trigonometric Functions DEG Set trig mode degrees 360 RAD Set trig mode radians 2π indicated in display GRD Set trig mode grad 400 indicated in display SIN COS TAN Trigonometric functio...

Page 4: ...previous program step but do not execute any program code PRGM Step backwards thru program scolls when held down Inserting steps Program entry starts with line number 1 Line 000 indicates the start of the program space Commands are inserted after the currently displayed line Program code values indicate the row column of a command with the exception that numbers are displayed as such Prefix keys h...

Page 5: ...0 X 0 1 X 0 2 X 0 3 X 0 4 X 0 5 X Y 6 X Y 7 X Y 8 X Y 9 X Y If camparisn is false Skip the next program step If camparisn is true Execute the next program step ISG 0 9 0 9 I Increment and skip if greater This loop command uses the specified register which must contain a value in the form nnnnn xxxyy where nnnnn Current initial loop counter value xxx Comparisn value for loop counter yy Loop counter...

Page 6: ...al part of the number Store STO 1 Re Im STO 2 Re Im Recall RCL 2 RCL 1 f I or RCL 2 Re Im RCL 1 this does not disturb the stack x y Replace both real and imaginary part of X and Y register R R Shift both the real and imaginary part Sqrt x Ln Log 1 x ex hyp sin cos tan hyp 1 sin cos tan All these unary functions work in complex mode as well NOTE To calculate sqrt 1 the complex mode must be already ...

Page 7: ...contains a matrix descriptor then the DIM operation will be performed on the matrix specified in I This indirect method applies to other matrix operations see below RCL DIM A E i Places the matrix dimensions in X and Y A non exisiting matrix has dimensions 0x0 RCL MATRIX A E Put a matrix descriptor in the X register This displays the matrix name and its dimensions STO 0 9 0 9 I RCL 0 9 0 9 I Matri...

Page 8: ...A This is the matrix that will hold the result of a matrix operation Not all operations require a result matrix The result matrix will automatically be dimensioned so that it can properly hold the result For some matrix operations the result matrix can be identical to one of the input matrices STO RESULT When a matrix descriptor is already present in X then this matrix will be used as the result m...

Page 9: ...he Y X order X must be square and have dimensions compatible with Y MATRIX 5 Calculate YT X RESULT where RESULT may neither be X nor Y X Y must have compatible dimension MATRIX 6 Calulatest the residual RESULT Y X RESULT The descriptor of RESULT is placed in X RESULT may neither be X nor Y X Y must have compatible dimension Matrix in LU form Its descriptor is displayed with two dashes after the ma...

Page 10: ...xecuted 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 Root Finding Solver 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 0 9 A E Finds real root of a function This is a v...

Page 11: ...program at the label must calculate the function f X and return the result in X before it executes the RTN When x y ends the stack wil contain these values X The integral of f x Y The uncertainty of the result x y f x X Y Z Upper integration limit T Lower integration limit Note that x y eats up two of the seven possible GSB levels One for x y and one for the calls to the user function The program ...

Reviews: