MATLAB Answers

0

Integrate acceleration to velocity and displacement

Asked by tupac1971ful on 25 Mar 2016
Latest activity Answered by Sumangali Sivakumaran on 25 Apr 2019 at 22:18
I have taken 5000 measurements for acceleration with its acceleration's respective time. I created 2 vectors: for my acceleration measurements named "acceleration" and for time named "time". Which commands should i use exactly to intergate? I tried : velocity=cumtrapz(acceleration,time) & displacement=cumtrapz(velocity,time) and then to do the diagrams plot(time,velocity) & plot(time,displacement). Is that correct, or should i try another commands?

  0 Comments

Sign in to comment.

3 Answers

Answer by John D'Errico
on 25 Mar 2016
Edited by John D'Errico
on 25 Mar 2016

It looks close to good to me. Why do YOU think there is a problem?
Hint: Read the help for the tools you will use. In this case, cumtrapz.
When there are two arguments to cumtrapz, they should be in the order cumtrapz(x,y). Again, from the help, it shows this:
Z = cumtrapz(Y)
Z = cumtrapz(X,Y)
With only one argument, so an implicit X step of 1, you just pass in Y. With two arguments, i.e., acceleration and time, they must go in the proper order.
So, if you will integrate acceleration over time,
velocity = cumtrapz(time,acceleration);
Similarly, the second integral must have its arguments in the proper order.
READ THE HELP.

  1 Comment

As you can see from the above diagrams i tried to "velocity=cumtrapz(time,acceleration)" and it didn't seem correct to me. I inverted it to "velocity=cumtrapz(acceleration,time)" and the diagram seems correct now. Similarly, that's what i did for position and i had the above reasult. But my concern is this : what unit of measures do my Y Axis have to velocity and position? On the diagram [(2,1) ~> acceleration-time] my units are m/s^2 - sec, but on velocity my Y axe has some prices that reach even 200 and it's impossible to be 200 m/s. what could that really be?

Sign in to comment.


Answer by Dr. Seis
on 10 Apr 2016

  1 Comment

Can you explain how your code converts between the different units? Example: Acceleration to Displacement.

Sign in to comment.


Answer by Sumangali Sivakumaran on 25 Apr 2019 at 22:18

Though velocity = cumtrapz(acceleration,time); give some answers, velocity = cumtrapz(time,acceleration); is the correct way of doing.

  0 Comments

Sign in to comment.