[comp.sys.handhelds] HP48: User-defined derivative problems

RJW0180@TNTECH.BITNET (02/26/91)

> Hello world!
>
> We have some problems to define discrete Heaviside step function
> U(t) and it's derivative Unit impulse SIGMA(t) in the same
> directory, and after that use: 'dt(U(5*t))' EVAL.
>
> We have defined U(t) like: \<< \-> t 'IFTE(t\>=0,1,0)' \>>
>          and derU(t) like: \<< \-> t dt 'SIGMA(t)' \>>
>         and SIGMA(t) like: \<< \-> t 'IFTE(t==0,1,0)' \>>
>                       ...
 
Maybe you're talking about a different Unit impulse function, but the one
I'm familiar with (what my Signals book and Probability and Random Variables
book call delta(t)) is defined as a "function" having the following
properties...
 
delta(t) = 0, t<>0
and the integral of delta(t) with respect to t over all time equals 1.
 
delta(0) approaches infinity, not 1. The integral of it from 0- to 0+ (or a
y interval containing 0) does equal 1.
 
If you're talking about something else, sorry, but I just though I'd point
that out.
 
-Randy Weems
RJW0180@TNECH.BITNET

Dan_Ciarniello@cc.sfu.ca (02/27/91)

 > We have some problems to define discrete Heaviside step function
 > U(t) and it's derivative Unit impulse SIGMA(t) in the same
 > directory, and after that use: 'dt(U(5*t))' EVAL.
 
 > We have defined U(t) like: \<< \-> t 'IFTE(t\>=0,1,0)' \>>
 >          and derU(t) like: \<< \-> t dt 'SIGMA(t)' \>>
 >         and SIGMA(t) like: \<< \-> t 'IFTE(t==0,1,0)' \>>
 
 > Now, if we try to derivative 'U(a*5)' the HP48 will say
 > following:
 >            der Error
 >            Undefined Local Name
 >            4:
 >            3:
 >            2:         'U(a*5)'
 >            1:              'a'
 
 > Can someone help us solving this problem.
 
 When I tried this, I did not get an error when trying to differentiate
 U(a*5).  Instead, what I got was the following:
 
               'IFTE(a*5\>=0,\.da(1|(t=a*5)),\.da(0|(t=a*5)))'
 
 It would seem that if a user-defined function is differentiable using
 built-in functions, the user-defined derivative is not used.
 
 To get this to work, redefine U(t) as
 
                    \<< \-> t
                      \<< 'IFTE(t\>=0,1,0) EVAL \>>
                    \>>
 
 This is not differentiable according to the 48.  Differentiating this
 function without having derU(t) defined gives:
 
                    'derU(a*5,5)'
 
 If derU(t) and SIGMA(t) are defined one gets:
 
                    'IFTE(a*5==0,1,0)'
 
 which is, of course, SIGMA(a*5)
 
 Hope this helps,
 Dan.
 
?

ares@alessia.dei.unipd.it (Nicola Catacchio 259126) (03/05/91)

In article <2904833@cc.sfu.ca>, Dan_Ciarniello@cc.sfu.ca writes:

	During my Signal Theory courses, I had the same problem and I solved
it in this way: since you can't define a function whose value in 0 is +oo
and 0 for any other value, I considered the Delta function in sampled spaces;
it can be considered as a rect whose width is the sampling quantum, 
STOred in a variable (e.g. 't') and whose value the INVerse of t.
	It may be too simple, but when you need to sample a signal expressed
as an algebraic whith some Delta functions in it, simply STOre the width
of sampling interval divided by the number of samples in the 't' variable,
and evaluate the algebraic in every sampling point.
	Define the Heaviside function H(t) as :
'H'
<< -> x 'x>=0' >>
and its derivative as:  
der>=
<< -> x '(x>=0-x>=t)/t' >>

	You can obtain the name 'der>=' first,deriving the algebraic 'H(x)'
and then getting the name OBJ->ing the algebraic resulting.
	With such a definition I got not only the Delta(x) as the derivative
of H(x) but also all the further derivatives of Delta(x).


	Nicola Catacchio (ares@alessia.dei.unipd.it)