Post Reply 
HP 35s and Solve button (but not in equation catalogue)
09-27-2014, 05:33 PM
Post: #1
HP 35s and Solve button (but not in equation catalogue)
If Solve button is pressed in regular RPN mode (not in equation catalogue), HP35s ask for the variable to solve for, as it normally would if an equation was chosen in equation catalogue. SELECT FN message follows.

Does it mean that it's useless to press SOLVE not being in Equation Catalogue, or is this a valid shortcut (but to solve which equation/programme?).

Cheers!
Find all posts by this user
Quote this message in a reply
09-27-2014, 06:23 PM
Post: #2
RE: HP 35s and Solve button (but not in equation catalogue)
Not sure but I am thinking shortcut.
Visit this user's website Find all posts by this user
Quote this message in a reply
09-28-2014, 06:05 PM
Post: #3
RE: HP 35s and Solve button (but not in equation catalogue)
(09-27-2014 05:33 PM)mcjtom Wrote:  Does it mean that it's useless to press SOLVE not being in Equation Catalogue, or is this a valid shortcut (but to solve which equation/programme?).

Solve can be used in two different ways. On the one hand it can solve an equation from the list in EQN mode. On the other hand it can be used for solving a function previously programmed by the user.

In both cases Solve has to know which equation/program to solve. In EQN mode this is done by simply selecting the appropriate equation from the list. Otherwise, i.e. in regular RPN mode, you tell Solve which program to solve by means of the FN= command (yellow-shifted R/S key). If such a program has not been stated before, the 35s of course does not know what function to solve, and so it asks you ("SELECT FN").

Example:
Solve the equation x² – 5 = 0

Code:
A001 LBL A
A002 RCL X
A003 x²
A004 5
A005 -
A006 RTN

FN= A        ; tell the 35s to solve the equation programmed at label A

0 STO X
5            ; provide two initial guesses

SOLVE X     ; Solve equation A for variable X

X= 2,2631   ; result

That's all.

Dieter
Find all posts by this user
Quote this message in a reply
09-29-2014, 12:42 PM
Post: #4
RE: HP 35s and Solve button (but not in equation catalogue)
Dieter, many thanks!

I have a related question:

In a programme, if I enter an equation as a line, the equation is evaluated (if Flag 11 is set, I'm asked for the variable values, if not the current values are used).

But how do I solve (or integrate) an equation in a programme? It seems that Solve Var construct looks for programmes (Var+A,B,C... etc.) not the equations entered in the previous lines or in the Equation catalogue? Can I point Solve to an equation instead somehow?

I'm sure I'm missing something in the manual, but I can't find it...

Cheers!
Find all posts by this user
Quote this message in a reply
09-29-2014, 05:32 PM
Post: #5
RE: HP 35s and Solve button (but not in equation catalogue)
(09-29-2014 12:42 PM)mcjtom Wrote:  Can I point Solve to an equation instead somehow?

You have to wrap your equation in a program with a label:
Quote:PRGM TOP
0001 FN=G
0002 SOLVE P
0003 RTN
G001 LBL G
G002 P×V=N×R×T
G003 RTN

Cheers
Thomas

PS: See 15-4 Solving and Integrating Programs
Find all posts by this user
Quote this message in a reply
09-30-2014, 11:12 AM
Post: #6
RE: HP 35s and Solve button (but not in equation catalogue)
Brilliant, thanks!

Last question:

when, for instance, FN=B statement is used, it point to the begining of a B programme (which contains an equation). Is it possible to point FN to a particular line of B-programme (for instance FN=B006).

The reason for this question is: do I have to wrap equation as a separate subprogramme (e.g. B) or could I use it within a subprogramme (e.g. B), without having to separate it from the rest of it by giving it a unique Letter-name?

Cheers!
Find all posts by this user
Quote this message in a reply
09-30-2014, 11:52 AM
Post: #7
RE: HP 35s and Solve button (but not in equation catalogue)
When I try to wrap function in programme, I get SOLVE ACTIVE message. What do I do from there?

Here is the programme:

A001 LBL A
A002 FN= A
A003 SOLVE B
A004 RTN
B001 LBL B
B002 PxV=NxRxT
B003 RTN

I invoke it by XEQ A.

p.s. Maybe SF 11 has something to do with it, but I wasn't able to successfully use it...
Find all posts by this user
Quote this message in a reply
09-30-2014, 04:44 PM
Post: #8
RE: HP 35s and Solve button (but not in equation catalogue)
(09-30-2014 11:52 AM)mcjtom Wrote:  A001 LBL A
A002 FN= A
A003 SOLVE B
A004 RTN
B001 LBL B
B002 PxV=NxRxT
B003 RTN
What are you trying to achive by solving A inside of A? This is a recursion and doesn't work.
Find all posts by this user
Quote this message in a reply
09-30-2014, 06:27 PM (This post was last modified: 09-30-2014 09:27 PM by Dieter.)
Post: #9
RE: HP 35s and Solve button (but not in equation catalogue)
(09-30-2014 11:52 AM)mcjtom Wrote:  When I try to wrap function in programme, I get SOLVE ACTIVE message. What do I do from there?

Simple - avoid the error. ;-) The message means that you use Solve (or Integrate, for that matter) within a program that is being solved.

