I am doing a investigation into the Wilberforce Pendulum and in order to find the position and rotation at any time I have attached my phone onto the pendulum in order to use Phyphox, a app that finds the acceleration and angular velocity. However, when I put the data into excel and use forward Euler to find the velocity from the acceleration, and the position from the velocity. However, this doesn't really work, and the velocity seems to drift downwards a bit, and then the position seems to drift down much, much more. I also took a video of the pendulum, and I compared this to the results to show that it isn't experimental error.


Do any of you know how to get the position data from acceleration, without this error?

  • $\begingroup$ Well forward Euler is known to be numerically unstable. Have you tried semi-implicit Euler, leapfrog, or RK4 yet? $\endgroup$ Sep 9 at 3:06
  • $\begingroup$ @NiharKarve Hey, how would I apply RK4 to numerical data? $\endgroup$
    – OblivioN
    Sep 9 at 3:32
  • $\begingroup$ Ah, I don't think you'll be able to in this scenario, my bad. The other two will almost certainly work better than forward Euler though, and maybe take a look at other second-order solvers on Wikipedia. $\endgroup$ Sep 9 at 3:39
  • $\begingroup$ Wow, I did the exact same thing. $\endgroup$
    – JAlex
    Sep 9 at 12:47

Since you already have the data you just need a numeric integrator which inherently smooths the data. But if you use a forward Euler, then you are biasing the smoothing (averaging) to previous values causing a bias in the results.

I have been down the road you are going through and here are my suggestions

  1. Use the gyroscopes to measure rotational velocity.
  2. Use trapezoidal integration to calculate angles. In general, use an integration technique that considers forwards data equally with backwards data in order to avoid bias.
  3. Numerically adjust the data by applying a DC offset, or a slope to hit a target value at the end of the test. This corrects for the numeric drift you see.

If you want more accurate integration of data, I suggest to use a cubic spline interpolation to do so.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.