E211: Cubic Splines and their Integrals

Author(s): K.S. Kölbig, H. Lipps Library: MATHLIB
Submitter: K.S. Kölbig Submitted: 01.05.1990
Language: Fortran Revised:

Subroutines RCSPLN and DCSPLN compute a (vector-valued) cubic spline function F(x) which interpolates between a given set of points. Entries RCSPNT and DCSPNT compute the first and second integral over F(x).

On computers other than CDC or Cray, only the double-precision versions DCSPLN and DCSPNT are available. On CDC and Cray computers, only the single-precision versions RCSPLN and RCSPNT are available.

Given an interval [a,b], a subdivision of this interval into tex2html_wrap_inline169 subintervals

displaymath171

and n+1 function values tex2html_wrap_inline175 on the n+1 abscissae (called `knots') tex2html_wrap_inline179 ( tex2html_wrap_inline181 ), RCSPLN and DCSPLN compute a function F(x) of class tex2html_wrap_inline185 , defined on [a,b], which assumes the given value tex2html_wrap_inline189 at the knot tex2html_wrap_inline191 (i.e. tex2html_wrap_inline193 ), and which, when restricted to the ith sub-interval tex2html_wrap_inline197 is identical with a set of m polynomials tex2html_wrap_inline201 , each of degree at most 3. Any function F(x) which satisfies the above two conditions is called a `cubic spline' through the n + 1 points tex2html_wrap_inline209 . To define the spline function F(x) uniquely the subroutines impose an additional boundary condition, specified by their MODE parameter:

MODE = 0: tex2html_wrap_inline213 (the so-called natural spline).
MODE = 1: tex2html_wrap_inline215 and tex2html_wrap_inline217 .

Structure:

SUBROUTINE subprograms
User Entry Names: RCSPLN, RCSPNT, DCSPLN, DCSPNT
Files referenced: Unit 6

Usage:

For tex2html_wrap_inline219 (type REAL), tex2html_wrap_inline221 (type DOUBLE PRECISION),
Spline:CALL tCSPLN(N,X,M,Y,NDIM,MODE,A,B,C,D)
Integrals:CALL tCSPNT(N,X,M,Y,NDIM,MODE,A,B,C,D)

N
(INTEGER) Number n of subintervals tex2html_wrap_inline225 . Must contain a value of at least 2 on entry. Unchanged on return.
X
(type according to t) One-dimensional array of dimension (0:d) of at least n + 1 elements. On entry, X(k) must contain the abscissa tex2html_wrap_inline229 , tex2html_wrap_inline231 . Unchanged on return.
M
(INTEGER) Number m of components of the vector-valued spline function F(x). Must contain a value of at least 1 on entry. Unchanged on return.
Y
(type according to t) Two-dimensional array of dimension (0:NDIM,d) where d is a value not less than m. On entry, Y(k,j) must contain the value tex2html_wrap_inline239 of the jth component of the vector tex2html_wrap_inline243 , tex2html_wrap_inline245 ; tex2html_wrap_inline247 . Unchanged on return.
NDIM
(INTEGER) Upper bound of the first dimension of arrays A, B, C, D and Y. Must contain a value of at least n on entry. Unchanged on return.
MODE
(INTEGER) Type of boundary condition (see description above). Must contain the value 0 or 1 on entry. Unchanged on return.
A,B,C,D
(type according to t) Two-dimensional arrays of dimension (NDIM,d), where tex2html_wrap_inline251 .
On return from RCSPLN, A(i,j), B(i,j), C(i,j) and D(i,j) will contain the four coefficients tex2html_wrap_inline253 and tex2html_wrap_inline255 of the polynomial

displaymath257

that determines the jth component tex2html_wrap_inline261 of the spline in the ith subinterval tex2html_wrap_inline265 , tex2html_wrap_inline267 , tex2html_wrap_inline269 .
On return from RCSPNT,
A(i,j) = tex2html_wrap_inline271 and B(i,j) = tex2html_wrap_inline273 ,
with tex2html_wrap_inline275 tex2html_wrap_inline277 .
Arrays C and D have been used as working space.

Restrictions:

tex2html_wrap_inline279 , tex2html_wrap_inline281 , tex2html_wrap_inline283 , tex2html_wrap_inline285 or 1.

Error handling:

Error E211.1: tex2html_wrap_inline287 .
Error E211.2: tex2html_wrap_inline289 .
Error E211.3: tex2html_wrap_inline291 .
Error E211.4: tex2html_wrap_inline293 and tex2html_wrap_inline295 .
A message is written on Unit 6, unless subroutine MTLSET (N002) has been called.
tex2html_wrap_inline297


Michel Goossens Wed Jun 5 03:07:07 METDST 1996