D03PYF (PDF version)
D03 Chapter Contents
D03 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

D03PYF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

D03PYF may be used in conjunction with either D03PDF/D03PDA or D03PJF/D03PJA. It computes the solution and its first derivative at user-specified points in the spatial coordinate.

2  Specification

SUBROUTINE D03PYF ( NPDE, U, NBKPTS, XBKPTS, NPOLY, NPTS, XP, INTPTS, ITYPE, UP, RSAVE, LRSAVE, IFAIL)
INTEGER  NPDE, NBKPTS, NPOLY, NPTS, INTPTS, ITYPE, LRSAVE, IFAIL
REAL (KIND=nag_wp)  U(NPDE,NPTS), XBKPTS(NBKPTS), XP(INTPTS), UP(NPDE,INTPTS,ITYPE), RSAVE(LRSAVE)

3  Description

D03PYF is an interpolation routine for evaluating the solution of a system of partial differential equations (PDEs), or the PDE components of a system of PDEs with coupled ordinary differential equations (ODEs), at a set of user-specified points. The solution of a system of equations can be computed using D03PDF/D03PDA or D03PJF/D03PJA on a set of mesh points; D03PYF can then be employed to compute the solution at a set of points other than those originally used in D03PDF/D03PDA or D03PJF/D03PJA. It can also evaluate the first derivative of the solution. Polynomial interpolation is used between each of the break points XBKPTSi, for i=1,2,,NBKPTS. When the derivative is needed (ITYPE=2), the array XPINTPTS must not contain any of the break points, as the method, and consequently the interpolation scheme, assumes that only the solution is continuous at these points.

4  References

None.

5  Parameters

Note: the parameters U, NPTS, NPDE, XBKPTS, NBKPTS, RSAVE and LRSAVE must be supplied unchanged from either D03PDF/D03PDA or D03PJF/D03PJA.
1:     NPDE – INTEGERInput
On entry: the number of PDEs.
Constraint: NPDE1.
2:     U(NPDE,NPTS) – REAL (KIND=nag_wp) arrayInput
On entry: the PDE part of the original solution returned in the parameter U by the routine D03PDF/D03PDA or D03PJF/D03PJA.
3:     NBKPTS – INTEGERInput
On entry: the number of break points.
Constraint: NBKPTS2.
4:     XBKPTS(NBKPTS) – REAL (KIND=nag_wp) arrayInput
On entry: XBKPTSi, for i=1,2,,NBKPTS, must contain the break points as used by D03PDF/D03PDA or D03PJF/D03PJA.
Constraint: XBKPTS1<XBKPTS2<<XBKPTSNBKPTS.
5:     NPOLY – INTEGERInput
On entry: the degree of the Chebyshev polynomial used for approximation as used by D03PDF/D03PDA or D03PJF/D03PJA.
Constraint: 1NPOLY49.
6:     NPTS – INTEGERInput
On entry: the number of mesh points as used by D03PDF/D03PDA or D03PJF/D03PJA.
Constraint: NPTS=NBKPTS-1×NPOLY+1.
7:     XP(INTPTS) – REAL (KIND=nag_wp) arrayInput
On entry: XPi, for i=1,2,,INTPTS, must contain the spatial interpolation points.
Constraints:
  • XBKPTS1XP1<XP2<<XPINTPTSXBKPTSNBKPTS;
  • if ITYPE=2, XPiXBKPTSj, for i=1,2,,INTPTS and j=2,3,,NBKPTS-1.
8:     INTPTS – INTEGERInput
On entry: the number of interpolation points.
Constraint: INTPTS1.
9:     ITYPE – INTEGERInput
On entry: specifies the interpolation to be performed.
ITYPE=1
The solution at the interpolation points are computed.
ITYPE=2
Both the solution and the first derivative at the interpolation points are computed.
Constraint: ITYPE=1 or 2.
10:   UP(NPDE,INTPTS,ITYPE) – REAL (KIND=nag_wp) arrayOutput
On exit: if ITYPE=1, UPij1, contains the value of the solution Uixj,tout, at the interpolation points xj=XPj, for j=1,2,,INTPTS and i=1,2,,NPDE.
If ITYPE=2, UPij1 contains Uixj,tout and UPij2 contains Ui x  at these points.
11:   RSAVE(LRSAVE) – REAL (KIND=nag_wp) arrayCommunication Array
The array RSAVE contains information required by D03PYF as returned by D03PDF/D03PDA or D03PJF/D03PJA. The contents of RSAVE must not be changed from the call to D03PDF/D03PDA or D03PJF/D03PJA. Some elements of this array are overwritten on exit.
12:   LRSAVE – INTEGERInput
On entry: the size of the workspace RSAVE, as in D03PDF/D03PDA or D03PJF/D03PJA.
13:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. 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 -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry,ITYPE1 or 2,
orNPOLY<1,
orNPDE<1,
orNBKPTS<2,
orINTPTS<1,
orNPTSNBKPTS-1×NPOLY+1,
or XBKPTSi, for i=1,2,,NBKPTS, are not ordered.
IFAIL=2
On entry, the interpolation points XPi, for i=1,2,,INTPTS, are not in strictly increasing order, or when ITYPE=2, at least one of the interpolation points stored in XP is equal to one of the break points stored in XBKPTS.
IFAIL=3
You are attempting extrapolation, that is, one of the interpolation points XPi, for some i, lies outside the interval [XBKPTS1,XBKPTSNBKPTS]. Extrapolation is not permitted.

7  Accuracy

See the documents for D03PDF/D03PDA or D03PJF/D03PJA.

8  Further Comments

None.

9  Example

See Section 9 in D03PDF/D03PDA.

D03PYF (PDF version)
D03 Chapter Contents
D03 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012