Filter löschen
Filter löschen

Getting velocity from acceleration using cumsum

43 Ansichten (letzte 30 Tage)
Sam Thorpe
Sam Thorpe am 12 Mär. 2019
Kommentiert: Adam Danz am 8 Jul. 2019
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

Antworten (2)

Matt J
Matt J am 12 Mär. 2019
cumsum(a)*dt
is a discrete approximation to the integral of a from 0 to dt*length(a).

Adam Danz
Adam Danz am 12 Mär. 2019
Bearbeitet: Adam Danz am 12 Mär. 2019
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 Kommentare
Samaneh Arzpeima
Samaneh Arzpeima am 8 Jul. 2019
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 am 8 Jul. 2019
It appears that the velocities are normalized to have a mean of 0 (or very close to zero).

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by