Post Reply 
Plus42 algebraic expressions update
03-11-2021, 11:01 AM
Post: #109
RE: Plus42 algebraic expressions update
(03-11-2021 10:32 AM)Thomas Okken Wrote:  
(03-06-2021 04:38 PM)Vincent Weber Wrote:  Reading again this interesting discussion made me think of something: the 35S handles equations in programs not by pointing to the equation list using a name, but directly: you enter the equation in the program by pressing EQN, this puts the equation in the program as a single step, directly readable when reviewing the program. Quite convenient. A flag indicates whether this step should be treated as a mere comment (just text to be ignored) or as an actual equation to evaluate.

It looks like it would be useful to have an instruction for creating long strings directly on the stack, without using the ALPHA register and ASTO/XASTO. And that would allow putting equations right into a program as well.

It's not clear to me what the interaction of such an inline-long-string-treated-as-equation with the rest of the equation functionality should be, though. Could you give one or two examples how evaluating or solving in-line equations works in the 35S?

Hi Thomas,

The general principle on the 35S is: while in a program, you press EQN, this gives you access to the equation editor as if you were in the equation list, except that a new step number is created and inserted on the left side (so you have less steps for your equation). When you hit enter, the step is validated, you see when navigating through the program the step number + whatever part of the equation can be show on the rest of the line. When on the step, pressing the left arrow put you in the equation editor again, so that you can review/edit.
When executing the program, depending on a flag (#11 I think), the step is either treated as a comment (i.e. ignored), or the equation is evaluated (L-R if an equal sign is present), and the result put on the stack.

I'm not sure whether or not you can SOLVE such a equation in program. I don't think so, since SOLVE on the 35S requires that FN= has been properly set to a label prior to solving. You can also solve an equation interactively while in the equation list, but not within the program editor (pressing SOLVE there, even while editing an equation step, just exits the editor and creates a new step starting with SOLVE).

Best for examples is this excellent article by Valentin Albillo, he makes heavy usage of equations in his program:

https://albillo.hpcalc.org/articles/HP%2...umbers.pdf

While you are on his site, you can also have a look as his free42's feature request document, which may keep you busy for the rest of your life Wink

Finally, you can find HP's free 35S emulator for Windows here:

https://www.educalc.net/2336231.page

Hope this helps.

Cheers,

Vincent
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plus42 algebraic expressions update - Vincent Weber - 03-11-2021 11:01 AM



User(s) browsing this thread: 1 Guest(s)