Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!news.funet.fi!tut!mr87625 From: mr87625@tut.fi (Matti Rintala) Newsgroups: comp.sys.handhelds Subject: Re: Possible bug with ISOL and SOLVE Message-ID: Date: 12 Oct 90 14:44:53 GMT References: <4155@tellab5.tellabs.com> Sender: news@funet.fi (#News ) Organization: Tampere University of Technology, Finland Lines: 40 In-Reply-To: ram@tellabs.com's message of 11 Oct 90 22:56:48 GMT On 11 Oct 90 22:56:48 GMT, ram@tellabs.com (Bob Martin) said: ... -> I get: 1: 'NUMP=-((LN(1-PV/PMT*INTPP)+2*pi*i*n1)/LN(1+INTPP))' ... -> I go into SOLVR anyway, and set n1 = 0. -> 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? So I edit the -> equation to remove the "+2*pi*i*n1" term, go back into SOLVR and recalculate, -> and everything works fine. So now I surmise that the 48 has a problem -> evaluating 2*pi*i*0. To check this, I enter '2*pi*i*n1' into the stack. -> I store 0 in n1 and hit EVAL, and I get ...... 0! I try storing 1 in n1 and -> EVAL .... '2*pi*i'!! So what in the world is going on here? Well, actually it's quite interesting, but logical: When you EVAL '2*pi*i*n' with n=0, you get 0 because the calculation is done SYMBOLICALLY (i.e. 'i' is just a symbolic constant, and anything times 0 is 0). When you use SOLVR to find the answer, it automatically switches to Numeric Results mode (because it solves equations numerically). In this mode, EVALuating '2*pi*i*n' with n=0 is equal to '2*3.141...*(0,1)*0'. Because this expression has a complex number in it, its result is also complex, i.e. (0,0), but NOT 0 (you can check this by setting the Numeric Results flag (-3) and EVALuating the expression). Because SOLVR only works with real numbers, it tells you 'Bad Guesse(s)' because it can't find any value for n so that '2*pi*i*n' would be real. So, there's no bug in your HP. You just shouldn't use SOLVR for equations with complex numbers in them (even when the complex number is (0,0) ). -> Bob Martin | ram@tellabs.com ...!uunet!tellab5!ram -- 'I'm a personality prototype. You can tell, can't you?' (Marvin the Paranoid Android) ***************************************************************************** Matti Rintala mr87625@tut.fi