Trapezoidal Integral of Discrete Values

In summary, the speaker is trying to create a device that integrates accelerometer values at a rate of 25 samples per second. They have read a research paper on using trapezoidal integration for this task, but are unsure about how to apply the equation. They are concerned about the use of y(n-1) and x(n) and whether they should work out the integration together. They also ask if the equation they wrote makes sense and apologize for any typos.
  • #1
trustnoone
17
0
Hi guys, so I'm trying to create this thing that gets accelerometer values and integrate those values at about 25 samples a second. From what I understand if I integrate the values, that means each second I have 25 values I want to integrate. I read this research paper where someone used the trapezoidal integration to do it but I've been trying to read up on it and I guess I'm having some problems. Firstly can I use the trapezoidal integration to do it?

Secondly this is the equation they used:
y(n) = y(n-1) + (1/(2fs))*(x(x-1)+x(n)) , where n>0

so I guess fs is my sampling frequency which would be 25 and x is my integrand. I would assume n is my value so 1 or 2 or 3rd sample but I'm worried about y(n-1) and the x(n) part since the start of the equation is y(n).

Basically if say my values were
Fs=25
n=1
x= 32

then is it right to say
y(n) = y(1-1) + (1/(2*25))*(32(32-1)+32(1))
or is the y(n-1) similar to the y(n) part and I have to sort of work out the integration together?

Also with my second sample do I just add it to my first? Apologies about this, my maths isn't the best.
Lastly is the equation I wrote make sense? I tried looking up similar trapezoidal equations and the look similar to me.
 
Physics news on Phys.org
  • #2
You should describe what you are trying to calculate. Also your description has several typos, which should be fixed for clarity.
 

1. What is a trapezoidal integral of discrete values?

A trapezoidal integral of discrete values is a method of approximating the area under a curve using trapezoids. It is commonly used in numerical analysis to estimate the value of a definite integral when the function is not easily integrated analytically.

2. How is a trapezoidal integral of discrete values calculated?

To calculate a trapezoidal integral of discrete values, the curve is divided into small trapezoids with equal base widths. The area of each trapezoid is then calculated using the formula (1/2) x (base1 + base2) x height. The sum of all the trapezoid areas is then the approximation of the integral.

3. What are the advantages of using a trapezoidal integral of discrete values?

One advantage of using a trapezoidal integral of discrete values is its simplicity and efficiency. It is relatively easy to implement and can provide a good approximation of the integral in a short amount of time. Additionally, it can be used for any continuous function, regardless of its complexity.

4. What are the limitations of a trapezoidal integral of discrete values?

A trapezoidal integral of discrete values may not provide an accurate approximation for functions with sharp turns or steep slopes. It can also be affected by the choice of the number of trapezoids used, as using too few trapezoids can result in a larger error. Furthermore, it is only an approximation and not an exact value of the integral.

5. How does a trapezoidal integral of discrete values compare to other numerical integration methods?

Compared to other numerical integration methods, such as Simpson's rule or Gaussian quadrature, a trapezoidal integral of discrete values is less accurate but simpler to implement. It is also less computationally intensive, making it a good choice for quick estimations. However, for more precise calculations, other methods may be preferred.

Similar threads

Replies
2
Views
1K
Replies
8
Views
1K
Replies
31
Views
914
Replies
2
Views
279
Replies
3
Views
1K
Replies
1
Views
1K
Replies
1
Views
926
Replies
20
Views
2K
Replies
3
Views
320
Back
Top