[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New Users - Integrate Data
From: |
Muthiah Annamalai |
Subject: |
Re: New Users - Integrate Data |
Date: |
Thu, 6 Dec 2007 14:18:05 -0600 |
On Dec 6, 2007 1:17 PM, Ciaran Mooney <address@hidden> 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
> address@hidden
> 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.