Re: how to differentiate a list?
- To: mathgroup at smc.vnet.net
- Subject: [mg25947] Re: how to differentiate a list?
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 14 Nov 2000 03:46:42 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <8ug96o$id9@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
diff=Drop[sd - RotateLeft[sd],-1]
?
If you know that ds is periodic, than you should
not remove the last element.
Regards
Jens
Rob wrote:
>
> I needed to get the derivative of a time varying pulse to do some
> numerical
> operations. As seen below, the only way I could figure how to do it
> was to generate two lists, shifted by one sample and then subtract them:
>
> ***************
> del = 0.002; a = 12\[Pi]; b = \[Pi];
> ( s[t] is a function of t defining the pulse )
>
> sd = Table[N[s[t]], {t, 0, 1, del}];
> sd1 = Table[N[s[t]], {t, del, 1 + del, del}];
> diff = sd - sd1;
> ****************
>
> I looked all over and I didn't find a list operation available to do
> this. I bet
> you Mathematica gurus know how to do this. If so, could you enlighten me?
>
> Thanks, Rob