Integration and derivation of series of discrete points

Hello, I have Accelaration and displacement data in terms of 1500 discrete points. I want to get velocity data in terms of discrete points from both. So How Do I integrate and differentiate the datas respectively to get velocity? I do not need accumulated velocity at the end..what I need is series of points of velocity.

 採用された回答

Andrew Newell
Andrew Newell 2011 年 4 月 27 日

0 投票

The answer depends on whether your points are regularly spaced. Let's suppose they are, at intervals dx. Note that if u is a vector of displacements at positions x, then
dudx = diff(u)/dx
gives you an estimate of the derivative at the midpoint of each interval (e.g., the first one is at (x(1)+x(2))/2). To get a good estimate of the derivative at the points x, you need a formula like
u = u(:)'; % to make sure u is a row vector
dudx = [2*(u(2)-u(1)) u(3:end)-u(1:end-2) 2*(u(end)-u(end-1))]/dx/2
(a central difference formula except at the end points).

1 件のコメント

Gauri
Gauri 2011 年 5 月 6 日
Thank you for the help!!!

サインインしてコメントする。

その他の回答 (1 件)

Arnaud Miege
Arnaud Miege 2011 年 4 月 27 日

0 投票

See for example diff and trapz. More options in the documentation under derivatives and integrals.
HTH,
Arnaud

1 件のコメント

Gauri
Gauri 2011 年 5 月 6 日
Thank you for the help!!!

サインインしてコメントする。

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by