Quote:Here is the programme:

A001 LBL A
A002 FN= A
A003 SOLVE B
A004 RTN
B001 LBL B
B002 PxV=NxRxT
B003 RTN

I invoke it by XEQ A.

There is your error. You start the program at label A which then tries to solve itself (FN=A). This obviously makes no sense. You even want to solve for an unknown variable B which is not used anywhere.

Please keep in mind:

"FN=A" defines the function/program at label A as the one that is to be solved.
"SOLVE B" defines variable B as the one you want to know.

Here is an example for a correctly working program:

A001 LBL A
A002 FN=B ; solve the equation following label B
A003 SOLVE N ; and solve it for variable N (or P, or V, or R, or T)
A004 VIEW N ; display result (required within a program)
A005 RTN

B001 LBL B ; here is your program/equation
B002 PxV=NxRxT ; with these five variables P, V, N, R and T
B003 RTN

Please note the additional VIEW N statement in A004 that displays the result obtained by Solve. Within a program it is not displayed automatically. Simply because you may want to continue with that result instead of having it displayed. Within a program, Solve also works like a test command: if there is a result, the program continues with the next statement. If no result can be calculated, the next step is skipped (!).

(09-30-2014 11:52 AM)mcjtom Wrote:  Maybe SF 11 has something to do with it, but I wasn't able to successfully use it...

Flag 11 does not make a difference here. It just decides whether you are prompted for the variables or not. With flag 11 cleared you can use a sequence of INPUT statements (one for each variable) at the beginning of the program defining your function, and you will be asked for the known variables – cf. chapter 15 of the 35s manual.

Dieter
Find all posts by this user
Quote this message in a reply
09-30-2014, 06:34 PM (This post was last modified: 09-30-2014 09:17 PM by Dieter.)
Post: #10
RE: HP 35s and Solve button (but not in equation catalogue)
(09-29-2014 12:42 PM)mcjtom Wrote:  Can I point Solve to an equation instead somehow?

No, there is no way to access the equation list from within a program.

(09-30-2014 11:12 AM)mcjtom Wrote:  Is it possible to point FN to a particular line of B-programme (for instance FN=B006).

No, sorry.

Dieter
Find all posts by this user
Quote this message in a reply
09-30-2014, 10:28 PM
Post: #11
RE: HP 35s and Solve button (but not in equation catalogue)
Thank you!
Find all posts by this user
Quote this message in a reply
10-01-2014, 01:09 AM
Post: #12
RE: HP 35s and Solve button (but not in equation catalogue)
(09-30-2014 06:27 PM)Dieter Wrote:  
(09-30-2014 11:52 AM)mcjtom Wrote:  When I try to wrap function in programme, I get SOLVE ACTIVE message. What do I do from there?

Simple - avoid the error. ;-) The message means that you use Solve (or Integrate, for that matter) within a program that is being solved.

Quote:Here is the programme:

A001 LBL A
A002 FN= A
A003 SOLVE B
A004 RTN
B001 LBL B
B002 PxV=NxRxT
B003 RTN

I invoke it by XEQ A.

There is your error. You start the program at label A which then tries to solve itself (FN=A). This obviously makes no sense. You even want to solve for an unknown variable B which is not used anywhere.

Please keep in mind:

"FN=A" defines the function/program at label A as the one that is to be solved.
"SOLVE B" defines variable B as the one you want to know.

Here is an example for a correctly working program:

A001 LBL A
A002 FN=B ; solve the equation following label B
A003 SOLVE N ; and solve it for variable N (or P, or V, or R, or T)
A004 VIEW N ; display result (required within a program)
A005 RTN

