HP 15c User Manual

Page 141

Advertising
background image

Section 4: Using Matrix Operations

141

Labels used: A, B, and 2 through 8.

Registers used: R

2

through R

9

, R

.0

, R

.1

, and Index register.

Matrices used: A, B, C, D, and E.

Your subroutine, labeled "E", may use any labels and registers not listed above, plus the
Index register, matrix B, and matrix E (which should contain your calculated gradient).

To use the program:

1. Enter your subroutine into program memory.

2. Press 11 ´m%

to reserve registers R

0

through R

.1

(Your subroutine may

require additional registers.)

3. Set flag 0 if you're seeking a local minimum; clear flag 0 if you're seeking a local

maximum.

4. Dimension matrix A to 1, where n is the number of variables.

5. Store the required data in memory:

Store the I nitial estimate x

0

in matrix A.

Store a in R

2

.

Store e in R

3

.

Store d in R

4

.

Store N in R

5

.

6. Press GA to view the slopes during the iteration procedure.

View the iteration number and the value of f(x).

If Error 1 appears, press − to clear the message. Then either go back to step and
possibly revise parameters as needed, or press −¦ to provide one more
bounding search iteration or one more optimization iteration. (If the descriptor of
matrix A was in the display when the error occurred, the number of bounding
search iterations exceeded N; if the descriptor of matrix C was in the display, the
number of optimization iterations exceeded N.)

7. Press ¦ to view the norm of the gradient and to start the next iteration.

If the display flashes the norm of the gradient, press − and then recall the values

of x in matrix A.

If the iteration number and value of f(x) are displayed, repeat this step as often as

necessary to obtain the solution or go back to step 5 and revise parameters as
needed.

Advertising