Previous: fitdin Up: ../plot79_f.html Next: fitdsm
REAL FUNCTION FITDS (T, N, X, A, B, C, D, IT) C$ (First Derivative of Cubic Spline) C$ This function interpolates the derivative of a curve at a C$ given point using a cubic spline. SUBROUTINE FITSM should C$ be called earlier to determine certain necessary C$ parameters. For best results, it is recommended that this C$ function to used to evaluate the derivatives at the C$ original data points, and then to call SUBROUTINE FITSM to C$ obtain a new spline function for the derivatives. The C$ splined derivatives then obtained from FUNCTION FITCS will C$ generally be much less oscillatory than the derivatives of C$ the spline computed here. C$ C$ On input-- C$ C$ T...........ordinate value for which the cubic spline C$ interpolant is to be evaluated. C$ N...........number of points in X(*). C$ X(*)........original ordinate values used to determine C$ the spline. C$ A(*),B(*),C(*),D(*).....spline polynomial coefficients. C$ IT.......... .EQ. 1 - first call. C$ .NE. 1 - subsequent call (with N, X, A, B, C, C$ D unchanged), and this value of T C$ larger than the previous value. In C$ such a case, the search for the C$ interval in which T lies can be C$ greatly speeded. Thus IT can C$ frequently be a loop index in the C$ calling program if the values of T C$ are incremented successively. C$ C$ The parameters N, X, A, B, C, and D should be input C$ unaltered from the output of SUBROUTINE FITSM. C$ C$ On output-- C$ C$ FITDS......contains the interpolated derivative. For T less C$ than X(1), FITDS = YPRIME(1). For T greater than C$ X(N), FITDS = YPRIME(N). C$ C$ None of the input parameters are altered. Adapted from C$ FUNCTION FITC2 published by C$ C$ Author: A.K. Cline, "Scalar and Planar Valued Curve Fitting C$ Using Splines Under Tension", Comm. A.C.M. 17, C$ 218-225 (1974). (Algorithm 476). C$ C$ Modifications by Nelson H.F. Beebe, Department of Chemistry C$ Aarhus University, Aarhus, Denmark, to provide a more C$ transportable program. C$ (03-APR-82)