The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

3x3 matrix operations for the HP-12C Part II
Message #1 Posted by Kalevipoeg on 9 Aug 2007, 3:25 a.m.

I posted the Cramer’s rule for the HP-12c on February 2005. http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv014.cgi?read=68690
Now I have played with matrices and the HP-12C again.

My old 12C can find the inverse of the 3x3 matrix and pretty quickly too.

Here is my procedure. You may wonder that there is no GTO command in this program. Yes, that´s true. It wasn´t necessary.


01 RCL 5    21 RCL 8    41 RCL 8    61 / 
02 RCL 9    22 *        42 *        62 R/S
03 *        23 RCL 5    43 -        63 RCL 5
04 RCL 6    24 RCL 7    43 RCL 0    64 RCL 8
05 RCL 8    25 *        45 /        65 RCL 2
06 *        26 -        46 R/S      66 STO 8
07 -        27 RCL 3    47 RCL 4    67 RDN
08 RCL 1    28 *        48 RCL 7    68 STO 5
09 *        29 +        49 RCL 1    69 RCL 1
10 RCL 6    30 STO 0    50 STO 7    70 *
11 RCL 7    31 RCL 6    51 RDN      71 X<>Y
12 *        32 RCL 9    52 STO 4    72 STO 2 
13 RCL 4    33 RCL 3    53 RCL 3    73 RCL 4
14 RCL 9    34 STO 9    54 *        74 *
15 *        35 RDN      55 X<>Y     75 -
16 -        36 STO 6    56 STO 1    76 RCL 0
17 RCL 2    37 RCL 5    57 RCL 6    77 /
18 *        38 *        58 *
19 +        39 X<>Y     59 -
20 RCL 4    40 STO 3    60 RCL 0

User instructions:

Store elements of matrix A in row order into registers R1 through R9. C=A-1. Press R/S to calculate c11.
Press R/S to calculate c21. Press R/S to calculate c31. Press R/S to calculate c12. Press R/S to calculate c22 etc.
You can press RCL 0 to find the determinant of A.

      
Re: 3x3 matrix operations for the HP-12C Part II
Message #2 Posted by Antonio Maschio (Italy) on 9 Aug 2007, 5:22 a.m.,
in response to message #1 by Kalevipoeg

WOW!

-- Antonio

      
3x3 matrix operations for the HP-12C Part II
Message #3 Posted by Kalevipoeg on 10 Aug 2007, 2:46 a.m.,
in response to message #1 by Kalevipoeg

Back to Cramer’s rule for the HP-12C. In matrix form AX=B. Here is my new program listing for solving X. This one is three program steps shorter than the earlier listing and it works smoother too.


01 0        21 RDN      41 RCL n    61 * 
02 STO 0    22 STO 4    42 *        62 +
03 RCL 1    23 RDN      43 RCL i    63 RCL 0
04 RCL 2    24 i        43 RCL 8    64 X=0?
05 RCL 3    25 RCL 8    45 *        65 GTO 71
06 RCL n    26 RCL 9    46 RCL 5    66 /
07 STO 3    27 RCL PV   47 RCL PV   67 R/S
08 RDN      28 RCL 7    48 *        68 RCL 0
09 STO 2    29 PV       49 -        69 CHS
10 RDN      30 RDN      50 RCL 1    70 GTO 02
11 STO 1    31 STO 9    51 *        71 RDN
12 RDN      32 RDN      52 -        72 / 
13 n        33 STO 8    53 RCL i    73 LST X
14 RCL 4    34 RCL 4    54 RCL 7    74 GTO 02
15 RCL 5    35 *        55 *        
16 RCL 6    36 X<>Y     56 RCL 4    
17 RCL i    37 STO 7    57 RCL PV   
18 STO 6    38 RCL 5    58 *
19 RDN      39 *        59 -
20 STO 5    40 -        60 RCL 2

User instructions:

Store elements of matrix A in row order into registers R1 through R9. Store elements of column vector B into registers n, i and PV. Press [ f ] [ PRGM ] [ R/S ] to calculate x1. Press [ R/S ] to calculate x2. Press [ R/S ] to calculate x3. Press [ RCL ] 0 to display the determinant of matrix A.

Edited: 10 Aug 2007, 5:53 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall