Prev: MacOSX + HP48gx
Next: mmc and mdc
From: John H Meyers on 22 Sep 2007 20:59 On Sat, 22 Sep 2007 18:09:28 -0500, Giovanni wrote: > I'm encountering some problems with the following: > 1st equation: SQRT(4-x^2) with ABS(x)<=2 > 2nd equation: ABS(x)-2 with ABS(x)>2 > The 50g plots the graph correctly only using the following methods: > 1) writing a small program, as described by Andreas (so typing << IF > 'abs(x)<=2' THEN 'SQRT(4-x^2)' ELSE 'abs(x)-2' END >>); > 2) using the IFTE method, as suggested by Virgil and others; > Quite surprisingly to me, if I use the method of the TI-83 (let's call > it this way), so if I write (abs(x)<=2)*(SQRT(4-x^2))+ > (abs(x)>2)*(abs(x)-2)), the calculator only plots > the positive part of the semi-circumference. > Has anyone of you got an idea about why the machine > behaves in such a way? I see that Virgil has already pointed out the CAS flag (-119), which corresponds to the "Rigorous" option in the MODE > CAS screen. The CASCFG command (set default CAS settings) also corrects this. Those who have original HP48S/G non-CAS series never slip into this gutter :) [r->] [OFF]
From: John H Meyers on 22 Sep 2007 22:00 [about plots using 'ABS()' function in formulas] I forgot to mention that only _algebraic_ formula evaluation is subject to the "Rigorous" flag (-119) of the CAS; the ABS command itself, with stack arguments, doesn't seem to pay attention to it, so non-CAS evaluation of ABS remains unaffected, AFAIAA. But if your programs which still evaluate some algebraic expressions (even "less than" expressions) actually do work, even in non-rigorous mode, then it would appear that *some* of the formula evaluations are *always* "rigorous" (that is, using COMPEVAL rather than CASCOMPEVAL) -- I wonder whether there's a "formula" for knowing exactly when each behavior occurs? [r->] [OFF]
From: John H Meyers on 22 Sep 2007 23:09 On Sat, 22 Sep 2007 08:56:32 -0500, Giovanni wrote: > Although the other methods kindly described work, Virgil's [using IFTE] > is probably the nearest to what I saw on TI-89 Titanium; however, > when I plot such a function, the calculator is much slower than usual > in this kind of operation. Is it normal? > If I plot a graph using the other methods, it is as fast as usual. Editing the function in "Approximate" mode (in which all numbers are "floating point," including integers) may result in faster subsequent execution than editing it in "Exact" mode (in which integers are created differently, and take more time when used in computations). But another choice of modes can sometimes be even more important: In which calculator mode did you edit the expression containing IFTE? That is, was it in ALGebraic mode, or in RPN mode? If you would like to see why this could matter a great deal, read about "hp50G and recursion," in which the execution time for a recursively defined function using IFTE became infinite! (but only in ALG mode!) http://groups.google.com/group/comp.sys.hp48/browse_thread/thread/7e6b2d8a8599adf1/ The essence of that surprising behavior was that in ALG mode, 'IFTE(x,y,z)' is compiled in such a way that 'x' and 'y' and 'z' are all evaluated first, then 'x' is tested, to choose one of the remaining results afterwards, which is subtly different from the logic of IF x THEN y ELSE z END, in which 'x' is tested first, and then only one of 'y' or 'z' is evaluated, illustrating that the subtlest differences in how we evaluate and experience life can change absolutely everything. With best wishes from http://www.mum.edu and http://www.maharishischooliowa.org -[ ]-
From: Giovanni on 23 Sep 2007 16:25 I'm so sorry, but I cannot understand which is the link between the latest 4 answers and my problem (probably it's my fault). Anyway, I tried to de-activate flag 119, and of course the result didn't change, so using the "TI-83" method I'm still not able to get the correct graph. And, if I set to "not-rigorous" the calculator, using the IFTE mode the operation isn't as fas as I expected; what's more, the graph only consists in the positive part of the circumference. Awkward problem, isn't it?
From: Colin Croft on 24 Sep 2007 09:37
Wes wrote: >>but an alternative way on the 83 is to type equation >>and then the condition. >>Ex: Graph y=x+2 for x>5 so you would type y1=x+2(x>5) > > > I think you meant to type y1=(x+2)(x>5). The parentheses around the x > +2 are required to have the effect you want. The x>5 evaluates to > either 1 (true) or 0 (false). This value is then multiplied by x+2 > giving the result x+2 when true and 0 when false. If you turn off the > graph axes (2nd-Format, AxesOff), you'll see that it's actually > graphing 0 when false. A small point: it's better to graph y1=(x+2)/(x>5). Doing it this way means that the function is undefined outside the domain since you are dividing by zero (boolean false). This has the advantage that you do not get the jagged vertical line joining the last defined value to the x axis as you do if the function is going from a defined value of x+2 to being zero. Being undefined, it simply stops. |