Re: Numerical integration on an irregular grid
- From: bv <bvoh@xxxxxxxxxxxxx>
- Date: Sat, 17 Dec 2005 20:58:15 GMT
Glyn Edwards wrote:
>
> Is there a "best" way to approximate the integral of a function
> when the function is only known at irregularly spaced points? It is safe
> tu assume the function is continuous.
>
> Currently I am using a simple trapezium rule as I can't find anything more
> appropriate that isn't restricted to regular grids (Simpson's rule). The
> only way I could get the function at regular points is by interpolation.
Use a sliding (three point) interval spline fit to calculate the
integral (or derivative) analytically via spline fit coefficients. The
method does very well assuming the max point spacing is reasonable.
If so, then "spline.f" on netlib would serve your purpose well.
http://netlib.org/fmm/spline.f
.
- Follow-Ups:
- References:
- Numerical integration on an irregular grid
- From: Glyn Edwards
- Numerical integration on an irregular grid
- Prev by Date: Re: solving linear equations with LAPACK/Matlab
- Next by Date: Re: Numerical integration on an irregular grid
- Previous by thread: Numerical integration on an irregular grid
- Next by thread: Re: Numerical integration on an irregular grid
- Index(es):