WP 34S Solver
05-28-2015, 04:27 AM (This post was last modified: 05-28-2015 05:07 AM by Marcio.)
Post: #21
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: WP 34S Solver
(05-28-2015 04:19 AM)AnalogJoe Wrote:  Well as far as I know you only have to provide an initial guess, as opposed to the intervals of solution.

Try to find the roots for x^2-5*x+6 (2 and 3) and use 1 and 1.5 as initial guesses. You'll get an error. Oddly enough, if your guesses are greater than 3 (but not much!), the calc will return 3.
05-28-2015, 11:58 AM
Post: #22
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: WP 34S Solver
(05-28-2015 04:19 AM)AnalogJoe Wrote:  Well as far as I know you only have to provide an initial guess, as opposed to the intervals of solution.

The 34s solver requires two initial guesses that should bracket the root. You enter them in X and Y (gueses1 [ENTER] guess2 [SLV] ...). This and more details can be found in the manual.

There are also PDFs around that show how to use the 34s for certain tasks, i.e. they offer more than just a function index, similar to like the classic HP manuals.

(05-28-2015 04:19 AM)AnalogJoe Wrote:  The WP 34s developers shed some light into this issue, but im pretty sure the Solver uses somekind of open method such as Newton-Rhapson, or similar..

The 34s uses a more sophisticated solver that is based on the Brent algorithm.

(05-28-2015 04:19 AM)AnalogJoe Wrote:  I have mixed feelings about these type of HP numeric solvers, on one hand they are extremely painful when it comes to solving polynomials because they will only find one particular root, and you have to constantly change your initial guess in order to find the different roots, at this point it is useful to remember Descartes rule of signs to get a better idea of what you should be looking for.

Especially for solving polynomials, both with real and complex coefficients, dedicated programs exists that will do the job. For instance, the 34s emulator comes with polyroot.wp34s. Some time ago in the old forum there was a vivid discussion on this kind of polynomial solver, and there was a quite good program by another poster. Sadly he chose to withdraw it, so it's no longer available.

(05-28-2015 04:19 AM)AnalogJoe Wrote:  Apparently there are programs available which address these issues on the 34s, but you need the dreaded flash cable to load them, something I have yet to build.

The emulator works without the "dreaded cable". ;-) And of course you can always enter any program manually into your 34s. Save it in flash memory and it's always there when you want it. A program listing can be found in the .wp34s file, or take a look at this thread in the old forum. Including some modifications suggested by myself. The final version by Miguel Toro can be found in the articles section. I think this is what you are looking for, so you should try it.

Code:
x^4 - 4 x^3 - 3 x^2 + x + 1 =>          Compl 1   =            -0,57898166378    [x<>y]   0,22687379984    [R/S]             Compl 2   =            -0,57898166378    [x<>y]  -0,22687379984    [R/S]             Real 3    =             0,56277097739    [R/S]             Real 4    =             4,59519235018    [R/S]             0

Dieter
05-28-2015, 12:45 PM (This post was last modified: 05-28-2015 12:46 PM by Marcio.)
Post: #23
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: WP 34S Solver
(05-28-2015 11:58 AM)Dieter Wrote:  The 34s solver requires two initial guesses that should bracket the root. You enter them in X and Y (gueses1 [ENTER] guess2 [SLV] ...). This and more details can be found in the manual.
Interesting. However, I was able to find one root that was not bracketed, it was a bit close though, and they (the bounds) wouldn't work if pushed a little further.

(05-28-2015 04:19 AM)AnalogJoe Wrote:  I have mixed feelings about these type of HP numeric solvers, on one hand they are extremely painful when it comes to solving polynomials because they will only find one particular root, and you have to constantly change your initial guess in order to find the different roots, at this point it is useful to remember Descartes rule of signs to get a better idea of what you should be looking for.

Especially for solving polynomials, both with real and complex coefficients, dedicated programs exists that will do the job. For instance, the 34s emulator comes with polyroot.wp34s.

If these programs are so wanted by the community, why not include them in the firmware? Just a thought.
05-28-2015, 03:52 PM
Post: #24
 Pascal Junior Member Posts: 7 Joined: Apr 2015
RE: WP 34S Solver
(05-28-2015 04:27 AM)Marcio Wrote:  Try to find the roots for x^2-5*x+6 (2 and 3) and use 1 and 1.5 as initial guesses. You'll get an error. Oddly enough, if your guesses are greater than 3 (but not much!), the calc will return 3.

Hi Marcio,

That was a bug in the Solver algorithm that I mentioned some weeks ago. Pauli has updated the corresponding file, so your example should work with the next firmware version.

Pascal
05-28-2015, 06:07 PM (This post was last modified: 06-10-2015 11:29 AM by Marcio.)
Post: #25
 Marcio Senior Member Posts: 438 Joined: Feb 2015
RE: WP 34S Solver
(05-28-2015 03:52 PM)Pascal Wrote:
(05-28-2015 04:27 AM)Marcio Wrote:  Try to find the roots for x^2-5*x+6 (2 and 3) and use 1 and 1.5 as initial guesses. You'll get an error. Oddly enough, if your guesses are greater than 3 (but not much!), the calc will return 3.
Hi Marcio,
That was a bug in the Solver algorithm that I mentioned some weeks ago. Pauli has updated the corresponding file, so your example should work with the next firmware version.
Pascal

Funny we used the same equation exactly. Anyways, in this POST from 2012, Pauli says the following:

Quote:The solver should stay within the two estimate IF they produce function evaluations of opposite signs. Otherwise, they are just used as a guide and it is free to wander outside.
The solver uses a quadratic interpolation step but this is guarded against going to far or encountering problems with either a secant or bisection step instead.
I have code to use Ridder's method after a bisection instead of the quadratic interpolation. This is supposed to be better but I never noticed enough of an improvement to justify its inclusion and so it isn't included in the build.
- Pauli

Meaning the method is not restricted to regula falsi. I don't know if they were able to take a look at this bug though.
 « Next Oldest | Next Newest »

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