RF Eclectica Wiki

Try to learn something about everything, and everything about something - Thomas Huxley

User Tools

Site Tools


public:calculator:guides:dm15l_miso_solve

Calculator Hints & Tips

DM15L "Miso" Solve

Using multi-variable equations in SOLVE

Source

https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=556

In order to conveniently employ SOLVE or INTEG on the HP-34C/15C/41C for multiple-input, single-output (MISO) user-defined functions, the user's program should emulate the way SOLVE and INTEG manage input variables on the three Pioneer-series models and the HP-33s.

Assume that a MISO function is to be programmed as an RPN routine on a HP-34C, HP-15C, or HP-41C/CV/CX. A user may wish to use SOLVE or INTEG successively for any selected “focus” variable with all others held constant, and without having to edit the RPN routine. Here is a simple procedure for this purpose:

Choose a numbered storage register for each variable in the function. On the 41C/CV/CX, choose another numbered register as the indirect storage register. (Do not use a stack register, as it will be overwritten by SOLVE or INTEG.) In PROGRAM mode:

Program the function as an RPN routine that not only meets the basic requirements, but also retrieves each variable from its chosen storage register when it is used. (On the 41C/CV/CX, the label beginning the routine must be an external label.) The second instruction of the routine (immediately after LBL) should store the stack x-register value to the indirectly-referenced register. This instruction is “STO (i)” on the HP-34C and HP-15C; it is “STO IND nn” on the HP-41C/CV/CX. In RUN mode:

Store the desired constant values of the fixed-value variables to their storage registers. Store the register number containing the floating variable to the indirect storage register. Invoke SOLVE or INTEG in the usual manner. This procedure utilizes indirect storage to make the RPN program more flexible. SOLVE and INTEG feed the each value of the floating variable as input to the user program, which immediately stores the value indirectly to its user-chosen register. Each variable in the function is then recalled for use in calculations, so the user program need not be structured to receive any particular variable from the stack.

EXAMPLE:

f(x, y, z) = 2*x - ln y + 1/z

x in R1; y in R2; z in R3
indirect in R00 (HP-41 only)


HP-15C/HP-34C program:      HP-41C/CV/CX program:


LBL A                       LBL "AA"
STO (i)                     STO IND 00
RCL 1                       RCL 01
2                           2
*                           *
RCL 2                       RCL 02
LN                          LN
-                           -
RCL 3                       RCL 03
1/x                         1/x
+                           +
RTN                         RTN


In RUN mode, solve for x such that f(x, y=15.1, z=5.3) = 0


HP-15C/HP-34C:              HP-41C/CV/CX:


15.1                        15.1
STO 2                       STO 02
5.3                         5.3
STO 3                       STO 03
1                           1
STO I                       STO 00
0.5                         0.5
ENTER                       ENTER
5                           5
SOLVE A                     "AA"  (enter AA in alpha mode)
                            XEQ "SOLVE"


(Answer is 1.263007749)


Next, solve for y such that f(x=0.7, y, z=3.3) = 0


HP-15C/HP-34C:              HP-41C/CV/CX:


0.7                         0.7
STO 1                       STO 01
3.3                         3.3
STO 3                       STO 03
2                           2
STO I                       STO 00
0.5                         0.5
ENTER                       ENTER
6                           6
SOLVE A                     "AA"  (enter AA in alpha mode)
                            XEQ "SOLVE"


(Answer is 5.490560270)


Finally, integrate f(x=1.7, y=4.1, z) over z = 1.0 to 6.0.
Specify 5 decimal-digit absolute function accuracy:


HP-15C/HP-34C:              HP-41C/CV/CX:


FIX 5                       FIX 5
1.7                         1.7
STO 1                       STO 01
4.1                         4.1
STO 2                       STO 02
3                           3
STO I                       STO 00
1                           1
ENTER                       ENTER
6                           6
INTEG A                     "AA"  (enter AA in alpha mode)
                            XEQ "INTEG"


(answer is 11.73682)

https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=556

Example : OHMS LAW

from https://www.hpmuseum.org/forum/thread-1212.html

So, can I write an equation in programming, such as

(I* R) - E = 0

(or however one should program it in)

and use SOLVE to find the unknown?

Code:

LBL A
STO (i) 
RCL 0
RCL* 1
RCL- 2
RTN

Example:

<I> STO 0
<E> STO 2
1 STO I
SOLVE A

from https://www.hpmuseum.org/forum/thread-1212.html

John Pumford-Green 02/08/22 11:50

Further Information

public/calculator/guides/dm15l_miso_solve.txt · Last modified: 06/08/22 13:29 BST by john