The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: precise numerical integration
Replies: 6   Last Post: Jun 3, 2010 11:25 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roger Stafford

Posts: 5,929
Registered: 12/7/04
Re: precise numerical integration
Posted: Jun 3, 2010 9:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Marcio Barbalho" <> wrote in message <hu9gb8$dvg$>...
> Hello dear friends...
> I would to know if you know any other numerical integration method besides 'trapz' given x an y vectors:
> Area = trapz(x,y)
> my data are kind of randomic and I have obtained areas that are not so precise, numbers are not matching...So I was wondering if you could give some help on increasing the performance of matlab's numerical integrators.
> Many thanks

It all depends on what you mean by "randomic". As Urs says, there is no magic wand to make good data out of bad. If your data is bad because it is noisy, then trapz results are about as good as you are going to get.

On the other hand if your data is comparatively free of noise and is accurately obtained from a function which is smoothly varying, meaning that it's higher derivatives are not excessively large, then there is hope for better accuracy from higher order integration methods.

There are a number of these in the file exchange, including one I wrote which does cubic type approximation, but they all require that the discrete data be derived from smooth functions. Mine approximates the integral over each interval using the two endpoints of the interval and two other points at the ends of the two adjacent intervals. It computes the integral a cubic polynomial would have over the central interval if it runs through all four points. However the size of the inevitable error it makes depends on how large the underlying function's fourth derivative is, based on the mean value theorem of calculus. For trapz the mean value theorem expresses the error in terms of its second derivative.

Roger Stafford

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.