TI-95 ProCalc: Solving Equations With 2 Known Values, Solve for the Third Variable
Introduction
The two programs presented on today's blog will show an approach to program a solver where:
* Values for two variables are known
* The third variable is solved for automatically
We will make use of TI-95 ProCalc's user flags 01, 02, and 03 to determine which variable has entries and which variable is to be solved for. I stored 2 into a variable (in this case, C) to count down the number of values are entered. These programs assume that the user will always enter values for two different variables without the need to review or edit values entered.
Keys:
F1: first variable - controlled by user flag 01
F2: second variable - controlled by user flag 02
F3: third variable - controlled by user flag 03
TI-95 ProCalc's flag operations:
RF: reset flag, clear flag
SF: set flag
TF: tests whether a flag is set
INV TF: tests whether a flag is reset
All the variables and their values, entered or solved for, are shown at the end.
Ohm's Law
R = V / I
R = resistance in Ohms (Ω)
V = voltage in Volts (V)
I = current in Amps (A)
The program reminds the user of what units are expected in the beginning.
CHAR 244 adds Ω to the alpha string.
The alpha string ' TO ENTER' has three spaces at the beginning of the string to allow room for C. C is merged at space 2.
Housekeeping Items:
RF 01 RF 02 RF 03: Resets the flags 01, 02, and 03 at the end of the program.
DFN CLR: Clears the defined keys F1 - F5.
TI-95 ProCalc File OHM
Size: 224 bytes
0 STO I STO R STO V 2 STO C
RF 01 RF 02 RF 03 CLR
'OHM'S LAW' PAU CLR
'UNITS: ' CHR 244 ',A,V' PAU
LBL A0
CLR ' TO ENTER' COL 02 MRG C
DEF F1: R @A1
DEF F2: I @A2
DEF F3: V @A3
HLT
LBL A1 STO R SF 01 DSZ C GTL A0 GTL B0
LBL A2 STO I ST 02 DSZ C GTL A0 GTL B0
LBL A3 STO V SF 03 DSZ C GTL A0 GTL B0
LBL B0
INV TF 01 SBL B1
INV TV 02 SBL B2
INV TF 03 SBL B3
CLR 'R=' COL 16 MRG R BRK
CLR 'I=' COL 16 MRG I BRK
CLR 'V=' COL 16 MRG V RF 01 RF 02 RF 03 DFN CLR HLT
LBL B1 RCL V / RCL I = STO R RTN
LBL B2 RCL V / RCL R = STO I RTN
LBL B3 RCL I * RCL R = STO V RTN
Examples
I = 10 A, R = 1500 Ω; Result: V = 15,000 V
R = 200 Ω, V = 240 V; Result: I = 1.2 A
I = 15 A, V = 110 V; Result: = 7.333333333 Ω
Right Triangle
This programs solves any of the following variables, from knowing the other two vales:
X: run
Y: rise
R: hypotenuse
In addition, the angle (Θ) is calculated where Y is considered the opposite side and X the adjacent side.
CHECK ANG MODE: a prompt to check angle mode, just in case you are not in the desired angle mode. The program runs in any angle mode.
CHR 242: adds Θ to the alpha string
TI-95 ProCalc File TRI
Size: 248 bytes
0 STO X STO Y STO R STO A 2 STO C
RF 01 RF 02 RF 03 CLR
'CHECK ANG MODE' BRK
LBL A0
CLR ' TO ENTER' COL 02 MRG C
DEF F1:ADJ@A1
DEF F2:ADJ@A2
DEF F3:HYP@A3
HLT
LBL A1 STO X SF 01 DSZ C GTL A0 GTL B0
LBL A2 STO Y ST 02 DSZ C GTL A0 GTL B0
LBL A3 STO R SF 03 DSZ C GTL A0 GTL B0
LBL B0
INV TF 01 SBL B1
INV TV 02 SBL B2
INV TF 03 SBL B3
( RCL Y / RCL X ) INV TAN = STO A
CLR 'X=' COL 16 MRG X BRK
CLR 'Y=' COL 16 MRG Y BRK
CLR 'R=' COL 16 MRG R BRK
CLR CHR 242 '=' COL 16 MRG
A RF 01 RF 02 RF 03 DFN CLR HLT
LBL B1 ( RCL R x^2 - RCL Y x^2 ) SQR = STO X RTN
LBL B2 ( RCL R x^2 - RCL X x^2 ) SQR = STO Y RTN
LBL B3 ( RCL X x^2 + RCL Y x^2 ) SQR = STO R RTN
Examples
All examples are in degrees mode.
X = 3, Y = 4
Results: R = 5, Θ = 53.13010235°
X = 11.8, R = 19.9
Results: Y = 16.02404443, Θ = 53.63231539°
Y = 27, R = 54.4
Results: X = 47.22668737, Θ = 29.75706329°
Commas added to the results for readability.
Eddie
All original content copyright, © 2011-2021. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.