NAG Library Routine Document

d05bdf (abel2_weak)

1
Purpose

d05bdf computes the solution of a weakly singular nonlinear convolution Volterra–Abel integral equation of the second kind using a fractional Backward Differentiation Formulae (BDF) method.

2
Specification

Fortran Interface
Subroutine d05bdf ( ck, cf, cg, initwt, iorder, tlim, tolnl, nmesh, yn, work, lwk, nct, ifail)
Integer, Intent (In):: iorder, nmesh, lwk
Integer, Intent (Inout):: ifail
Integer, Intent (Out):: nct(nmesh/32+1)
Real (Kind=nag_wp), External:: ck, cf, cg
Real (Kind=nag_wp), Intent (In):: tlim, tolnl
Real (Kind=nag_wp), Intent (Inout):: work(lwk)
Real (Kind=nag_wp), Intent (Out):: yn(nmesh)
Character (1), Intent (In):: initwt
C Header Interface
#include <nagmk26.h>
void  d05bdf_ (
double (NAG_CALL *ck)(const double *t),
double (NAG_CALL *cf)(const double *t),
double (NAG_CALL *cg)(const double *s, const double *y),
const char *initwt, const Integer *iorder, const double *tlim, const double *tolnl, const Integer *nmesh, double yn[], double work[], const Integer *lwk, Integer nct[], Integer *ifail, const Charlen length_initwt)

3
Description

d05bdf computes the numerical solution of the weakly singular convolution Volterra–Abel integral equation of the second kind
yt = ft + 1π 0t kt-s t-s g s,ys ds ,   0tT . (1)
Note the constant 1π in (1). It is assumed that the functions involved in (1) are sufficiently smooth.
The routine uses a fractional BDF linear multi-step method to generate a family of quadrature rules (see d05byf). The BDF methods available in d05bdf are of orders 4, 5 and 6 (=p say). For a description of the theoretical and practical background to these methods we refer to Lubich (1985) and to Baker and Derakhshan (1987) and Hairer et al. (1988) respectively.
The algorithm is based on computing the solution yt in a step-by-step fashion on a mesh of equispaced points. The size of the mesh is given by T/N-1, N being the number of points at which the solution is sought. These methods require 2p-1 (including y0) starting values which are evaluated internally. The computation of the lag term arising from the discretization of (1) is performed by fast Fourier transform (FFT) techniques when N>32+2p-1, and directly otherwise. The routine does not provide an error estimate and you are advised to check the behaviour of the solution with a different value of N. An option is provided which avoids the re-evaluation of the fractional weights when d05bdf is to be called several times (with the same value of N) within the same program unit with different functions.

4
References

Baker C T H and Derakhshan M S (1987) FFT techniques in the numerical solution of convolution equations J. Comput. Appl. Math. 20 5–24
Hairer E, Lubich Ch and Schlichte M (1988) Fast numerical solution of weakly singular Volterra integral equations J. Comput. Appl. Math. 23 87–98
Lubich Ch (1985) Fractional linear multistep methods for Abel–Volterra integral equations of the second kind Math. Comput. 45 463–469

5
Arguments

