Runge-Kutta4TH Order Acceleration to Displacement.
6 views (last 30 days)
Show older comments
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
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
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.
Accepted Answer
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
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.
More Answers (0)
See Also
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!