Borrar filtros
Borrar filtros

From Acceleration to Displacement Trapz Function

4 visualizaciones (últimos 30 días)
Ali el 23 de Mayo de 2014
Editada: Ali el 23 de Mayo de 2014
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.

Respuestas (2)

Mahdi el 23 de Mayo de 2014
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 comentarios
Ali el 23 de Mayo de 2014
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 el 23 de Mayo de 2014
Yeah, that's why I'm suggesting to use the cumtrapz function because it would give you velocities. Have a look at this link.

Iniciar sesión para comentar.

Ali el 23 de Mayo de 2014
Editada: Ali el 23 de Mayo de 2014
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;
for n=0:8;


Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by