Post Reply 
[Free42] root finder
06-19-2016, 11:18 PM
Post: #12
RE: [Free42] root finder
The root finder in Free42 is supposed to behave just like the one in the real HP-42S, at least as far as starting guesses are concerned. (The actual numerical root-finding algorithm is a different matter.)

There are two modes of operation: using the SOLVER application menu interactively, and using the programmable SOLVE function.

When using the SOLVER application menu: you can provide up to two starting values by entering numbers and pressing X (I'm just going to say X to refer to the menu key that represents the variable you're trying to solve for.) When you try to solve without providing any starting values, the solver starts with 0 and 1; if you provide one starting value, only that value will be used (in other words, the two starting values are initialized to the same number); and if you provide two starting values, of course those two are used.

You provide two starting values by entering <value 1> X <value 2> X; while nominally the X menu key performs STO "X", the SOLVER menu actually keeps track of two values by saving whatever previous value was in the variable in an invisible "shadow" variable.

When you use the SOLVE function, the starting values are X (the variable) and the contents of the X register, or, if the variable X doesn't exist yet, the starting values are 0 and the X register.

When the solver finds a root, it sets the X variable to that root.

Now, the problem that got this thread started: if you want to find a *different* root, and provide only one new starting value, the solver will probably immediately return the root that it had found before, because it uses that as one of the starting values for the new run: when you enter the new starting value, the old value of the X variable is copied to the above-mentioned "shadow" variable, and will be used as a starting value.

So, if you want to find a different root, enter two new starting values, or if you only have one, enter it twice, and then solve: <number> X ENTER X X (using the SOLVER menu) or <number> STO "X" SOLVE "X" (programmatically).

All of this is supposed to behave just like on the original HP-42S; this logic hasn't changed since version 1.0. I'm pretty sure it is correct, or surely someone would have said something in the 11+ years since 1.0, but if there is a use case where Free42 doesn't handle starting values like the HP-42S, please let me know!
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[Free42] root finder - Marcio - 06-15-2016, 12:23 AM
RE: [Free42] root finder - Dieter - 06-15-2016, 10:09 PM
RE: [Free42] root solving - Dieter - 06-15-2016, 01:03 PM
RE: [Free42] root solving - Marcio - 06-15-2016, 01:39 PM
RE: [Free42] root solving - Dieter - 06-15-2016, 07:18 PM
RE: [Free42] root finder - Marcio - 06-15-2016, 09:12 PM
RE: [Free42] root finder - Dieter - 06-15-2016, 10:04 PM
RE: [Free42] root finder - Marcio - 06-16-2016, 03:04 PM
RE: [Free42] root finder - Dieter - 06-16-2016, 05:14 PM
RE: [Free42] root finder - Marcio - 06-16-2016, 06:41 PM
RE: [Free42] root finder - Thomas Okken - 06-19-2016 11:18 PM



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