From Acceleration to Displacement Trapz Function

6 ビュー (過去 30 日間)
Ali
Ali 2014 年 5 月 23 日
編集済み: Ali 2014 年 5 月 23 日
Hello,
I have the acceleration values as a vector and I need to integrate it to get velocity and displacement via Trapz function. trapz(acc) gives a value for V but how can i reach to the displacement value? Is there any way to integrate 2 times ? When i integrate V value it naturally gives me zero.
Thank you.

回答 (2 件)

Mahdi
Mahdi 2014 年 5 月 23 日
Consider using the cumtrapz function to find the displacement.
% Defined Acceleration values as Accel, Time is the steps of time
velocity=cumtrapz(Time, Acceleration)
Displacement=cumtrapz(Time, Velocity)
Or you can use the combination of cumtrapz and trapz to fit which solution you want.
  2 件のコメント
Ali
Ali 2014 年 5 月 23 日
Thank you for answering !
I have my values tabulated but i dont have the exact function. They are just random values. First integration with trapz (V=trapz(time,acc)) gives me one single value as result. So it's a constant one value. When I integrate it for the second time (disp=trapz(V)) It results zero.
Mahdi
Mahdi 2014 年 5 月 23 日
Yeah, that's why I'm suggesting to use the cumtrapz function because it would give you velocities. Have a look at this link.

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


Ali
Ali 2014 年 5 月 23 日
編集済み: Ali 2014 年 5 月 23 日
I did something hope it makes sense.
I have 485 values for each planes.(x,y,z) That one i wrote just for X values.
I seperated the values into 10 values group and got the trapz value for each interval of 10.
I ignored some of the values.(Like i have 485 but worked on 481 values)
Then I got 48 different Vx values.
Same process for the Ux(displacement) values.
This time each interval includes 5 values.
I hope its right.
for t=0:47;
accx=data((10*t+1):(10*t+11),1);
time=(t+1):(11+t);
Vx(t+1)=trapz(time,accx);
end
plot(Vx,'*');
for n=0:8;
Vxx=Vx(1,((5*n+1):(5*n+6)));
time2=(n+1):(6+n);
Ux(n+1)=trapz(time2,Vxx);
end
plot(Ux,'o');

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by