New Users - Integrate Data
Muthiah Annamalai
muthuspost at gmail.com
Thu Dec 6 14:18:05 CST 2007
On Dec 6, 2007 1:17 PM, Ciaran Mooney <general.mooney at googlemail.com> wrote:
> Hi,
>
> I am a undergrad chemist and I have a bit of a problem.
>
> I have some data which I have had to plot, and ended up with quite a
> complex curve. I need to work out the area beneath the curve to obtain
> a useful quantity. Unfortunatly the University only provides us with
> Sigmaplot, and I run Linux......
>
> And I've just found out from using Sigmaplot at the Universtiy that it
> cannot integrate a curve to find the area beneath.
>
> I have never used Octave before but it seems to be exactly the program
> I need to get my work done.
>
> Is there a way of giving Octave a list of values (x, y) and then
> getting it to integrate those values? I have over 600 values so an
> even better way would be for octave to import a list of values from a
> file, and then perform the calculation.
>
> I have looked in the documentation and can't seem to find anything
> that helps, my maths is a bit rusty from A-level, most of it shoots
> over my head.
>
> Any chance that this is even possible?
>
> Regards,
>
> Ciarán
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
You can use some simple integration technqiues; or interpolate the y
data for more x points
than present, and then do it.
Simply using rectangular integration we have,
# Y_pts , your Y
# X_pts , your X
dX = diff(X_pts);
Y = (Y_pts(1:end-1) + Y_pts(2:end) ) *0.5;
integ_val = dot(Y,dX)
you could also use quad() with the data being returned form a
interpolated set.
More information about the Help-octave
mailing list