[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## RE: diff(x) question

**From**: |
Van den Eynde Gert |

**Subject**: |
RE: diff(x) question |

**Date**: |
Tue, 19 Jan 1999 10:39:51 +0100 |

>* Diff computes forward differences. Not the derivative. If you want to *
>* approximate the derivative by using forward differences you have to *
>* divide by the step h with which you make your function discrete.*
>* In this case h = .1*
>* *
>* *
>* df f(t+h) - f(t)*
>* -- (t) =~ --------------- + O(h)*
>* dt h*
>* *
just want to update my previous answer.
I suggest to use a symmetrical formula
(f(t+h) - f(t-h))/(2h)
this gives an error of O(h^2) AND you can use Richardson extrapolation
(extrapolation to the limit). IMHO, this is a good way to compute a
numerical derivative.
Gert Van den Eynde
'''''
(-o-o-)
_________________________.oooO--(_)--Oooo._________________________
| Gert Van den Eynde mailto:address@hidden |
| SCK-CEN http://www.sckcen.be/people/gvdeynde |
| FLINS |
| Boeretang 200 |
| B-2400 Mol .oooO |
| Belgium ( ) Oooo. |
|___________________________\ (____( )____________________________|
\_) ) /
(_/