NAG Library Routine Document
d02tzf
(bvp_coll_nlin_diag)
1
Purpose
d02tzf returns information about the solution of a general two-point boundary value problem computed by
d02tlf.
2
Specification
Fortran Interface
Integer, Intent (In) | :: |
mxmesh,
icomm(*) | Integer, Intent (Inout) | :: |
ifail | Integer, Intent (Out) | :: |
nmesh,
ipmesh(mxmesh),
iermx,
ijermx | Real (Kind=nag_wp), Intent (In) | :: |
rcomm(*) | Real (Kind=nag_wp), Intent (Out) | :: |
mesh(mxmesh),
ermx |
|
3
Description
d02tzf and its associated routines (
d02tlf,
d02tvf,
d02txf and
d02tyf) solve the two-point boundary value problem for a nonlinear mixed order system of ordinary differential equations
over an interval
subject to
(
) nonlinear boundary conditions at
and
(
) nonlinear boundary conditions at
, where
. Note that
is the
th derivative of the
th solution component. Hence
. The left boundary conditions at
are defined as
and the right boundary conditions at
as
where
and
First,
d02tvf must be called to specify the initial mesh, error requirements and other details. Then,
d02tlf can be used to solve the boundary value problem. After successful computation,
d02tzf can be used to ascertain details about the final mesh.
d02tyf can be used to compute the approximate solution anywhere on the interval
using interpolation.
The routines are based on modified versions of the codes COLSYS and COLNEW (see
Ascher et al. (1979) and
Ascher and Bader (1987)). A comprehensive treatment of the numerical solution of boundary value problems can be found in
Ascher et al. (1988) and
Keller (1992).
4
References
Ascher U M and Bader G (1987) A new basis implementation for a mixed order boundary value ODE solver SIAM J. Sci. Stat. Comput. 8 483–500
Ascher U M, Christiansen J and Russell R D (1979) A collocation solver for mixed order systems of boundary value problems Math. Comput. 33 659–679
Ascher U M, Mattheij R M M and Russell R D (1988) Numerical Solution of Boundary Value Problems for Ordinary Differential Equations Prentice–Hall
Cole J D (1968) Perturbation Methods in Applied Mathematics Blaisdell, Waltham, Mass.
Keller H B (1992) Numerical Methods for Two-point Boundary-value Problems Dover, New York
5
Arguments
- 1: – IntegerInput
-
On entry: the maximum number of points allowed in the mesh.
Constraint:
this must be identical to the value supplied for the argument
mxmesh in the prior call to
d02tvf.
- 2: – IntegerOutput
-
On exit: the number of points in the mesh last used by
d02tlf.
- 3: – Real (Kind=nag_wp) arrayOutput
-
On exit:
contains the
th point of the mesh last used by
d02tlf, for
.
will contain
and
will contain
. The remaining elements of
mesh are not initialized.
- 4: – Integer arrayOutput
-
On exit:
specifies the nature of the point
, for
, in the final mesh computed by
d02tlf.
- Indicates that the th point is a fixed point and was used by the solver before an extrapolation-like error test.
- Indicates that the th point was used by the solver before an extrapolation-like error test.
- Indicates that the th point was used by the solver only as part of an extrapolation-like error test.
The remaining elements of
ipmesh are initialized to
.
See
Section 9 for advice on how these values may be used in conjunction with a continuation process.
- 5: – Real (Kind=nag_wp)Output
-
On exit: an estimate of the maximum error in the solution computed by
d02tlf, that is
where
is the approximate solution for the
th solution component. If
d02tlf returned successfully with
,
ermx will be less than
where
tols contains the error requirements as specified in
Sections 3 and
5 in
d02tvf.
If
d02tlf returned with
,
ermx will be greater than
.
If
d02tlf returned any other value for
ifail
then an error estimate is not available and
ermx is initialized to
.
- 6: – IntegerOutput
-
On exit: indicates the mesh sub-interval where the value of
ermx has been computed, that is
.
If an estimate of the error is not available then
iermx is initialized to
.
- 7: – IntegerOutput
-
On exit: indicates the component
(
) of the solution for which
ermx has been computed, that is the approximation of
on
is estimated to have the largest error of all components
over mesh sub-intervals defined by
mesh.
If an estimate of the error is not available then
ijermx is initialized to
.
- 8: – Real (Kind=nag_wp) arrayCommunication Array
-
Note: the dimension of this array is dictated by the requirements of associated functions that must have been previously called. This array
must be the same array passed as argument
rcomm in the previous call to
d02tlf.
On entry: this must be the same array as supplied to
d02tlf and
must remain unchanged between calls.
On exit: contains information about the solution for use on subsequent calls to associated routines.
- 9: – Integer arrayCommunication Array
-
Note: the dimension of this array is dictated by the requirements of associated functions that must have been previously called. This array
must be the same array passed as argument
icomm in the previous call to
d02tlf.
On entry: this must be the same array as supplied to
d02tlf and
must remain unchanged between calls.
On exit: contains information about the solution for use on subsequent calls to associated routines.
- 10: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation 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, because for this routine the values of the output arguments may be useful even if
on exit, 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).
Note: d02tzf may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
-
On entry, an illegal value for
mxmesh was specified, or an invalid call to
d02tzf was made, for example without a previous call to the solver routine
d02tlf.
-
The solver routine
d02tlf did not converge to a solution or did not satisfy the error requirements. The last mesh computed by
d02tlf has been returned by
d02tzf. This mesh should be treated with extreme caution as nothing can be said regarding its quality or suitability for any subsequent computation.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
Not applicable.
8
Parallelism and Performance
d02tzf is not threaded in any implementation.
Note that:
- if d02tlf returned , or then it will always be the case that ;
- if d02tlf returned or then it will always be the case that
, for (even ) and
or , for (odd );
- if d02tlf returned then it will always be the case that
, for .
If
d02tzf returns
, then examination of the mesh may provide assistance in determining a suitable starting mesh for
d02tvf in any subsequent attempts to solve similar problems.
If the problem being treated by
d02tlf is one of a series of related problems (for example, as part of a continuation process), then the values of
ipmesh and
mesh may be suitable as input arguments to
d02txf. Using the mesh points not involved in the extrapolation error test is usually appropriate.
ipmesh and
mesh should be passed unchanged to
d02txf but
nmesh should be replaced by
.
If
d02tzf returns
, nothing can be said regarding the quality of the mesh returned. However, it may be a useful starting mesh for
d02tvf in any subsequent attempts to solve the same problem.
If
d02tlf returns
, this corresponds to the solver requiring more than
mxmesh mesh points to satisfy the error requirements. If
mxmesh can be increased and the preceding call to
d02tlf was not part, or was the first part, of a continuation process then the values in
mesh may provide a suitable mesh with which to initialize a subsequent attempt to solve the same problem. If it is not possible to provide more mesh points then relaxing the error requirements by setting
to
ermx might lead to a successful solution. It may be necessary to reset the other components of
tols. Note that resetting the tolerances can lead to a different sequence of meshes being computed and hence to a different solution being computed.
10
Example
The following example is used to illustrate the use of fixed mesh points, simple continuation and numerical approximation of a Jacobian. See also
d02tlf,
d02tvf,
d02txf and
d02tyf, for the illustration of other facilities.
Consider the Lagerstrom–Cole equation
with the boundary conditions
where
is small and positive. The nature of the solution depends markedly on the values of
. See
Cole (1968).
We choose
for which the solution is known to have corner layers at
. We choose an initial mesh of seven points
and ensure that the points
near the corner layers are fixed, that is the corresponding elements of the array
ipmesh are set to
. First we compute the solution for
using in
guess the initial approximation
which satisfies the boundary conditions. Then we use simple continuation to compute the solution for
. We use the suggested values for
nmesh,
ipmesh and
mesh in the call to
d02txf prior to the continuation call, that is only every second point of the preceding mesh is used and the fixed mesh points are retained.
Although the analytic Jacobian for this system is easy to evaluate, for illustration the procedure
fjac uses central differences and calls to
ffun to compute a numerical approximation to the Jacobian.
10.1
Program Text
Program Text (d02tzfe.f90)
10.2
Program Data
Program Data (d02tzfe.d)
10.3
Program Results
Program Results (d02tzfe.r)