B001 LBL B ; here is your program/equation
B002 PxV=NxRxT ; with these five variables P, V, N, R and T
B003 RTN

Please note the additional VIEW N statement in A004 that displays the result obtained by Solve. Within a program it is not displayed automatically. Simply because you may want to continue with that result instead of having it displayed. Within a program, Solve also works like a test command: if there is a result, the program continues with the next statement. If no result can be calculated, the next step is skipped (!).

(09-30-2014 11:52 AM)mcjtom Wrote:  Maybe SF 11 has something to do with it, but I wasn't able to successfully use it...

Flag 11 does not make a difference here. It just decides whether you are prompted for the variables or not. With flag 11 cleared you can use a sequence of INPUT statements (one for each variable) at the beginning of the program defining your function, and you will be asked for the known variables – cf. chapter 15 of the 35s manual.

Dieter

An excellent and clear explanation Dieter! This was quite confusing when I first started using it, and took a while to figure it out. Yours is by far the best explanation of this I've seen. Thanks very much for taking the time to explain it so clearly, including useful tips like the test command behavior.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
10-01-2014, 05:31 PM
Post: #13
RE: HP 35s and Solve button (but not in equation catalogue)
(10-01-2014 01:09 AM)rprosperi Wrote:  An excellent and clear explanation Dieter! This was quite confusing when I first started using it, and took a while to figure it out.

Thank you very much, Rob. Indeed the syntax of SOLVE can be confusing if you are used to the way it works on the 34C and 15C. These machines do not use lettered variables and simply use the stack for x as well as f(x). Thus here SOLVE is followed by the label defining the function instead of the variable: On a 34C the command SOLVE A solves the function programmed at label A, while the same command on a 35s solves a (separately declared) function for variable A. After I got the 35s this was a bit confusing for me either as I was used to the good old 34C.

Dieter
Find all posts by this user
Quote this message in a reply
10-01-2014, 06:52 PM (This post was last modified: 10-04-2014 03:40 PM by rprosperi.)
Post: #14
RE: HP 35s and Solve button (but not in equation catalogue)
(10-01-2014 05:31 PM)Dieter Wrote:  
(10-01-2014 01:09 AM)rprosperi Wrote:  An excellent and clear explanation Dieter! This was quite confusing when I first started using it, and took a while to figure it out.

Thank you very much, Rob. Indeed the syntax of SOLVE can be confusing if you are used to the way it works on the 34C and 15C. These machines do not use lettered variables and simply use the stack for x as well as f(x). Thus here SOLVE is followed by the label defining the function instead of the variable: On a 34C the command SOLVE A solves the function programmed at label A, while the same command on a 35s solves a (separately declared) function for variable A. After I got the 35s this was a bit confusing for me either as I was used to the good old 34C.

Dieter

I believe the 32S and 32SII (and maybe their algebraic bretheren) were similar to the 34C as well. The 34C is the first solver I learned eons ago, and like all first loves (actually 2nd after my 25C, but I digress) it is inherently correct.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
10-03-2014, 06:56 PM
Post: #15
RE: HP 35s and Solve button (but not in equation catalogue)
(10-01-2014 06:52 PM)rprosperi Wrote:  I believe the 32S and 32SII (and maybe their algebraic bretheren) were similar to the 34C as well. The 34C is the first solver I learned eons ago, and like all first loves (actually 2nd after my 25C, but I digress) it is inherently correct.

Karl Schneider wrote an excellent article on SOLVE and INTEG on HP's RPN-based models.

Original implementation

HP-34C
HP-15C
HP-41C/CV/CX with Advantage Pac

Later implementation
HP-32S
HP-42S
HP-32SII
HP-33s
HP-35s

In it, he describes a method to create a MISO solver for the 34C, 41C and 15C, effectively replicating (or emulating...) the solver functionality in later Pioneer models.

Jeff K
Find all posts by this user
Quote this message in a reply
10-09-2014, 03:43 PM
Post: #16
RE: HP 35s and Solve button (but not in equation catalogue)
(10-01-2014 01:09 AM)rprosperi Wrote:  An excellent and clear explanation Dieter! This was quite confusing when I first started using it, and took a while to figure it out. Yours is by far the best explanation of this I've seen. Thanks very much for taking the time to explain it so clearly, including useful tips like the test command behavior.

Just wanted to give the same sentiment! I didn't really understand how to write a program with this many variables from the guides I'd read on the 35s, but this suddenly makes a whole lot sense Tongue
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: