The Museum of HP Calculators


Simultaneous Equations In Two Unknowns for the HP-25

This program is Copyright © 1975 by Hewlett-Packard and is used here by permission. This program was originally published in "HP-25 Applications Programs".

This program is supplied without representation or warranty of any kind. Hewlett-Packard Company and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

Let ax + by = e
and cx + dy = f

be a system of two equations in two unknowns. Cramer's Rule is used to find the solution.

    |e  b|                        |a  e|                
    |    |                        |    |                
    |f  d|    ed - bf             |c  f|    af - ec     
x = ------ = ---------        y = ------ = ---------    
    |a  b|    ad - bc             |a  b|    ad - bc     
    |    |                        |    |                
    |c  d|                        |c  d|              

If ad - bc = 0 the calculator displays Error. In this case no solution or no unique solution exists.

Instructions

Step Instructions Input Data/Units Keys Output Data/Units
1 Enter program      
2 Store constants a STO 1  
    b STO 2  
    e STO 3  
    c STO 4  
    d  STO 5  
    f STO 6  
3 Find x and y    f PRGM R/S ×
      R/S y
4 For new case, go to step 2      

Example

5x - 3y = 12
2x + y = 9

Solution:
x = 3.55
y = 1.91

The Program

LINE    CODE    KEYS
 00  
 01     24 03   RCL 3
 02     24 05   RCL 5
 03        61   ×
 04     24 02   RCL 2
 05     24 06   RCL 6
 06        61   ×
 07        41   -
 08     24 01   RCL 1
 09     24 05   RCL 5
 10        61   ×
 11     24 02   RCL 2
 12     24 04   RCL 4
 13        61   ×
 14        41   - 
 15     23 00   STO 0
 16        71   ÷
 17        74   R/S
 18     24 01   RCL 1
 19     24 06   RCL 6
 20        61   ×
 21     24 03   RCL 3
 22     24 04   RCL 4
 23        61   ×
 24        41   -
 25     24 00   RCL 0
 26        71   ÷
 27     13 00   GTO 00

Register Use

R0  ad - bc
R1  a
R2  b
R3  e
R4  c
R5  d
R6  f

Go back to the software library
Go back to the main exhibit hall