1:     ck – real (Kind=nag_wp) Function, supplied by the user.External Procedure
ck must evaluate the kernel kt of the integral equation (1).
The specification of ck is:
Fortran Interface
Function ck ( t)
Real (Kind=nag_wp):: ck
Real (Kind=nag_wp), Intent (In):: t
C Header Interface
#include <nagmk26.h>
double  ck (const double *t)
1:     t – Real (Kind=nag_wp)Input
On entry: t, the value of the independent variable.
ck must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d05bdf is called. Arguments denoted as Input must not be changed by this procedure.
Note: ck should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d05bdf. If your code inadvertently does return any NaNs or infinities, d05bdf is likely to produce unexpected results.
2:     cf – real (Kind=nag_wp) Function, supplied by the user.External Procedure
cf must evaluate the function ft in (1).
The specification of cf is:
Fortran Interface
Function cf ( t)
Real (Kind=nag_wp):: cf
Real (Kind=nag_wp), Intent (In):: t
C Header Interface
#include <nagmk26.h>
double  cf (const double *t)
1:     t – Real (Kind=nag_wp)Input
On entry: t, the value of the independent variable.
cf must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d05bdf is called. Arguments denoted as Input must not be changed by this procedure.
Note: cf should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d05bdf. If your code inadvertently does return any NaNs or infinities, d05bdf is likely to produce unexpected results.
3:     cg – real (Kind=nag_wp) Function, supplied by the user.External Procedure
cg must evaluate the function gs,ys in (1).
The specification of cg is:
Fortran Interface
Function cg ( s, y)
Real (Kind=nag_wp):: cg
Real (Kind=nag_wp), Intent (In):: s, y
C Header Interface
#include <nagmk26.h>
double  cg (const double *s, const double *y)
1:     s – Real (Kind=nag_wp)Input
On entry: s, the value of the independent variable.
2:     y – Real (Kind=nag_wp)Input
On entry: the value of the solution y at the point s.
cg must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d05bdf is called. Arguments denoted as Input must not be changed by this procedure.
Note: cg should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d05bdf. If your code inadvertently does return any NaNs or infinities, d05bdf is likely to produce unexpected results.
4:     initwt – Character(1)Input
On entry: if the fractional weights required by the method need to be calculated by the routine then set initwt='I' (Initial call).
If initwt='S' (Subsequent call), the routine assumes the fractional weights have been computed on a previous call and are stored in work.
Constraint: initwt='I' or 'S'.
Note: when d05bdf is re-entered with the value of initwt='S', the values of nmesh, iorder and the contents of work must not be changed.
5:     iorder – IntegerInput
On entry: p, the order of the BDF method to be used.
Suggested value: iorder=4.
Constraint: 4iorder6.
6:     tlim – Real (Kind=nag_wp)Input
On entry: the final point of the integration interval, T.
Constraint: tlim>10×machine precision.
7:     tolnl – Real (Kind=nag_wp)Input
On entry: the accuracy required for the computation of the starting value and the solution of the nonlinear equation at each step of the computation (see Section 9).
Suggested value: tolnl=ε where ε is the machine precision.
Constraint: tolnl>10×machine precision.
8:     nmesh – IntegerInput
On entry: N, the number of equispaced points at which the solution is sought.
Constraint: nmesh=2m+2×iorder-1, where m1.
9:     ynnmesh – Real (Kind=nag_wp) arrayOutput
On exit: yni contains the approximate value of the true solution yt at the point t=i-1×h, for i=1,2,,nmesh, where h=tlim/nmesh-1.
10:   worklwk – Real (Kind=nag_wp) arrayCommunication Array
On entry: if initwt='S', work must contain fractional weights computed by a previous call of d05bdf (see description of initwt).
On exit: contains fractional weights which may be used by a subsequent call of d05bdf.
11:   lwk – IntegerInput
On entry: the dimension of the array work as declared in the (sub)program from which d05bdf is called.
Constraint: lwk2×iorder+6×nmesh+8×iorder2-16×iorder+1.
12:   nctnmesh/32+1 – Integer arrayWorkspace
13:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1 or 1. 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 -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 argument, 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, initwt=value.
Constraints: initwt='I' or 'S'.
On entry, iorder=value.
Constraint: 4iorder6.
On entry, lwk=value.
Constraint: lwk2×iorder+6×nmesh+8×iorder2-16×iorder+1; that is, value.
On entry, nmesh=value and iorder=value.
Constraint: nmesh=2m+2×iorder-1, for some m.
On entry, nmesh=value and iorder=value.
Constraint: nmesh2×iorder+1.
On entry, tlim=value.
Constraints: tlim>10×machine precision.
On entry, tolnl=value.
Constraint: tolnl>10×machine precision.
ifail=2
An error occurred when trying to compute the starting values.
Relaxing the value of tolnl and/or increasing the value of nmesh may overcome this problem (see Section 9 for further details).
ifail=3
An error occurred when trying to compute the solution at a specific step.
Relaxing the value of tolnl and/or increasing the value of nmesh may overcome this problem (see Section 9 for further details).
ifail=-99
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.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

The accuracy depends on nmesh and tolnl, the theoretical behaviour of the solution of the integral equation and the interval of integration. The value of tolnl controls the accuracy required for computing the starting values and the solution of (2) at each step of computation. This value can affect the accuracy of the solution. However, for most problems, the value of ε, where ε is the machine precision, should be sufficient.

8
Parallelism and Performance

d05bdf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
d05bdf 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.

9
Further Comments

In solving (1), initially, d05bdf computes the solution of a system of nonlinear equations for obtaining the 2p-1 starting values. c05qdf is used for this purpose. When a failure with ifail=2 occurs (which corresponds to an error exit from c05qdf), you are advised to either relax the value of tolnl or choose a smaller step size by increasing the value of nmesh. Once the starting values are computed successfully, the solution of a nonlinear equation of the form
Yn-αgtn,Yn-Ψn=0, (2)
is required at each step of computation, where Ψn and α are constants. d05bdf calls c05axf to find the root of this equation.
If a failure with ifail=3 occurs (which corresponds to an error exit from c05axf), you are advised to relax the value of the tolnl or choose a smaller step size by increasing the value of nmesh.
If a failure with ifail=2 or 3 persists even after adjustments to tolnl and/or nmesh then you should consider whether there is a more fundamental difficulty. For example, the problem is ill-posed or the functions in (1) are not sufficiently smooth.

10
Example

In this example we solve the following integral equations
yt = t + 38 π t2 - 0t 1 t-s y s 3 ds ,   0t7 ,  
with the solution yt=t, and
y t = 3-t t - 0t 1t-s exp s 1-s 2 - ys 2 d s ,   0t5 ,  
with the solution yt=1-tt. In the above examples, the fourth-order BDF is used, and nmesh is set to 26+7.

10.1
Program Text

Program Text (d05bdfe.f90)

10.2
Program Data

None.

10.3
Program Results

Program Results (d05bdfe.r)