Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!agate!shelby!msi.umn.edu!noc.MR.NET!gacvx2.gac.edu!hhdist From: Dan_Ciarniello@cc.sfu.ca Newsgroups: comp.sys.handhelds Subject: RE: HP48: User-defined derivative problems Message-ID: <2904833@cc.sfu.ca> Date: 26 Feb 91 23:32:38 GMT Lines: 48 Return-path: To: handhelds@gac.edu > 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. ?