WP34S solver question  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: WP34S solver question (/thread226821.html) 
WP34S solver question  Reth  07122012 I noticed strange behaviour of the SLV function. Long story short:
comparing WP34S and (HP15C):
34S: HP48G (and identically HP35S) and HP42S (Free 42) give similar to 15C, right within accuracy answers. Am I missing something?
Timing is also interesting. 15C takes almost constant time unlike the 34S. Edited: 12 July 2012, 8:27 a.m.
Re: WP34S solver question  Walter B  07122012 Not sure you are aware of: L is the LASTx register of the WP 34S.
Re: WP34S solver question  Damir  07122012 Initial guess 0.001 is too small.Try 0.01.
Damir
Re: WP34S solver question  Gerson W. Barbosa  07122012 The lack of dedicated stack registers is one of the few weaknesses of the WP 34s, IMHO. The user should not worry about not using these forbidden alpha registers for whatever purpose. No problem LastX occupying a position on the keyboard, ./, could gladly go away.
Re: WP34S solver question  Walter B  07122012 Easy rule: use numbered registers  keep off the lettered registers! Unlike many Pioneers, the WP 34S doesn't feature lettered registers beyond the stack and specials. Please see p.23 of the manual.
Re: WP34S solver question  Gerson W. Barbosa  07122012 Sorry! I'll be patient and wait for the wp43s :)
Re: WP34S solver question  Marcus von Cube, Germany  07122012 L is used correctly as lastX here. A and B may only be used as general registers if the stack size is set to 4, not 8. Even if the solver itself runs with the stack size fixed at 4, this is not true for the called function which uses whichever stack size is set by the user.
Re: WP34S solver question  Reth  07122012 It is good enough for all other mentioned calculators.
Re: WP34S solver question  Reth  07122012 Quote:What makes you think I'm not? Re: WP34S solver question  Paul Dale  07122012 Quote: Don't. The algorithms used underneath are very different. In order to get faster convergence, the 34S is using more advanced algorithms than HP's solver. HP's solver is a guarded secant from my understanding whereas the 34S uses this plus quadratic and Ridder's steps. The 34S is finding a pole rather than a root which is unfortunate but by no means impossible with either solver.
Re: WP34S solver question  fhub  07122012 Quote:So the 34s SLV command is in fact a combined root&pole finder. ;)
Won't it be possible to check for a pole with the following method:
Franz
Re: WP34S solver question  Paul Dale  07122012 That might work but leaves the questions:
The solver is being trapped because f(a) > 0 and f(b) < 0. For a continuous function there must be a root between a and b (by the intermediate value theorem). The solver can't just blindly abandon the search because the absolute value increased or it will miss legitimate roots. HP's solver can and does get stuck in exactly the same way when it encounters a zero crossing discontinuity.
Re: WP34S solver question  Reth  07122012 Thanks for the explanation, I suspected so... Apparently I got fouled by the way SLV is used as described in the manual and the reference to the HP15C. Never the less, I'd prefer the old working horse, never had such problems with it. Re: WP34S solver question  Reth  07122012 Quote:I'm not so much into the theory, but I can't remember HP solver getting stuck  for the problems I had to solve, or at least in this way (giving /+90 degrees). Isn't it possible SLV to give up instead?
Cheers
Re: WP34S solver question  Paul Dale  07122012 If I had the code for the old solver, I'd likely have just implemented it identically. Unfortunately, HP's code isn't available.
Re: WP34S solver question  Gerson W. Barbosa  07122012 Quote: Sure, but would Prof. Kahan's article help in any way? HewlettPackard Journal December 1979 "Personal Calculator Has Key to Solve Any Equation f(x) = 0" starts at page 20. Gerson.
Re: WP34S solver question  Paul Dale  07122012 I read through that article multiple times :) It is good and I do do most of what is written about but it isn't quite complete I think.
Re: WP34S solver question  Valentin Albillo  07132012 .
Quote:
Forget that old article, it's quite nebulous and incomplete and thus can't be used to reengineer the original HP Solve code. I suggest you peruse instead this much more complete, 63page PDF document, somewhat heavier on the math side but then it's the real thing, not a brief article: Lecture notes on Real RootFinding
Have a nice weekend and best regards from V.
Re: WP34S solver question  Ángel Martin  07132012 I don't mean to add controversy and this is probably not useful anyway, but the HP code (at least the Advantage's MCODE) *is* available  as long as one doesn't mind a bit of reverseengineering. If you remove all the Buffer#14 handling routines it's a sizable but relatively understandable task. FWIW, feel free to ignore it and persue a new approach. After all it may also flunk with the same example, I didn't try it but being based ont he 15C I guess it won't.
Cheers,
Edited to add: tried the example in question and not surprisingly it yields the same results as the 15C. Edited: 13 July 2012, 3:10 p.m.
Re: WP34S solver question  Paul Dale  07132012 Thanks for this far more up to date reference. I hadn't seen it. I'm not in the least bit scared of a bit of heavy mathematics :)
Re: WP34S solver question  Paul Dale  07132012 I hadn't thought of this possibility, it would give us compatibility. The MATH pack solver is another option I guess. I'd like to think that there has been some worthwhile progress in automatic solving in the last forty odd years though.
Re: WP34S solver question  Gerson W. Barbosa  07132012 Quote: I am. I'm glad Valentin's reference has reached the right audience :) Mathematics Written in Sand might also be a good reading.
Gerson.
Re: WP34S solver question  Paul Dale  07132012 I know that document well :)
