# Integrate acceleration to velocity and displacement

조회 수: 436 (최근 30일)
tupac1971ful 2016년 3월 25일
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?

댓글을 달려면 로그인하십시오.

### 답변 (4개)

John D'Errico 2016년 3월 25일
편집: John D'Errico 2016년 3월 25일
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.
##### 댓글 수: 3이전 댓글 1개 표시이전 댓글 1개 숨기기
Maaz Nayeem 2020년 2월 3일
check the graphs with seismo signal software.
Sebastián Santibáñez Brito 2023년 4월 4일
hey, I think it's too late, but the correct order is (time, acceleration) (you can check the cumtrapz documentation). I asked a friend of mine, and it's normal that the speed doesn't look right. You can use detrend to kinda fix it.

댓글을 달려면 로그인하십시오.

Dr. Seis 2016년 4월 10일
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Luke Laurence 2018년 2월 6일
Can you explain how your code converts between the different units? Example: Acceleration to Displacement.

댓글을 달려면 로그인하십시오.

Sumangali Sivakumaran 2019년 4월 25일
Though velocity = cumtrapz(acceleration,time); give some answers, velocity = cumtrapz(time,acceleration); is the correct way of doing.
##### 댓글 수: 0이전 댓글 -2개 표시이전 댓글 -2개 숨기기

댓글을 달려면 로그인하십시오.

Prasanth Reddy 2022년 6월 13일
t=0:0.05:947*0.05;
ax = data(:,1) ;
vx=cumtrapz(t,ax);
dx=cumtrapz(t,vx);
subplot(1,3,1);
plot(t,ax);
subplot(1,3,2);
plot(t,vx);
subplot(1,3,3);
plot(t,dx);
this code is not working properly and i cant figure out why

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by