Derivative of a List

  • Follow


Hello,
I created a two columns table from experimental data say v (t) and would
like to compute the derivatives. How do I proceed.
Thanks

0
Reply akpovo (3) 6/26/2003 9:49:56 AM

Hello !

You can use the numerical differentiation formulas :

v'(t)=(v(t+h)-v(t))/h + 0(h)

This is a good approximation if differnces of t's are small and irregular.

1)  If  the list of t is not regular :

liste = {{0., 2.}, {1., 2.5}, {2., 3.2}, {2.8, 3.6}};

numder[i_] := (liste[[i + 1,2]] - liste[[i,2]])/
   (liste[[i + 1,1]] - liste[[i,1]])


vprime = Join[Table[numder[i], {i, 1, Length[liste] - 1}],
   {numder[Length[liste] - 1]}];

TableForm[Transpose[Join[Transpose[liste], {vprime}]],
  TableHeadings -> {{}, {"t", "v(t)", "v'(t)"}}]

If the intervals of t are regular, it is better tu use :

v'(t)=(v(t+h)-v(t-h))/(2h)+ 0(h^2)

2)  If the list of t is regular :

In[7]:=
liste = {{0., 2.}, {1., 2.5}, {2., 3.2}, {3., 3.6}};

In[8]:=
betterNumder[i_] := (liste[[i + 1,2]] -
    liste[[i - 1,2]])/(liste[[i + 1,1]] -
    liste[[i - 1,1]])

In[9]:=
vprime = Join[{numder[1]}, Table[betterNumder[i],
     {i, 2, Length[liste] - 1}],
    {numder[Length[liste] - 1]}];

In[10]:=
TableForm[Transpose[Join[Transpose[liste], {vprime}]],
  TableHeadings -> {{}, {"t", "v(t)", "v'(t)"}}]

3)  If you have a lot of regular values, you can use the very good
Richardson formula :

v'(t)=(8*(v(t+h/2)-v(t-h/2))-v(t+h)+v(t-h))/(6h) + 0(h^4)

Greetings

F.Jaccard

-----Message d'origine-----
De : ch akpovo [mailto:akpovo@cennas.nhmfl.gov]
Envoy� : jeu., 26. juin 2003 11:36
� : mathgroup@smc.vnet.net
Objet :  Derivative of a List


Hello,
I created a two columns table from experimental data say v (t) and would
like to compute the derivatives. How do I proceed.
Thanks


0
Reply jaccardf (4) 6/27/2003 10:30:59 AM


ch akpovo wrote:

> Hello,
> I created a two columns table from experimental data say v (t) and would
> like to compute the derivatives. How do I proceed.
> Thanks
> 
Hi,

if t is in uniform intervals, you can also use a derivative
Savitzky-Golay Filter. This filter also performs a smoothing of the
data.

Hope that helps, 

        Peter

0
Reply pg.hahn (7) 7/1/2003 12:54:38 PM

2 Replies
32 Views

(page loaded in 0.076 seconds)


Reply: