[comp.sys.handhelds] 48 graphing question

wpmadden@madden.enet.dec.com (02/28/91)

--
 Here's the question; I have written a short program catered to circuits 
that speeds up graphing a function, that assumes t as the independent 
variable, asks for intitial time and final time, and autoscales f(t).
I would like to be able to enter transient functions without having to enter
a boolean expression in << >> at the equation prompt. When I tried to do
this the program kept wanting to evaluate. Is there a way around this, or
better yet, a method of graphing two functions, one t<0 and the other t>0
at the same time?
Thanks, Bill
--
Wm P. Madden, Jr.
North Carolina State University - Raleigh, N.C.
INTERNET: wpmadden@eos.ncsu.edu	         Ma AT@T: (919) 781-6390

edp@deland.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) (02/28/91)

In article <1991Feb27.135704@madden.enet.dec.com>, wpmadden@madden.enet.dec.com
writes:

>I would like to be able to enter transient functions without having to enter
>a boolean expression in << >> at the equation prompt. When I tried to do
>this the program kept wanting to evaluate. Is there a way around this, or
>better yet, a method of graphing two functions, one t<0 and the other t>0
>at the same time?

I'm sorry, but this isn't clear.  What "equation prompt" are you referring to? 
Is this one of the calculator's prompts or a prompt from your program?

About graphic two functions, do you want one function to be used in the region
t<0 and another in t>0, or are you asking for a way to plot two functions in the
same area with different values of the independent variable?

The former can be done with 'IFTE(t<0,f(t),g(t))'.  The latter can be done with
'f(shift(t))=g(t)', where 'shift(t)' is something like '-t' or 't-d', depending
on whether you want to reflect f onto the positive area or shift it by a
distance of d onto the positive area.  Actually, if you use the latter, you
could use this hack:  Put \<< PPAR 1 GET C\->R DROP PPAR 2 GET C\->R DROP - 131
/ 132 * \>> in 'd'  That will cause d to automatically assume the value of the
width of your plotting area, so 'f(t-d)' will automatically plot f over the
range one screen to the left of the plot screen, but it will appear on the plot
screen.


				-- edp (Eric Postpischil)
				"Always mount a scratch monkey."
				edp@jareth.enet.dec.com

rrd@hpfcso.FC.HP.COM (Ray Depew) (03/01/91)

 >Here's the question; I have written a short program catered to circuits 
>that speeds up graphing a function, that assumes t as the independent 
>variable, asks for intitial time and final time, and autoscales f(t).
>I would like to be able to enter transient functions without having to enter
>a boolean expression in << >> at the equation prompt. When I tried to do
>this the program kept wanting to evaluate. Is there a way around this, or
>better yet, a method of graphing two functions, one t<0 and the other t>0
>at the same time?
>Thanks, Bill
>--
>Wm P. Madden, Jr.
>North Carolina State University - Raleigh, N.C.
>INTERNET: wpmadden@eos.ncsu.edu	         Ma AT@T: (919) 781-6390
>----------

Hi Bill,

Since you haven't offered much detail, I'm afraid I can't either, but it looks
like the function IFTE is just what you're looking for.  For example, the 
equation

     'IFTE(X>10,0,1)'

will model a step function at x=10.  With some more work, you can use IFTE
to do transient functions.  Bear in mind that IFTE can be nested, that is,

     'IFTE(test1,0,IFTE(test2,10,(IFTE(test3,f1,f2)'

is perfectly valid.


Regards
Ray Depew
HP ICBD -- IC's By Decree
rrd@hpfitst1.hp.com

rbagley@uceng.UC.EDU (Ross A. Bagley) (03/02/91)

There is a simple way to graph two or more equations in th plot function.
First each equation that you wish to plot simultaneously must be entered 
into the plot catalog and given a unique name.  Get back to the stack, and
then make a list of the names of the equations that you wish to plot.  Get 
the plot menu, and enter this as NEW and name it.  Then just go ahead and 
do the plot as you would any other plot.

ex.
		(catalog)
		SINEWAVE: 'SIN(T)'
		SQUFUNC: 'T^2+6T'

		(stack)
		1:	{ SINEWAVE SQUFUNC }

		And run!!!!!!

This is in the manual and another method (using the catalog) is discussed 
there.  I have always found it faster to create the function list from the 
variable menu though.

rbagley@uceng.uc.edu

---Ross A. Bagley---

I'd sign it, but my pen seems to be stuck!

akcs.ed@hpcvbbs.UUCP (Edwin S. Linderman) (04/12/91)

With the close paranthesis, making it:

'ITFE(test1,0,ITFE(test2,10,(ITFE(test3,f1,f2))))'

sorry, but I'm tired.