Solvers in 27S and 42S



#9

Hi all,

I have a 27S for daily use and think the Solver function is really great and easy to use. I'm thinking about buying a 42S to get the matrix functions and programmability, but I wonder if the Solver in that one is of the same kind as in the 27S? Any info would be greatly appreciated!

Best regards, Anders


#10

Well, it is not the same interface. The 42s does *not* support algebraic entities or equations. In the 42s, you havea a 100% RPN notation sequence.


Of course what the solver can do is the same and more, as it has ll looping and conditionals as a full programming language.


#11

Thanks Bill. OK, just so I get a better understanding, how would the following alg expression (from the museum) be typed and work in the 42S solver?

Alg:(1+infl)*(1+real)=(1+nom)

Btw, is it possible on the 42S to call one Solver expressions from another Solver expression (like sub routines)? It's not on the 27S. And/Or can I call a user defined function from the 42S solver?

Thanks again, Anders


#12

OK. Anders, I take it you are not familiar with "classic" HP RPN programming?

The 42s follows that classic structure. The solver is not in a separate "space" as it is in the 27s. Rather, you can call on the solver to solve any program you have written. The solver is a command. In this sense it is closest to the 34C, or the 15C.

Because the 42S is a full RPN programmable, subroutines are of course fully available. A user-defined function is the same thing as a subroutine in a 42s. You just have to point to them in the main program with a GSB command.

Classic RPN is a command line language. It is not a graphic interface like the 27s.

It is a completely different "paradigm" from a 27s.

If you have a new 33S, you have the ability to program exactly like a 42s, complete with the solver function, and you also havea an "equation list" which is somewhat like a 27s, except that you cannot edit each equation (you have to backspace). If you want to inexpensively learn how RPN programming works, that is one low-cost way to do it.

Take a look at the 34C description here at the museum, and the 15C. There is some good stuff in there.

Edited: 25 Oct 2006, 4:27 p.m.

#13

Quote:
OK, just so I get a better understanding, how would the following alg expression (from the museum) be typed and work in the 42S solver?

Alg:(1+infl)*(1+real)=(1+nom)


Not to take anything away from Bill's response, but sometimes an example says more than 1,000 words. Here's how you would work with your equation on the HP-42S:

First, you must write a program. This program declares its parameters using MVAR instructions, which must come immediately after the program's global label (i.e. its entry point). The MVAR instructions tell the HP-42S which names to display in the solver's menu.

    00 { 49-Byte Prgm }
01 LBL "ALG"
02 MVAR "INFL"
03 MVAR "REAL"
04 MVAR "NOM"
05 1
06 RCL+ "INFL"
07 1
08 RCL+ "REAL"
09 ×
10 1
11 RCL+ "NOM"
12 -
13 .END.

After keying in this program, exit PRGM mode, and activate the solver: [Shift] [SOLVER]. A menu of programs will appear -- not of all the programs in memory, just the ones where a global (ALPHA) label is immediately followed by one or more MVAR commands. From this menu, select ALG.

You will now get a second menu, containing the items INFL, REAL, and NOM. If you enter a number and then press one of those menu keys, the value from the X register is stored in the corresponding variable, exactly as if a STO command was executed (in fact, if you hold the menu key down, it will display STO "INFL" (or whichever variable you just chose)).


After having stored the known variables, you can now solve for the unknown by pressing its menu key. Pressing a menu key immediately after another menu key executes a SOLVE command (as you can verify by holding the key down). The HP-42S will repeatedly invoke your program, showing the different values it tries for the unknown in the display.

Note that your example was an equality. The HP-42S solver only finds zeroes of functions, but you can transform an equality into an equivalent function that the HP-42S can solve by simply subtracting one side of the equality from the other.

Quote:
Btw, is it possible on the 42S to call one Solver expressions from another Solver expression (like sub routines)?

In HP-42S jargon, that question would be phrased as "is it possible to use the SOLVE function from a program that was itself invoked by the SOLVE function?" The answer, alas, is no. (Note that it *is* possible to use the INTEG command from a SOLVE function, and also the other way around, but the solver and integrator can both only deal with one function at a time -- in computer jargon: they are non-reentrant.)

Quote:
And/Or can I call a user defined function from the 42S solver?

Technically, there is no such thing as a user-defined function on the HP-42S; the only things that the user can define are plain old RPN keystroke programs. However, there is no limitation on what a program invoked by the solver can do, compared to other HP-42S programs (apart from the aforementioned restriction of not being able to use the SOLVE function, and one should also be aware that the solver requires one RTN stack level).

Happy solving!

- Thomas


#14

Thomas,

Quote:
Quote:
Btw, is it possible on the 42S to call one Solver expressions from another Solver expression (like sub routines)?

In HP-42S jargon, that question would be phrased as "is it possible to use the SOLVE function from a program that was itself invoked by the SOLVE function?" The answer, alas, is no. (Note that it *is* possible to use the INTEG command from a SOLVE function, and also the other way around, but the solver and integrator can both only deal with one function at a time -- in computer jargon: they are non-reentrant.)


I guess you misunderstood Anders slighly. As far as I understand he just wants to call one equation from another to build up mor ecomplicated equations. In this case, the answer is definitly YES. You can call one RPN routine from another by providing the correct parameters (in the named variables or on the stack, depending on the routine) and just calling it by its name.

Marcus

#15

Anders --

What Bill wrote is true, and I certainly can't surpass Thomas' excellent and detailed reply. However, I can offer some supplementary information in my HP Forum Archives article regarding HP SOLVE and INTEG on RPN-based models:

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

-- KS

Edited: 25 Oct 2006, 11:58 p.m.

#16

Hi all, thanks very much for your time and efforts - these answers are very helpful. What a great forum this is!

Best regards, Anders


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP-27S speed compared to HP-42S Tommi 3 1,305 06-05-2013, 05:55 PM
Last Post: Christoph Giesselink
  27S display - a show stopper? Thomas Radtke 13 2,833 10-11-2011, 07:15 PM
Last Post: M. Joury
  42s questions and 42s vs 35s snaggs 13 3,965 09-19-2011, 02:44 AM
Last Post: snaggs
  HP-27S "Technical Manager" vs. "Scientific" Jim Yohe 9 2,010 03-26-2011, 02:38 AM
Last Post: Walter B
  HP 27s - How to set # decimal places displayed? M Tulloch 4 1,205 12-21-2010, 07:23 PM
Last Post: bill platt
  HP 27S - Adjust screen contrast? M Tulloch 2 957 07-13-2010, 02:09 PM
Last Post: M Tulloch
  Kitchen timer on 17B/17BII/17BII+/19B/19BII/27S y.miyata 1 832 03-04-2010, 12:18 PM
Last Post: Martin Pinckney
  HP-27S Successful LCD transplantation Lyuka 0 608 01-27-2010, 11:58 AM
Last Post: Lyuka
  Pioneer series internal photo (17BII, 27S, 42S) Lyuka 4 1,471 11-16-2009, 06:26 PM
Last Post: geoff quickfall
  Which came first? 19B or 27S? Mark Edmonds 2 864 06-25-2009, 09:41 AM
Last Post: Mark Edmonds

Forum Jump: