[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: integration using Quad or Simpsons 1/8th or Trapezoid of a data fil
From: |
Thomas Shores |
Subject: |
Re: integration using Quad or Simpsons 1/8th or Trapezoid of a data file!! |
Date: |
Thu, 01 Nov 2001 15:40:08 -0600 |
Hendrik Naumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> An small addition.
>
> > On the other hand, if it isn't highly
> > accurate, or you simply want a quick and not necessarily highly
> > accurate answer, using quad might be like using a hammer to swat a
> > fly, so try this: put your data in a 2xm matrix d, where each row
> > of d is an ordered pair (x,y) of your data in abscissa/ordinate
> > format.
>
> The only thing you have to check on this point is that you don't have
> two points with the same abscissa (x-value). Otherwise you will get
> realy suprising effects. You can check this with the diff function.
>
> For points with the same abscissa you may take the mean of these
> values.
>
> - --
> PGP ID 21F0AC0265C92061
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE74SWuIfCsAmXJIGERApJKAJ0QWhhfDXehnFmmAi9LK1TZgs/nSgCfVNdX
> HLjzvffbA8xnRrA4THlvnGY=
> =uADQ
> -----END PGP SIGNATURE-----
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
Absolutely right! I not only forgot to allow for this, but should have
pointed out that the data has to be sorted with respect to the abscissa
first or my suggestion will give really wacko results. Of course, one
way to take care of all these problems is to follow David Doolin's
suggestion and regress the data. If there are very many repititons of
abscissa (x-values), then this would probably be the most sensible thing
to do. If your regression curve is sufficiently complex, you might
prefer to define your own function file for the regression curve and use
quad on it (or the trapezoidal rule with, say, equally spaced
abscissas).
Tom Shores
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------