Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!solvint.UUCP!john From: john@solvint.UUCP Newsgroups: comp.sys.handhelds Subject: Re: Possible bug with ISOL and SOLVE Message-ID: <9010122240.AA17200@CS.ORST.EDU> Date: 12 Oct 90 22:38:05 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 69 In article <4155@tellab5.tellabs.com> ram@tellabs.com (Bob Martin) writes: >I was playing around with some equations and learning about ISOL, when I ran >across the following situation: > >2: 'PV=PMT*((1-(1+INTPP)^-NUMP)/INTPP)' >1: 'NUMP' >execute ISOL >I expect: 1: 'NUMP=-(LN(1-PV/PMT*INTPP)/LN(1+INTPP))' >but I get: 1: 'NUMP=-((LN(1-PV/PMT*INTPP)+2*pi*i*n1)/LN(1+INTPP))' [ description of excursion into principle value solutions and arbitrary integers deleted] >When I solve for NUMP (having supplied sane values for PV, INTPP, and PMT), >I get an error - "Bad guess(es)". ???? What's going on? [ demonstrates that 2*\pi*i*n1 term is not the culprit ] > ... So what in the world is going on here? >Please help, I am very confused! Surprise, you've used bad guesses. Either set 'n1' to 0 or set the principle value flag, that's not your problem. Look at the equation returned by ISOL. The numerator of the left-hand side contains the term LN(1-PV/PMT*INTPP). Using ``reasonable '' values for PV, PMT and INTPP like 25000, 400, and 0.13 produces LN(-7.125), which produces a complex result that the 48 assumes is the result of bad initial guesses for the unknown. The problem is that --- in this case --- the value for INTPP is 12 times too high. 0.13 (13%) is the ANNUAL interest rate and not the periodic interest rate (INTPP=interest per period). Divide this by 12 and get 0.01833, use this in the expression (you then have LN(0.3229)) and get 104.9 for the number of periods (months). That's 8 3/4 years. If you've not made a mistake in scaling your interest rate, you may be following the wrong sign convention. Your original formula requires that PV and PMT both be the same sign, + or -. All of the newer HP calculators (including the 48 in the Equation Library Card) require that the signs of these two be opposite to signify the direction of cash flow --- one is to you and the other is from you. Using the wrong convention can cause the LN of a negative number and give you the same error. You may already know this, but you don't need to ISOLate NUMP before SOLVing for it. The SOLVEr will solve for any unknown in any location in the equation/expression. I just used SOLVE on the original equation and got the same answer for NUMP. Finally, most problems I've seen with the 48 are USERS either not understanding how to use the calculator or some aspect of mathematics, or problem solving in general. The ``bugs'' in the 48 are remarkably few and Hewlett-Packard should be rightly praised for its product. On the other hand, indiscriminate use of the term ``bug'' in all confusing situations paints HP in a bad light for those who are either novices with or don't own 48's. Uncool. Please be sure of your facts before you use the `b' word, and even then, bugs are best reported directly to HP where there's a MUCH better chance that they will get appropriate attention. Announcing the resolution of your problem to the network would be much appreciated, though. I don't mean to discourage questions like this one, just to discourage casual slander. I hope I've helped, -- John W. Loux | Solve and Integrate Corp solvint!john@orstcs.cs.orst.edu | PO Box 1928 john@solvint.uucp | Corvallis, OR 97339-1928 | (503) 754-1207