The Museum of HP Calculators

HP Articles Forum

[Return to the Index ]
[ Previous | Next ]


A Label Saving Simultaneous Equation Solution for the 33s

Posted by Palmer O. Hanson, Jr. on 29 May 2006, 10:19 a.m.

Introduction

The "Solution of Simultaneous Equations"program on pages 15-12 through 15-20 of the hp 33s user's guide solves using matrix inversion and matrix multiplication. It includes 136 program lines and eight labels. The program length is not a problem. The use of eight of only 26 available labels is.

A program in the museum catalog "Cramer's Rule for the HP-32S2" by Adam Szporer avoids the lengthy process of matrix inversion. It can be easily moved to the hp 33s. The Szporer program uses 96 program lines and four labels; however, that program does not provide a data entry routine. Rather, the user must enter the elements with a series of STO commands from the keyboard.

The program below also solves using Cramer's rule. It uses the data entry and determinant routines from the hp 33s user's guide. The program uses 82 program lines but only four labels.

Program Description

Data entry uses the T routine and the first four lines of of U routine. Those lines are the same as the data entry routine on page 15-13 of the hp 33s user's guide. The elements of the matrix is stored in variables A through I. The elements of the vector is stored in variables J through L. The remainder of the U routine calculates the determinant of the matrix and stores the value in variable W. The V routine solves using Cramer's rule. All determinant calculations are performed using the D routine routine in the hp 33s user's guide. The elements of the solution vector are stored in variables X, Y and Z. The solution vector is displayed using VIEW commands. An additional R/S after the Z value has been displayed returns the user to the top of the program with the original matrix elements and vector elements in place.

User Instructions

1. Press XEQ T to start the program.

2. Enter the matrix elements in order by columns, followed by the vector elements.

3. When the third vector element has been entered the program will proceed to solve. If the determinant of the input matrix is zero program execution will stop with the message "DIVIDE BY ZERO" in the display.

4. If the determinant of the input matrix is not zero program execution will stop with the X element of the solution vector in the display. Press R/S to see the Y element of the solution vector. Press R/S again to see the Z element of the solution vector.

5. Press R/S again to return to the input routine with the original input in place.

6. To solve a second order system follow the instructions on page 15-18 of the hp 33s user's guide.

Program Listing

In addition to the listing below the usr must enter the D routine from pages 15-16 and 15-17 of the hp 33s user's guide.

T0001 LBL T
T0002 1.012
T0003 STO i
U0001 LBL U
U0002 INPUT (i)
U0003 ISG i
U0004 GTO U
U0005 1.00903
U0006 STO i
U0007 21
U0008 STO V
U0009 XEQ D
U0010 STO W
U0011 1/x
V0001 LBL V
V0002 RCL (i)
V0003 STO M
V0004 RCL J
V0005 STO(i)
V0006 1
V0007 STO+ i
V0008 RCL(i)
V0009 STO N
V0010 RCL K
V0011 STO (i)
V0012 1
V0013 STO+ i
V0014 RCL (i)
V0015 STO O
V0016 RCL L
V0017 STO (i)
V0018 XEQ D
V0019 RCL/ W
V0020 RCL V
V0021 STO+ i
V0022 x<>y
V0023 STO (i)
V0024 x<>y
V0025 STO- i
V0026 RCL O
V0027 STO (i)
V0028 1
V0029 STO- i
V0030 RCL N
V0031 STO (i)
V0032 1
V0033 STO- i
V0034 RCL M
V0035 STO (i)
V0036 2
V0037 STO- V
V0038 ISG i
V0039 GTO V
V0040 VIEW X
V0041 VIEW Y
V0042 VIEW Z
V0043 GTO T

Password:

[ Return to the Message Index ]

Go back to the main exhibit hall