HP-35S solver questions - extremum - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: HP-35S solver questions - extremum (/thread-177996.html) |
HP-35S solver questions - extremum - x34 - 01-30-2011 HP-35S Solver differs from the one of HP-33S at least in two aspects: a) It permits user to STOre the values in registers.
b) It is much prone not to find/show extremums of function solved.
May be, the creators of HP-35s wanted to make Solver more advanced (hence the ability to use STO in EQN), but had no resources to implement reasonable additional functionality. Well, the EQN and STO are very interesting, and should be examined more closely. Especially, using indirect registers, there may be possibility to break into calc internals here (i hope so). Interesting thing, that usage of X>X is allowed in the EQN. I do not understand the logic yet, however.
I am now trying to write some kind of equation permitting to use Solver for extremum search. The simplest way seems to compute derivative function and find it's roots.
Re: HP-35S solver questions - extremum - Glenn Shields - 01-30-2011 You may be interested in a previous thread by Katie (IIRC, which is not that often) in which she wrote a function for solver which counts iterations, like a loop. This thread has been very, very difficult for me to find, can anyone help with this? It does provide a way of Re: HP-35S solver questions - extremum - x34 - 01-30-2011 Thanks Glenn! I suppose you speak about http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv017.cgi?read=121288 Found it in Google. Very interesting!
While continuing to learn solver, I've found one new interesting thing: when you solve for indirect, (I) or {J), and modify I or J, EQN: (I)>I*2+3Solver would solve for Z (-26), not for (I) with changing value of I. Re: HP-35S solver questions - extremum - Thomas Klemm - 01-30-2011 From the same thread (Message #13):
Quote: Welcome to the club.
Best regards
PS: Reading this thread again I suddenly realized that Katie's trick could be used with the HP-17BII to solve the N-queens problem.
Re: HP-35S solver questions - extremum - Don Shepherd - 01-30-2011 Quote: Thomas, please elaborate on this. I looked at the sample programs for the n-queens benchmark recently and came to the conclusion that, since there seemed to be one or two indefinite loops in that algorithm, the 17bii solver would not be able to handle that since it does not support indefinite loops. I'm curious, what did you have in mind?
thx, Don
Re: HP-35S solver questions - extremum - Thomas Klemm - 01-30-2011 From message #3 Posted by Katie Wasserman on 13 Aug 2007, 10:45 a.m.,
Quote: (...)
Quote: Of course we really want to do this because we need a means to exit a loop on a specific condition. I'm not sure at all whether all this would work to write a solver program for the N-queens problem. But at least it seems the solver isn't limited to a for-loop.
From message #6 Posted by Katie Wasserman on 15 Aug 2007, 3:40 a.m.,
Quote:
HTH
Edited: 31 Jan 2011, 12:09 a.m.
Re: HP-35S solver questions - extremum - Don Shepherd - 01-31-2011 Thanks Thomas, I remember that thread from 2007 and Katies work then. Fascinating stuff. When I looked at the BASIC program (thinking it would be easier to understand than the RPN and RPL solutions) for the n-queens problem here, there seemed to be about 4 overlapping indefinite loops: lines 40-100, 70-150, 90-130, and 140-170. I didn't know exactly what these loops were doing, but since they weren't definite loops I didn't think the 17bii solver could handle them. I did learn of a way to actually exit a loop early on the 17bii solver from user Mike Ingle about 4 years ago, but you exited early by halting the program with a programmed divide by 0 after you stored some value of interest in one of the menu variables, which you could RCL after the program stopped. That might work for one indefinite loop, but not 4! I would present a "steely-eyed missle man" award to the person who could implement the n-queens problem on the 17bii solver.
Don
Re: HP-35S solver questions - extremum - Thomas Klemm - 01-31-2011 Don, I've started a new thread concerning this problem.
Best regards Re: HP-35S solver questions - extremum - x34 - 02-01-2011 I wrote: "But if you RCL it, solve would ask for it's value, effectively blocking usage of it for temporary data storage." Katie wrote (http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv017.cgi?read=121288): "The get, G(), function I was referring to is a special function in the 17bii solver (and several other HP calculators going back to the 27S) that recalls the value of a variable each time it's encountered. When used in combination with the let, L(), function it allows for side-effects in the solver. The 35s solver apparently has the L() function (in the form of STO) but not the G() function, or so it seems." I think it is wrong. G() (RCL) works. The only problem is you should enter first value of it (seed) at the launch of solver. Strangely, Katie make use of it in her examples. Something i do not understand. Or G() is not equivalent to RCL? More: solver uses local (to it) copy of variable solved.
0 STO A Edited: 1 Feb 2011, 5:19 p.m.
|