John's Vademecum

Try to learn something about everything, and everything about something -Thomas Huxley “Darwin's bulldog” (1824-1895)

User Tools

Site Tools


public:calculator:guides:dm15l_miso_solve

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:calculator:guides:dm15l_miso_solve [02/08/22 11:53 BST] – [DM15L "Miso" Solve] johnpublic:calculator:guides:dm15l_miso_solve [06/03/25 06:49 GMT] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
  
-====== DM15L "Miso" Solve ======+====== DM15L "Multi In Single Out" Solve ======
  
 ** Using multi-variable equations in SOLVE ** ** Using multi-variable equations in SOLVE **
Line 11: Line 11:
  
  
 +<QUOTE>
 +
 +
 +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.
 +
 +
 +
 +<code>
 +
 +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)
 +
 +</code>
 +
 +<cite>
 +[[https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=556]]
 +</cite>
 +
 +</QUOTE>
  
 ===== Example : OHMS LAW ===== ===== Example : OHMS LAW =====
Line 16: Line 139:
 from [[https://www.hpmuseum.org/forum/thread-1212.html]] from [[https://www.hpmuseum.org/forum/thread-1212.html]]
  
-<code>+<QUOTE> 
 + 
 So, can I write an equation in programming, such as So, can I write an equation in programming, such as
  
Line 24: Line 149:
  
 and use SOLVE to find the unknown? and use SOLVE to find the unknown?
- 
-cf. TECHNIQUE: 'SOLVE' AND 'INTEG' WITH "MISO" USER FUNCTIONS ON THE 34C/15C/41C 
  
 Code: Code:
-LBL A + 
-STO (i) +  LBL A 
-RCL 0 +  STO (i)  
-RCL* 1 +  RCL 0 
-RCL- 2 +  RCL* 1 
-RTN+  RCL- 2 
 +  RTN
  
 Example: Example:
-<I> STO 0 +  <I> STO 0 
-<E> STO 2 +  <E> STO 2 
-1 STO I +  1 STO I 
-SOLVE A+  SOLVE A
  
-</code>+<cite> from [[https://www.hpmuseum.org/forum/thread-1212.html]] </cite> 
 + 
 +</QUOTE>
  
  
Line 50: Line 176:
  
  
-{{tag>}}+{{tag>calculator dm15l}}
  
  
public/calculator/guides/dm15l_miso_solve.1659437627.txt.gz · Last modified: 06/03/25 06:49 GMT (external edit)