#First order centered finite differences
9 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
are you not already there?
if you're storing the difference BETWEEN each sample, you're storing f(x + 1) - f(x)
looks like your array is an array of finite differences
Or you can possibly use calculus, but I’m not sure exactly the context of what you’re doing or what your program looks like
the data he's recording (distance / unit time) is exactly what he's asking for (speed) in the same paradigm (finite differences)
"centered finite differences" probably just means: take the average of the i-1 speed and the i+1 speed
(and speed is proportional to dl because of fixed timestep)
so something like speed[i] = 0.5 * ( dl[i-1] + dl[i+1] )
or with timestep dt speed[i] = 0.5 * (1/dt) * ( dl[i-1] + dl[i+1] )
I think it’s supposed to be this, the one thing confusing me is
speed[i] = 0.5 * (dl[i-1] + dl[i+1]) would result in speed having N-2 elements instead of the N-1 i was anticipating (there are N-1 segments of dl)