Runge-Kutta4TH Order Acceleration to Displacement.

6 views (last 30 days)
Hello everyone, I'm trying to do a simulation. I have the accelerometer data which are recorded in a given period of time (0.05s), now regardless of the background noise and filters that should be applied. I want to know if anyone can help in the double integration process or by the acceleration of the displacement. I have read various numerical integration techniques, I tried Euler, and now I would try Runge-Kutta, I read that matlab has the ODE suite, and thought you might come to my assistance, there is indeed a way to apply RK4 to my of accelerometer data carrier for get displacement?
Sorry for the question but I am not an expert in these things, and I'm trying to understand as much as possible. I hope someone can help me.
  2 Comments
Walter Roberson
Walter Roberson on 5 Apr 2017
sbareben comments,
i want to delete my account but i don't know how to do it and delete the question
Walter Roberson
Walter Roberson on 5 Apr 2017
sbareben: you need to contact Mathworks Support to delete your account.
However, the policy is that questions that have received reasonable replies are not deleted unless there is some compelling reason to do so.

Sign in to comment.

Accepted Answer

Jan
Jan on 22 Mar 2017
If you have recorded accelerations, cumtrapz is the best method for integration.
Matlab's ode45 would be appropriate, if the accelerations are obtained by a "simulation", this means that they are calculated by a formula. Then the step-size control allows to calculate the trajectory efficiently. But if you have the derivatives with fixed time-steps already, the "approximation of the cumulative integral of Y via the trapezoidal method with unit spacing" is the accurate solution.
  2 Comments
sbareben
sbareben on 22 Mar 2017
Thanks for the reply, I have already tried to use cumtrapz, but what I do think is not enough.
I try to explain myself better.
I have a sensor that is positioned and fixed vertically on a vehicle and records data relating to (acceleration (XYZ), Orientation (Azimuth, Roll, Pitch), Time).
Now I'm particularly interested in vertical displacement , then I have to work vertical acceleration and what I expect from the vertical displacement (amplitude) is a similar trend in the same vertical acceleration, or a wavefront trend.
Now to get what I know that first I have to perform various operations to remove the background noise, so remove the gravity from the original data, and re-orient the entire second matrices of rotation and orientation data collected (that at the moment do not know how to do), and certainly apply some filter to reduce background noise (and in this regard I saw that matlab already provides some functions, and I have to figure out which one to use), so the question I neglected the section on filters because even I do not know what and how to use.
I'm informing on what integration schema to use, so I asked about Runge-Kutta, and perceived that the ODE suite does not allow me to be able to do this double integration, I asked to know if there were other functions or i have to create it, provided it is the right approach to use.
Jan
Jan on 22 Mar 2017
Which "double integration"? You convert the 2nd order equation to a system of 1st order equations at first. Then standard integrators can handle this without problems.
If the acceleration and in consequence the velocity is given already in distinct time steps, the statement "cumtrapz is not enough" is not correct. This is simply the job of cumtrapz and this integration scheme has the highest possible accuracy - except if you have further knowledge about the development of the acceleration between the time steps, e.g. that it follows a certain polynomial.
It does not matter how you have obtained the data. For Matlab the data could have been produced by this also:
signal = rand(1, 100);
If you now want to integrate this, the functions of the ode-suite are not the best choice and not even a valid choice, because they require a function, which is continously differentiable, while you have a vector of distinct data.
While I do not see where a "double integration" comes into play, this detail matters: Runge-Kutta integrators (as ODE45, but this concerns ODE15s etc. also) are designed to integrate smooth functions, but not for data vectors. For the latter case use cumtrapz.

Sign in to comment.

More Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!