MATLAB Answers

double integration of acceleration data with offset

9 ビュー (過去 30 日間)
Mat CR
Mat CR 2019 年 11 月 19 日
Commented: Rena Berman 2019 年 12 月 12 日
hello there
i want to use the accerleration with offset added to it and then double intgrate using cumtrapz to obtain velocity and position, but when i plot my offset position it doesnt look anywhere near my real position even tho it has only 0.1 offset from integrating acceleration.
here is the code i used
a=0.5 % amplitude
f=5 % frequency
v0 = a*(2*pi/f)*cos(2*pi/f*t(1)); % initial velocity
p0 = a*sin((2*pi)/f*t(1)); % initial position
acc= -4*a.*pi^2./f.^2 .* sin(2*pi./f .* t); % accleration data
figure (1)
xlabel('Time (s)')
vel=cumtrapz(t,acc)+v0; % integrated velocity
pos=cumtrapz(t,vel)+p0 % intgrated positon
plot(t,pos,'r-') % plot the position
xlabel('Time (s)')
title('offset position')
% what my real position look like real position
pos=a*sin((2*pi)/f*t) % intial position
plot(t,pos,'b-'); % plot for position
title(' real positon')
i want to be able to add offset to acceleration, and when i double intgrate to get a position with offset, somewhat obtain a plot similar to my real position even tho it has 0.1 offset.
any help would be massivley appreaciated

  1 件のコメント

Rena Berman
Rena Berman 2019 年 12 月 12 日
(Answers Dev) Restored edit

サインイン to comment.


James Tursa
James Tursa 2019 年 11 月 19 日
編集済み: James Tursa 2019 年 11 月 19 日
You put a constant offset into the acceleration, not the position. The result of double integrating a constant is going to be a (1/2)(constant offset)*t.^2 offset in position. I.e., growing position difference with time, not a constant offset position.

  0 件のコメント

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。

Translated by