How to take the double integral of a data set with respect to time

Click For Summary

Discussion Overview

The discussion revolves around the methods for calculating the displacement of an object from its acceleration data over time, particularly focusing on numerical integration techniques and real-time computation challenges. The context includes applications in PID control loops and potential implementations on platforms like Arduino.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant inquires about obtaining displacement from acceleration data given at discrete time intervals, referencing specific integral formulations.
  • Another participant suggests exploring various numerical integration algorithms and mentions the use of scientific subroutine packages or Excel for implementation.
  • A question is raised about performing the integration on an Arduino in real-time, highlighting the differences between processing data from a file and real-time calculations.
  • One participant proposes keeping a running total of acceleration to compute velocity and then displacement, while noting potential issues with error accumulation leading to inaccurate displacement values.
  • Another participant emphasizes the need for a zero restoration algorithm to address the accumulation of errors in the computed values.
  • A later post questions the best mathematical representation of displacement when acceleration is approximately constant over a finite time interval, presenting two different formulations for consideration.

Areas of Agreement / Disagreement

Participants express varying opinions on the methods for numerical integration and the challenges associated with real-time computation. There is no consensus on the best approach to handle error accumulation or the optimal mathematical formulation for displacement under constant acceleration.

Contextual Notes

Participants discuss the limitations of their approaches, including the dependence on specific algorithms, the need for error correction mechanisms, and the challenges of integrating data in real-time versus from a file.

Leo Liu
Messages
353
Reaction score
156
Question: Suppose I have a data file for the acceleration of an object after every ##
\Delta t_i##, how do I obtain the displacement of it?

Context: Integral in a PID loop, although not exactly what I am asking as one is sum of error: $$\int_0^T \int_0^T \ddot {\vec \theta(t)}dtdt$$
the other is displacement:
$$\int_0^T \left(\dot{\vec \theta(0)}+ \int_0^T \ddot {\vec \theta(t)}dt\right)dt$$

PS I found http://mathforcollege.com/nm/mws/gen/07int/mws_gen_int_spe_trapdiscrete.pdf but it is for single integral over discrete data.
 
Technology news on Phys.org
There are a variety of numerical integration algorithms. If you have a particular scientific subroutine package, you should check whether it has an appropriate subroutine. If you are using Excel, this is a simple example
 
  • Like
Likes   Reactions: Leo Liu
FactChecker said:
There are a variety of numerical integration algorithms. If you have a particular scientific subroutine package, you should check whether it has an appropriate subroutine. If you are using Excel, this is a simple example
Can I do this on an Arduino? It needs to be computed real time.
 
Leo Liu said:
Can I do this on an Arduino? It needs to be computed real time.
That seems very different from integrating data in a file.
 
Leo Liu said:
Can I do this on an Arduino? It needs to be computed real time.
Yes.
Keep a running total of the acceleration, which is velocity.
Keep a running total of the velocity, which is displacement.

The problem you will have is that a zero error in the acceleration will accumulate until your displacement exceeds some sensible limit. There will need to be some zero restoration algorithm introduced. You have two unknown constants of integration at the start.
 
Baluncore said:
The problem you will have is that a zero error in the acceleration will accumulate until your displacement exceeds some sensible limit. There will need to be some zero restoration algorithm introduced.
Could you elaborate, please?
 
Errors accumulate with time.
A DC offset error in the acceleration will always bias and drive the velocity one way.
You will need to detect and cancel that error somehow, by knowing the actual displacement at a zero crossing or some ± reference or limit.
 
  • Like
Likes   Reactions: Leo Liu
One more question:
Suppose the acceleration ##\ddot x## is approximately constant during a finite ##
\Delta t##, is the displacement due to this contribution best described by ##\frac 1 2 \ddot x (\Delta t)^2## or ##(\ddot x \Delta t)\Delta t##?
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
1
Views
3K
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
7
Views
5K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 21 ·
Replies
21
Views
2K