The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

HP 35s - Choosing Initial Guesses for SOLVE problem
Message #1 Posted by Pablo P (Spain) on 24 Sept 2010, 7:11 p.m.

Hi all! I have a problem when I use SOLVE with some equations that have two roots.

For example, consider the equation X^2 = 1. As you know, it has two solutions (x1 = 1, x2 = -1). HP 35s always shows me 1. Even when I choose the initial guesses for the negative root as described in the manual (section 7-8).

The same problem with the equation 0.5 = (1 + (%pi / LN(X))^2)^-0.5. It has two solutions (x1 = 0.16303353482158, x2 = 6.133707406236229) and I always get x2.

On the contrary, there are other equations that work well. For example: X^2+X-6=0. With that one, I can get the two solutions (x1 = 2, x2 = -3).

I do not know if I am doing something bad. Any idea?

_________________

Notes:

%pi = Number PI

Edited: 24 Sept 2010, 7:22 p.m.

      
Re: HP 35s - Choosing Initial Guesses for SOLVE problem
Message #2 Posted by Karl Schneider on 25 Sept 2010, 12:19 a.m.,
in response to message #1 by Pablo P (Spain)

Pablo --

You've discovered for yourself a somewhat-dubious "feature" of the HP-33s and HP-35s. Please see this thread from about a month ago; my post at the bottom of it provides a link to a thread from 2004.

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv019.cgi?read=171095#171095

In the equations X^2 = 1 and (1 + (pi / LN(X))^2)^(-0.5) = 0.5, the variable X appears only once. The calculator's equation parser enables direct solution of X, executing inverse operations in reverse order. Using principal roots of all math functions, the same answer is returned every time, no matter what the starting points were.

Calculated answers for the second equation:

X = exp(pi/sqrt(3))  = 6.1337074062362276
X = exp(-pi/sqrt(3)) = 0.1630335348215805
In the equation X^2+X-6=0, the variable X appears more than once, so the 'algebraic' techniques are forgone and numerical iteration is used instead.

-- KS

Edited: 3 Oct 2010, 8:37 p.m. after one or more responses were posted

            
Re: HP 35s - Choosing Initial Guesses for SOLVE problem
Message #3 Posted by Pablo P (Spain) on 26 Sept 2010, 4:54 p.m.,
in response to message #2 by Karl Schneider

Thanks Karl, I did not read the thread from about a month ago because I was on holidays. The solution you pointed there works perfectly. And yes, it is a (very) dubious "feature"... :)

                  
Re: HP 35s - Choosing Initial Guesses for SOLVE problem
Message #4 Posted by Karl Schneider on 3 Oct 2010, 8:35 p.m.,
in response to message #3 by Pablo P (Spain)

There is value to the direct-solution method, as it should always return a solution if one exists, even if either initial guess value will produce a math error upon evaluation, or if a subsequent evaluation point does the same. I learned a few years ago that the celebrated HP-17B/HP-27S solver includes a similar direct-solution method.

Still, a well-designed solver should return a valid solution that lies within the range of two user-specified initial guesses, instead of a directly-calculated solution outside that range. The calculator cannot know what root(s) is/are of interest in the user's equation.

-- KS

Edited: 3 Oct 2010, 8:40 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall