HP (Hewlett-Packard) HP 33s Calculator User Manual


 
14–6 Solving and Integrating Programs
File name 33s-English-Manual-040130-Publication(Edition 2).doc Page : 388
Printed Date : 2004/1/30 Size : 13.7 x 21.2 cm
Using SOLVE in a Program
You can use the SOLVE operation as part of a program.
If appropriate, include or prompt for initial guesses (into the unknown variable and
into the X–register) before executing the SOLVE
variable instruction. The two
instructions for solving an equation for an unknown variable appear in programs
as:

label

variable
The
programmed SOLVE instruction does not produce a labeled display (variable
=
value) since this might not be the significant output for your program (that is, you
might want to do further calculations with this number before displaying it). If you
do want this result displayed, add a VIEW variable instruction after the SOLVE
instruction.
If no solution is found for the unknown variable, then the next program line is
skipped (in accordance with the "Do if True" rule, explained in chapter 13). The
program should then handle the case of not finding a root, such as by choosing
new initial estimates or changing an input value.
Example: SOLVE in a Program.
The following excerpt is from a program that allows you to solve for x or y by
pressing
t
X or Y.