Cubic Spline Integration
Author Message
Cubic Spline Integration

I am looking for subroutine to compute the integration of a cublic
spline function. Can anyone suggest where I can find one?

shekhar

Fri, 19 Mar 2010 14:07:13 GMT
Cubic Spline Integration

Quote:

> I am looking for subroutine to compute the integration of a cublic
> spline function. Can anyone suggest where I can find one?

The integral of a cubic polynomial is pretty easy to do.

The integral of the cubic spline is the sum of the integrals
of the separate cubics.

-- glen

Fri, 19 Mar 2010 15:22:14 GMT
Cubic Spline Integration

Quote:
> I am looking for subroutine to compute the integration of a cublic
> spline function. Can anyone suggest where I can find one?

> shekhar

Given that you probably already have a cubic spline evaluation
procedure, a quick-and-dirty solution is to use a 2-point Gauss-
Kronrod (exact for cubic polynomials) rule inside each subinterval. It
will, however, be suboptimal w.r.t. the amount of computation
required, _especially_ if you locate the correct interval (as spline
evaluation functions typically do) over and over again.

The 2p GK rule is:
int(f(x),x=a..b) ~ .5*(f(c-d)+f(c+d))
where
c = .5*(a+b)
d = .5*(a-b)/sqrt(3)

Fri, 19 Mar 2010 14:50:43 GMT
Cubic Spline Integration

Quote:

> I am looking for subroutine to compute the integration of a cublic
> spline function. Can anyone suggest where I can find one?

You can try chapter 3-3 of Numerical Recipes in fortran 77 and most
probably also in chapter 3 in NumRes in Fortran 90.

http://www.nr.com/oldverswitcher.html

Unfortunately, they have introduced some kind of digital rights
management. I did not test in which books were which kind of
restrictions; but printing should be ok as far as I could find. Maybe
you can still convert the PDFs into postscripts to circumvent possible
30 day restrictions. But I did not try yet, and I also don't know
whether you can still copy&paste listings from the pdfs to avoid boring
typing by hand.

Best whishes,

Ingo

Fri, 30 Apr 2010 22:30:54 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages