필터 지우기
필터 지우기

Getting velocity from acceleration using cumsum

조회 수: 50 (최근 30일)
Sam Thorpe
Sam Thorpe 2019년 3월 12일
댓글: Adam Danz 2019년 7월 8일
Hi, I have been given a set of data which includes acceleration, velocity and time from an experiment. We have been asked to process the data in a specific manner so we can calculate the transmission loss based on some gicen equations. I am not sure how to go around starting this section. I know how to load the data but am unsure what is asking when we have to convert the acceleration into velocity. I have the following eqations given:
a=acceleration
v=velocity
t=time
v(t) =integral of acceleration with respect to time (int (a) dt) with the limits between 0 and t
and v(t)=cumsum(a)* change in t
Does anyone have any ideas on how the cumsum function changes the integration?
Thanks

답변 (2개)

Matt J
Matt J 2019년 3월 12일
cumsum(a)*dt
is a discrete approximation to the integral of a from 0 to dt*length(a).

Adam Danz
Adam Danz 2019년 3월 12일
편집: Adam Danz 2019년 3월 12일
Units of acceleration are typically m/s^2 (meters per second squared). Time is typically in seconds. So when you multiply (m/s^2) by (s) the results is (m/s) or, meters per second (which are the units for velocity). Multipying acceleration by the change in time gives you the change in velocity. Here's an example.
If a car is accelerating at 10 m/s^2 for 5 seconds, then 10 m/s^2 * 5 s = 50 m/s. So, there is a 50 m/s increase in velocity. But you still don't know the absolute speed of the car because you don't know it's starting speed. If the starting speed was 2 m/s then 2 + 50 = 52 m/s absolute speed.
Now let's say you have vectors of data where each element of the vector was recorded at different time points.
acceleration = [0 1 1 2 2 2 5 5 5 2 2 1 1 0]; %m/s^2
dt = 0.2; % change in time (seconds)
The instantaneous change in velocity would be
dtVel = acceleration .* dt;
And the absolute velocity would be (assumes velocity starts at 0m/s at time 0)
vel = cumsum([dtVel]); %m/s
View the data
time = dt * (0:length(acceleration)-1);
figure; plot(time, acceleration, 'b-', time, vel, 'r-')
legend('Accel.', 'Vel.')
xlabel('time (s)')
  댓글 수: 2
Samaneh Arzpeima
Samaneh Arzpeima 2019년 7월 8일
thanx for the easy-to-follow explanation.I had a similular issue
can you please tell me why in
Calculate Velocity and Position
edot = (1/200)*cumsum(dataOfInterest.EastWest);
edot = edot - mean(edot);
he subtracted the mean(edot) from edot??
(1/200) is the dt in your explanation and "dataOfInterest.EastWest" the acceleration.
Thank you
Adam Danz
Adam Danz 2019년 7월 8일
It appears that the velocities are normalized to have a mean of 0 (or very close to zero).

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by