Prev: MacOSX + HP48gx
Next: mmc and mdc
From: Giovanni on 22 Sep 2007 09:56 On 22 Set, 00:04, Virgil <vir...(a)comcast.net> wrote: > In article <1190400492.552077.156...(a)r29g2000hsg.googlegroups.com>, > > > > > > Giovanni <giovanni0ferre...(a)gmail.com> wrote: > > Hi! > > I recently used a TI-89 Titanium (I'm, sorry, but I had to...) instead > > of my 50g and I noticed the presence of a comand named "when". This > > comand allows the user to plot a system of equation. For example, if > > one condition is "x>0", then you can tell the calculator to plot > > "cos(abs(x))" if the first condition is true; you can then tell the > > calculator to plot "cos(x)" if "x<0". > > My question is: is there something similar for the 50g, too? I tried > > to write "WHEN" in the eqw, when I have to insert the function to > > plot, and such a comand seems to exist because, if you digit "WHEN", > > you can use brackets after this comand (for example, you're prevented > > from to doing so if you digit some other letters, for instance > > "asddfgggf"); thus, the calculator must "understand" the expression > > "When" as a command; however, this is neither present in the "catalog" > > menu nor in the User's Guide, so I don't know the syntax (which is > > certainly different from the one used by TI-89 Titanium). > > Any advice is welcomed! > > Try > 'Y=IFTE(0<X,SIN(X),COS(X))' STEQ ERASE DRAX DRAW > > The above w ill graph COS(X) for X <= 0 and SIN(X) for X > 0. > > IFTE is an abbreviation of "if then else".- Nascondi testo tra virgolette - > > - Mostra testo tra virgolette - Although the other methods kindly described work, yours 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. Anyway, thank you all for your help!
From: Wes on 22 Sep 2007 10:10 Yes, you can do this, but first to clarify the two situations you mentioned. > 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. > I recently used a TI-89 Titanium ... > you can then tell the calculator to plot "cos(x)" if "x<0". On the 89, entering y1=cos(x)|x<0 plots cos(x) when x<0 and plots nothing when x>=0. If you turn the axes off (F1, Format, Axes Off), you'll see that it really is plotting nothing, not 0, when false. The 89 won't allow the "multiply by a boolean" trick as it has stricter type checking, treating true/false as a true boolean, not an integer. As others have mentioned, this can be done on the 50g using the IFTE function. It's even easier than what's been suggested. At the Y= screen, simply entering your function as Y1=IFTE(X>5,X+2,0) Y2=IFTE(X<0,COS(X),0) would plot as the 83 does, plotting 0 when false. Read the IFTE (IF- Then-Else) function as "IF x>5 Then x+2 Else 0". The 0 is usually hidden by the x-axis, but if you would prefer the "don't plot anything when false" option, then simply replace 0 with something not real, such as sqrt(-1). Y1=IFTE(X>5,X+2,i) y2=IFTE(X<0,COS(X),i) An interesting side note on the 89, when I defined y1=x+2|x>5 y2=cos(x)|x<0 then y1(4) returned "undefined" as expected, but y2(1) returned "sin(infinity)". Interesting. -wes
From: Giovanni on 22 Sep 2007 13:43 On 22 Set, 16:10, Wes <wjltemp...(a)yahoo.com> wrote: > Yes, you can do this, but first to clarify the two situations you > mentioned. > > > 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. > > > I recently used a TI-89 Titanium ... > > you can then tell the calculator to plot "cos(x)" if "x<0". > > On the 89, entering y1=cos(x)|x<0 plots cos(x) when x<0 and plots > nothing when x>=0. If you turn the axes off (F1, Format, Axes Off), > you'll see that it really is plotting nothing, not 0, when false. The > 89 won't allow the "multiply by a boolean" trick as it has stricter > type checking, treating true/false as a true boolean, not an integer. > > As others have mentioned, this can be done on the 50g using the IFTE > function. It's even easier than what's been suggested. At the Y= > screen, simply entering your function as > > Y1=IFTE(X>5,X+2,0) > Y2=IFTE(X<0,COS(X),0) > > would plot as the 83 does, plotting 0 when false. Read the IFTE (IF- > Then-Else) function as "IF x>5 Then x+2 Else 0". > > The 0 is usually hidden by the x-axis, but if you would prefer the > "don't plot anything when false" option, then simply replace 0 with > something not real, such as sqrt(-1). > > Y1=IFTE(X>5,X+2,i) > y2=IFTE(X<0,COS(X),i) > > An interesting side note on the 89, when I defined > > y1=x+2|x>5 > y2=cos(x)|x<0 > > then y1(4) returned "undefined" as expected, but y2(1) returned > "sin(infinity)". Interesting. > > -wes Thanks for the "clarification", which was really helpful. Eventually, I consider the problem sorted out, so thank you all for your support!
From: Giovanni on 22 Sep 2007 19:09 Well, if I have to say there would be something else I would like to know... about this kind of graphs (graphs of systems of equations). 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? Thank you!
From: Virgil on 22 Sep 2007 20:09
In article <1190502568.193132.278610(a)w3g2000hsg.googlegroups.com>, Giovanni <giovanni0ferretti(a)gmail.com> wrote: > Well, if I have to say there would be something else I would like to > know... about this kind of graphs (graphs of systems of equations). > 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? > Thank you! There is a system flag, number -119, which, when set, causes ABS(X) to behave like an absolute value but, when clear, treats 'ABS(X)' like plain X. For example, do -119 CF to clear the flag then 'ABS(X)' STEQ ERASE DRAW and you will see the absolute value function graphed, but now do ON -119 SF ERASE DRAW and the same function in 'EQ" now graphs as if it were an un-absoluted 'X'. The HP's have a whole bunch of tricks like that , which you only learn about through experience. |