Rectangular vs Trapezoidal integration
ali8
Attached is a simple experiment, with a spectral wave (specifically, the "second spectrum"), and a frequency wave.
I am trying to integrate the spectrum over a specified range of values. For now, consider it to be the whole range. The rectangular integration
assumes a uniform dx, while the trapezoidal one takes the x wave as well as y wave. In this case, I assume (since my freq is not uniformly spaced) that
only the trapezoidal integration will be accurate. Is this correct? I have a feeling that neither is accurate...
https://www.khanacademy.org/math/integral-calculus/indefinite-definite-…
http://demonstrations.wolfram.com/NumericalIntegrationUsingRectanglesTh…
http://math.stackexchange.com/questions/603830/why-does-trapezoidal-rul…
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
August 7, 2014 at 04:18 am - Permalink
Your X values appear to be uniformly spaced with deltaX=0.00195. You can get around the problem with the X wave by using wave scaling to set the X values. When you do that, Igor can calculate any X values it needs.
In most cases trapezoidal integration gives a result more nearly like what you would get by a true integration, assuming an underlying smooth function. That's because the lines that connect one Y value with the next will usually be a better approximation of a smooth function than a box. But note that I say "smooth".
And yes, either one is just a numerical approximation if the data represent some underlying function that can be evaluated at all values of X. Your data appears to be quite noisy. I would guess that the noise will cause greater inaccuracy than the numerical integration.
I highly recommend learning more about numerical integration. It seems that JJWeimer's reading list would be an excellent start.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
August 7, 2014 at 01:02 pm - Permalink