NAG Library Routine Document
E02DHF
1 Purpose
E02DHF computes the partial derivative (of order
,
), of a bicubic spline approximation to a set of data values, from its B-spline representation, at points on a rectangular grid in the
-
plane. This routine may be used to calculate derivatives of a bicubic spline given in the form produced by
E01DAF,
E02DAF,
E02DCF and
E02DDF.
2 Specification
SUBROUTINE E02DHF ( |
MX, MY, PX, PY, X, Y, LAMDA, MU, C, NUX, NUY, Z, IFAIL) |
INTEGER |
MX, MY, PX, PY, NUX, NUY, IFAIL |
REAL (KIND=nag_wp) |
X(MX), Y(MY), LAMDA(PX), MU(PY), C((PX-4)*(PY-4)), Z(MX*MY) |
|
3 Description
E02DHF determines the partial derivative of a smooth bicubic spline approximation at the set of data points .
The spline is given in the B-spline representation
where
and
denote normalized cubic B-splines, the former defined on the knots
to
and the latter on the knots
to
, with
and
the total numbers of knots of the computed spline with respect to the
and
variables respectively. For further details, see
Hayes and Halliday (1974) for bicubic splines and
de Boor (1972) for normalized B-splines. This routine is suitable for B-spline representations returned by
E01DAF,
E02DAF,
E02DCF and
E02DDF.
The partial derivatives can be up to order in each direction; thus the highest mixed derivative available is .
The points in the grid are defined by coordinates , for , along the axis, and coordinates , for , along the axis.
4 References
de Boor C (1972) On calculating with B-splines J. Approx. Theory 6 50–62
Dierckx P (1981) An improved algorithm for curve fitting with spline functions Report TW54 Department of Computer Science, Katholieke Univerciteit Leuven
Dierckx P (1982) A fast algorithm for smoothing data on a rectangular grid while using spline functions SIAM J. Numer. Anal. 19 1286–1304
Hayes J G and Halliday J (1974) The least-squares fitting of cubic spline surfaces to general data sets J. Inst. Math. Appl. 14 89–103
Reinsch C H (1967) Smoothing by spline functions Numer. Math. 10 177–183
5 Parameters
- 1: MX – INTEGERInput
On entry: , the number of grid points along the axis.
Constraint:
.
- 2: MY – INTEGERInput
On entry: , the number of grid points along the axis.
Constraint:
.
- 3: PX – INTEGERInput
On entry: the total number of knots in the
-direction of the bicubic spline approximation, e.g., the value
NX as returned by
E02DCF.
- 4: PY – INTEGERInput
On entry: the total number of knots in the
-direction of the bicubic spline approximation, e.g., the value
NY as returned by
E02DCF.
- 5: X(MX) – REAL (KIND=nag_wp) arrayInput
On entry: must be set to
, the coordinate of the th grid point along the axis, for , on which values of the partial derivative are sought.
Constraint:
.
- 6: Y(MY) – REAL (KIND=nag_wp) arrayInput
On entry: must be set to , the coordinate of the th grid point along the axis, for on which values of the partial derivative are sought.
Constraint:
.
- 7: LAMDA(PX) – REAL (KIND=nag_wp) arrayInput
On entry: contains the position of the knots in the
-direction of the bicubic spline approximation to be differentiated, e.g.,
LAMDA as returned by
E02DCF.
- 8: MU(PY) – REAL (KIND=nag_wp) arrayInput
On entry: contains the position of the knots in the
-direction of the bicubic spline approximation to be differentiated, e.g.,
MU as returned by
E02DCF.
- 9: C() – REAL (KIND=nag_wp) arrayInput
On entry: the coefficients of the bicubic spline approximation to be differentiated, e.g.,
C as returned by
E02DCF.
- 10: NUX – INTEGERInput
On entry: specifies the order, of the partial derivative in the -direction.
Constraint:
.
- 11: NUY – INTEGERInput
On entry: specifies the order, of the partial derivative in the -direction.
Constraint:
.
- 12: Z() – REAL (KIND=nag_wp) arrayOutput
On exit: contains the derivative , for and .
- 13: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
The coordinates defining the mesh are not well-ordered, that is, , for at least one .
The coordinates defining the mesh are not well-ordered, that is, , for at least one .
7 Accuracy
On successful exit, the partial derivatives on the given mesh are accurate to
machine precision with respect to the supplied bicubic spline. Please refer to Section 7 in
E01DAF,
E02DAF,
E02DCF and
E02DDF of the routine document for the respective routine which calculated the spline approximant for details on the accuracy of that approximation.
None.
9 Example
This example reads in values of
,
,
, for
, and
, for
, followed by values of the ordinates
defined at the grid points
. It then calls
E02DCF to compute a bicubic spline approximation for one specified value of
. Finally it evaluates the spline and its first
derivative at a small sample of points on a rectangular grid by calling E02DHF.
9.1 Program Text
Program Text (e02dhfe.f90)
9.2 Program Data
Program Data (e02dhfe.d)
9.3 Program Results
Program Results (e02dhfe.r)