The Museum of HP Calculators

HP Forum Archive 15

 SOLVE on 15CMessage #1 Posted by John on 15 Aug 2005, 11:20 a.m. How does one use the SOLVE function on the 15C? I have misplaced my copy of the manual and would like to figure this one out. - John

 Re: SOLVE on 15CMessage #2 Posted by Vieira, Luiz C. (Brazil) on 15 Aug 2005, 12:50 p.m.,in response to message #1 by John Hi, John; first of all, you should express the expression to be solved in terms of a program, with a unique label in memory and a RTN as its last step (no [R/S] because it would stop SOLVE execution after a first scan, as well). The RTN is not necessary if the program is the last program (or the only one) in memory. Consider that your program uses the stack information as the estimative for your reference variable, the one that the expression must be solved for. The SOLVE internal routine samples your program with the given estimates, so it leaves the a copy of the estimated value in all of the four stack registers, as an aid to help writing your program. Like this: solve the following equation for x.`y=x^3-2ŚLN(ABS(x)+1)`A possible program that represents this expression could be:```f LBL 0 3 y^x x<>y (x xchange y) g ABS 1 + g LN 2 Ś - g RTN```As you can see, we consider that a copy of the estimated x is available in all of the four stack registers. After loading this program, enter two initial guesses (separated by [ENTER]) where the program should start searching for a root and press`f SOLVE 0` The [0] after f [SOLVE] means the SOLVE routine will search for a LBL 0 and sample it till it returns a zero. If the root is not in the range you suggest, chances are that the SOLVE routine finds it anyway. Hope this helps for now. If you need further advice, let us know. Best regards and success. Luiz (Brazil) Edited: 15 Aug 2005, 12:52 p.m.

 Gnarly problem, Luiz! [SOLVE on 15C]Message #3 Posted by Karl Schneider on 18 Aug 2005, 1:50 a.m.,in response to message #2 by Vieira, Luiz C. (Brazil) Hello, Luiz -- Your example for John was actually a tough equation to solve, and especially for the HP-15C! Was that intentional? He might be disappointed in the performance of his fine HP calculator... ```y=x^3-2ŚLN(ABS(x)+1) ``` This equation has solutions for y = 0 at x = 0 and x = 1.153299. There is a local minimum of y = -0.727258 at x = 0.637971. The solution at x = 0 is also a local maximum. However, the solution at x = 0 is difficult for the HP Solve routine to obtain, because of the characteristics of equation's absolute value and natural logarithm functions at or near that point. The slope dy/dx of the equation is ```3x2 - 2/(x+1) for x > 0 3x2 - 2/(x-1) for x < 0 ``` So, the slope is +2.00 for x = 0-, and -2.00 for x = 0+, and not defined at x = 0. The 15C could obtain the solution at x = 1.153299 with certain choices of first guesses (including -0.1 and +0.1), but unsuccessfully tried to "home in" on x = 0 for first guesses near, but straddling 0. "Error 8" (NO ROOT FOUND) would result for some other choices. The HP-32S and HP-32SII did better at obtaining the root at 0, but also tended to find the other root. -- KS Edited: 18 Aug 2005, 2:04 a.m.