I'm trying to find a way to calculate area under a curve using python 2.7 when the function is unknown. Only data I have are coordinates, such as:
0 0
0.000194439 0
0.000388878 0
0.000583317 0
0.000777756 0
0.000972195 0
0.00116663 0
0.00136107 0
0.00155551 0
0.00174995 0
0.00194439 0
0.00213883 0
0.00233327 0
0.00233327 0.00588235
0.00252771 0.00588235
...............................
.................................
The values will always be positive. More often than not the function will resemble a logarithmic one, but that is not guaranteed.
I could calculate (x2-x1)*y and so on for an approximation, but I'd prefer using integration.
Thus my question is:
How could I find out the function for given coordinates reliably in code? Or is it possible to accomplish this without one? Asking the latter merely to cover all bases, since my math is extremely rusty