Numerically integrating acceleration properly

5 次查看(过去 30 天)
I'm doing some vibration analysis and I have some acceleration data that I'd like to convert to position. Using cumtrapz doesn't actually give me the correct velocity and position signal - they are shifted up. Take the following code for example:
x=0:.01:2*pi;
y1=sin(2*x);
y2=cumtrapz(x,y1);
y3=-cos(2*x)/2;
plot(x, [y1; y2; y3])
I know y3 is the true velocity signal but the cumtrapz is giving me a shifted up signal. It is in fact the sum but is not in fact physically correct. I can simply correct for by subtracting the max. But this wouldn't be true for more varying signals. like the following:
x=0:.01:2*pi;
y1=sin(2*x^2);
y2=cumtrapz(x,y1);
plot(x, [y1; y2-max(y2)])
you'll see with that plot the the velocity is mostly positive which means the position will diverge. This is not physically possible with this system. So obviously this correction is different for every signal. So how do i properly correct for this?

回答(1 个)

Star Strider
Star Strider 2016-7-28
Your maths may be a bit off. Try this:
x=0:.01:2*pi;
y1=sin(2*x);
y2=cumtrapz(x,y1);
y3=cumtrapz(x,y2);
plot(x,y1, x,y2, x,y3)
because:
syms x
y1 = sin(2*x)
y2 = int(y1,x)
y3 = int(y2,x)
y1 =
sin(2*x)
y2 =
sin(x)^2
y3 =
x/2 - sin(2*x)/4
I believe that’s what you want to do.
  2 个评论
STEPHEN BARRETT
STEPHEN BARRETT 2016-7-29
This has the same problem. the first integrated function, the velocity is always positive in what you gave. which means the position will go off to infinity. If this were a mass spring oscillator, which it is a model for. Then the position, the red signal, will going off to infinity. this is not possible in this case here.
Star Strider
Star Strider 2016-7-29
A spring-mass-damper system is described by a second-order differential equation, so when it is reduced to two first-order differential equations, the outputs will be only position and velocity. There is no acceleration term. It would be necessary to differentiate the velocity to get acceleration.
I would go back and check your instrumentation. (I don’t know what you’re doing, so I can’t.) Are you certain you are recording acceleration rather than velocity or position? Even if you’re using an accelerometer as your sensor, your instrumentation may be integrating it to velocity or position.
That’s the only thing I can think of. The maths here are correct.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Acoustics, Noise and Vibration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by