# How to calculate the displacement from the measured acceleration data?

I have an acceleration data which is collected from a vehicle. I do also have a displacement measurement.

I would like to calcuate the displacement vector from the measured acceleration data, but no success yet.

Here is the data (the previous link was not working I updated the link): https://ufile.io/zyw3r

What I try:

filename = ('acc_time.csv');

% compose a command to assign each column to a variable with the same
commandExec = [myheader{i}, ' = ', 'mydata(:,', num2str(i) , ');'];
% execute the composed command to actually create the variable
evalin('base', commandExec );
end

vel_vector = cumtrapz(time,acc);
disp_vector= cumtrapz(time,vel_vector);
plot(time, disp_vector)


and I get:

but the displacement vector should be squiggy not like linear incremental.

Where am I wrong?

• Doesn't look linear to me. Looks like a quadratic function to me. Squiggliness is very likely lost (correctly so) due to the low-pass behaviour of integration. – Marcus Müller Dec 14 '17 at 9:31
• @MarcusMüller you are right it is more like a quadratic behaviour. But It should look like as the acceleration signal. How should I integrate over acceleration signal? – Yirmidokuz Dec 14 '17 at 10:00
• No, it should not. That's what I'm saying. – Marcus Müller Dec 14 '17 at 10:06
• @MarcusMüller but I do also have displacement data of the same acceleration signal, and the displacement data I calculate via matlab and the measured displacement data are not the same. – Yirmidokuz Dec 14 '17 at 11:16
• @StanleyPawlukiewicz my velocity is a derivation with cumptraz. So it should not be taken into consideration. Only measured data is acceleration, I need to calculate the displacement from it, which should look like the acceleration data, should not have a linear trend. – Yirmidokuz Dec 15 '17 at 15:59