Need help with numerical integration over a specific curve.

2 views (last 30 days)
Hello,
What I need to do is numerically integrate a function f(x,y) over a hyperbola in the plane. I have the hyperbola as a set of points {(x,y)}. Due to the fact that I need to do this many times and the foci of the hyperbolas are not located on an axis it is difficult to parameterize the hyperbola in order to calculate the integral \int f( x(parameter), y(parameter)) dparameter. Is there a matlab routine which allows one to specify the integration over a path in the plane using a set of points to define the path?
If not, is there a better way to solve this problem?

Answers (1)

John D'Errico
John D'Errico on 4 Feb 2016
Edited: John D'Errico on 4 Feb 2016
I don't see the problem if you refuse to use the hyperbola itself. Just use cscvn (or my own interparc, fond on the File Exchange) to provide an interpolant, then call any quadrature routine. Since a spline will have singularities at the breaks, it might make some sense to use the points themselves as way points, for a tool like integral.m. Of course, any such scheme will be workable only over the support of the data, so if your integral must extend to infinity and the function does not go sufficiently quickly to zero, you must use the hyperbola directly.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!