Saturday, March 10, 2012

How do I integrate data without knowing the function?

I have a large sum of data that I need to integrate each cycle. I stated programming the trapezoid method but I'm unsure of the function that the data is taking. How do I integrate data points without knowing the function? If I need to know the function what is the best route for curve fitting the data? I'm using VB.NET (the only language I can use at work).How do I integrate data without knowing the function?
You can still use Trapezoidal rule without necessarily knowing the function.

However, if you are using lots of data points I would suggest using simpson's rule; it makes much closer approximations with fewer terms required.

To integrate with Simpson's rule, it's the same as the trapezoidal rule; you just need a start and end point for the independent variable, as well as points. You can still use f(x) (or output) values you measure even if you don't necessarily know what f(x) in general is.

For example, say you have a bunch of times (t) and heights corresponding to those tides h(t). As long as you have these values, you can still do either trapezoidal or simpsons rule, as both these only ask for exact points.



Hope that helps.

No comments:

Post a Comment