Numerical integration of discrete data

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 9K views
hermano
Messages
38
Reaction score
0
Hi,

I'm searching for days for a numerical integration methode for discrete data given at non-equidistant nodes. The simple Simpson rule can only be used for equidistant nodes so I'm looking for methode which I can solve my problem. Any suggestion is welcome!

Thanks in advance!
 
Physics news on Phys.org
As far as i know, for discrete data, i can probably utilize the Lagrange's Interpolation or Newton's Interpolation to generate a continuous function. Then, the next step, i think i can calculate the integral using simple Simpson rule or other methods for numerical calculation.
Maybe the INTERPOLATION can be helpful for you!
 
hermano said:
Hi,

I'm searching for days for a numerical integration methode for discrete data given at non-equidistant nodes. The simple Simpson rule can only be used for equidistant nodes so I'm looking for methode which I can solve my problem. Any suggestion is welcome!

Thanks in advance!

Do all of the have points have "random" spacing or are the spacings mostly the same with just a few uneven spaced ones?

In any case the trapezoidal rule would be trivial to adapt to uneven spacing, if that was sufficiently accurate.

I think I could adapt simpsons rule to uneven spacing if I put my mind to it (which usually means someone has already done it), but it wouldn't be a trivial problem like with the trapezoidal rule.
 
hermano:

The attached file derives the general coefficients for Simpson's First Rule. This is the usual 1-4-1 rule when the ordinates are equally spaced. The derivation contained in the attachment assumes that one is trying to integrate the curve passing thru the points (x0, y0), (x1, y1), and (x2, y2). The integral is evaluated thus: A = k0 * y0 + k1 * y1 + k2 * y2
The coefficients k0, k1, and k2 for unevenly spaced ordinates are given on p.32 of the attachment.
 

Attachments