The routine may be called by the names d02tlf or nagf_ode_bvp_coll_nlin_solve.
3Description
d02tlf and its associated routines (d02tvf,d02txf,d02tyfandd02tzf) 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. Note that the error requirements apply only to the solution components and that no error control is applied to derivatives of solution components. (If error control is required on derivatives then the system must be reduced in order by introducing the derivatives whose error is to be controlled as new variables. See Section 9 in d02tvf.) 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 and other details of the solution procedure, and d02tyf can be used to compute the approximate solution anywhere on the interval .
A description of the numerical technique used in d02tlf is given in Section 3 in d02tvf.
d02tlf can also be used in the solution of a series of problems, for example in performing continuation, when the mesh used to compute the solution of one problem is to be used as the initial mesh for the solution of the next related problem. d02txf should be used in between calls to d02tlf in this context.
See Section 9 in d02tvf for details of how to solve boundary value problems of a more general nature.
On entry: contains , the order of the th differential equation, for .
5: – Real (Kind=nag_wp) arrayOutput
On exit: must contain , for .
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
ffun is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to ffun.
ffun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:ffun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
2: – Subroutine, supplied by the user.External Procedure
fjac must evaluate the partial derivatives of with respect to the elements of .
On entry: contains , the order of the th differential equation, for .
5: – Real (Kind=nag_wp) arrayInput/Output
On entry: set to zero.
On exit: must contain the partial derivative of with respect to , for , and . Only nonzero partial derivatives need be set.
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
fjac is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to fjac.
fjac must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:fjac should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
3: – Subroutine, supplied by the user.External Procedure
gafun must evaluate the boundary conditions at the left-hand end of the range, that is functions for given values of .
On entry: contains , the order of the th differential equation, for .
4: – IntegerInput
On entry: the number of boundary conditions at .
5: – Real (Kind=nag_wp) arrayOutput
On exit: must contain , for .
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
gafun is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to gafun.
gafun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:gafun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
4: – Subroutine, supplied by the user.External Procedure
gbfun must evaluate the boundary conditions at the right-hand end of the range, that is functions for given values of .
On entry: contains , the order of the th differential equation, for .
4: – IntegerInput
On entry: the number of boundary conditions at .
5: – Real (Kind=nag_wp) arrayOutput
On exit: must contain , for .
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
gbfun is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to gbfun.
gbfun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:gbfun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
5: – Subroutine, supplied by the user.External Procedure
gajac must evaluate the partial derivatives of with respect to the elements of .
On entry: contains , the order of the th differential equation, for .
4: – IntegerInput
On entry: the number of boundary conditions at .
5: – Real (Kind=nag_wp) arrayInput/Output
On entry: set to zero.
On exit: must contain the partial derivative of with respect to , for , and . Only nonzero partial derivatives need be set.
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
gajac is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to gajac.
gajac must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:gajac should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
6: – Subroutine, supplied by the user.External Procedure
gbjac must evaluate the partial derivatives of with respect to the elements of .
On entry: contains , the order of the th differential equation, for .
4: – IntegerInput
On entry: the number of boundary conditions at .
5: – Real (Kind=nag_wp) arrayInput/Output
On entry: set to zero.
On exit: must contain the partial derivative of with respect to , for , and . Only nonzero partial derivatives need be set.
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
gbjac is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to gbjac.
gbjac must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:gbjac should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
7: – Subroutine, supplied by the user.External Procedure
guess must return initial approximations for the solution components
and the derivatives , for and . Try to compute each derivative such that it corresponds to your approximations to
, for . You should not call ffun to compute .
If d02tlf is being used in conjunction with d02txf as part of a continuation process, guess is not called by d02tlf after the call to d02txf.
On entry: contains , the order of the th differential equation, for .
4: – Real (Kind=nag_wp) arrayOutput
On exit: must contain , for and . Note: .
5: – Real (Kind=nag_wp) arrayOutput
On exit: must contain , for .
6: – Integer arrayUser Workspace
7: – Real (Kind=nag_wp) arrayUser Workspace
guess is called with the arguments iuser and ruser as supplied to d02tlf. You should use the arrays iuser and ruser to supply information to guess.
guess must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d02tlf is called. Arguments denoted as Input must not be changed by this procedure.
Note:guess should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d02tlf. If your code inadvertently does return any NaNs or infinities, d02tlf is likely to produce unexpected results.
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 d02tvf.
On entry: this must be the same array as supplied to d02tvf 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 d02tvf.
On entry: this must be the same array as supplied to d02tvf and must remain unchanged between calls.
On exit: contains information about the solution for use on subsequent calls to associated routines.
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended since useful values can be provided in some output arguments even when on exit. When the value or 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).
6Error 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:
Note: in some cases d02tlf may return useful information.
Either the setup routine has not been called or the communication arrays have become corrupted. No solution will be computed.
Numerical singularity has been detected in the Jacobian used in the Newton iteration.
No results have been generated. Check the coding of the routines for calculating the Jacobians of system and boundary conditions.
All Newton iterations that have been attempted have failed to converge.
No results have been generated. Check the coding of the routines for calculating the Jacobians of system and boundary conditions.
Try to provide a better initial solution approximation.
A Newton iteration has failed to converge. The computation has not succeeded but results have been returned for an intermediate mesh on which convergence was achieved.
These results should be treated with extreme caution.
The expected number of sub-intervals required to continue the computation exceeds the maximum specified: .
Results have been generated which may be useful.
Try increasing this number or relaxing the error requirements.
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
The accuracy of the solution is determined by the argument tols in the prior call to d02tvf (see Sections 3 and 9 in d02tvf for details and advice). Note that error control is applied only to solution components (variables) and not to any derivatives of the solution. An estimate of the maximum error in the computed solution is available by calling d02tzf.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
d02tlf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
d02tlf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
If d02tlf returns with , , or and the call to d02tlf was a part of some continuation procedure for which successful calls to d02tlf have already been made, then it is possible that the adjustment(s) to the continuation parameter(s) between calls to d02tlf is (are) too large for the problem under consideration. More conservative adjustment(s) to the continuation parameter(s) might be appropriate.
10Example
The following example is used to illustrate the treatment of a high-order system, control of the error in a derivative of a component of the original system, and the use of continuation. See also d02tvf,d02txf,d02tyfandd02tzf, for the illustration of other facilities.
Consider the steady flow of an incompressible viscous fluid between two infinite coaxial rotating discs. See Ascher et al. (1979) and the references therein. The governing equations are
subject to the boundary conditions
where is the Reynolds number and are the angular velocities of the disks.
We consider the case of counter-rotation and a symmetric solution, that is . This problem is more difficult to solve, the larger the value of . For illustration, we use simple continuation to compute the solution for three different values of (). However, this problem can be addressed directly for the largest value of considered here. Instead of the values suggested in Section 5 in d02txf for nmesh, ipmesh and mesh in the call to d02txf prior to a continuation call, we use every point of the final mesh for the solution of the first value of , that is we must modify the contents of ipmesh. For illustrative purposes we wish to control the computed error in and so recast the equations as
subject to the boundary conditions
For the symmetric boundary conditions considered, there exists an odd solution about . Hence, to satisfy the boundary conditions, we use the following initial approximations to the solution in guess: