The routine may be called by the names d05abf or nagf_inteq_fredholm2_smooth.
3Description
d05abf uses the method of El–Gendi (1969) to solve an integral equation of the form
for the function in the range .
An approximation to the solution is found in the form of an term Chebyshev series , where indicates that the first term is halved in the sum. The coefficients , for , of this series are determined directly from approximate values , for , of the function at the first of a set of Chebyshev points
The values are obtained by solving a set of simultaneous linear algebraic equations formed by applying a quadrature formula (equivalent to the scheme of Clenshaw and Curtis (1960)) to the integral equation at each of the above points.
In general . However, advantage may be taken of any prior knowledge of the symmetry of . Thus if is symmetric (i.e., even) about the mid-point of the range , it may be approximated by an even Chebyshev series with . Similarly, if is anti-symmetric (i.e., odd) about the mid-point of the range of integration, it may be approximated by an odd Chebyshev series with .
4References
Clenshaw C W and Curtis A R (1960) A method for numerical integration on an automatic computer Numer. Math.2 197–205
El–Gendi S E (1969) Chebyshev solution of differential, integral and integro-differential equations Comput. J.12 282–287
5Arguments
1: – real (Kind=nag_wp) Function, supplied by the user.External Procedure
k must compute the value of the kernel of the integral equation over the square , .
On entry: the values of and at which is to be calculated.
k must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d05abf is called. Arguments denoted as Input must not be changed by this procedure.
Note:k should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d05abf. If your code inadvertently does return any NaNs or infinities, d05abf is likely to produce unexpected results.
2: – real (Kind=nag_wp) Function, supplied by the user.External Procedure
g must compute the value of the function of the integral equation in the interval .
On entry: the value of at which is to be calculated.
g must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which d05abf is called. Arguments denoted as Input must not be changed by this procedure.
Note:g should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by d05abf. If your code inadvertently does return any NaNs or infinities, d05abf is likely to produce unexpected results.
3: – Real (Kind=nag_wp)Input
On entry: the value of the parameter of the integral equation.
4: – Real (Kind=nag_wp)Input
On entry: , the lower limit of integration.
5: – Real (Kind=nag_wp)Input
On entry: , the upper limit of integration.
Constraint:
.
6: – LogicalInput
On entry: indicates whether it is known that the solution is odd or even about the mid-point of the range of integration. If odorev is .TRUE. then an odd or even solution is sought depending upon the value of ev.
7: – LogicalInput
On entry: is ignored if odorev is .FALSE.. Otherwise, if ev is .TRUE., an even solution is sought, whilst if ev is .FALSE., an odd solution is sought.
8: – IntegerInput
On entry: the number of terms in the Chebyshev series which approximates the solution .
Constraint:
.
9: – Real (Kind=nag_wp) arrayWorkspace
10: – Real (Kind=nag_wp) arrayWorkspace
11: – Real (Kind=nag_wp) arrayWorkspace
12: – IntegerInput
On entry: the first dimension of the arrays cm and f1 and the second dimension of the array cm as declared in the (sub)program from which d05abf is called.
Constraint:
.
13: – IntegerInput
On entry: the second dimension of the array wk as declared in the (sub)program from which d05abf is called. The value .
14: – Real (Kind=nag_wp) arrayOutput
On exit: the approximate values
, for , of the function at the first n of Chebyshev points (see Section 3), where
if and .
if and .
if .
15: – Real (Kind=nag_wp) arrayOutput
On exit: the coefficients
, for , of the Chebyshev series approximation to . When odorev is .TRUE., this series contains polynomials of even order only or of odd order only, according to ev being .TRUE. or .FALSE. respectively.
16: – IntegerInput/Output
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. 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:
On entry, and .
Constraint: .
On entry, .
Constraint: .
A failure has occurred due to proximity of an eigenvalue.
In general, if lambda is near an eigenvalue of the integral equation, the corresponding matrix will be nearly singular. In the special case, , the matrix reduces to a zero-valued number.
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
No explicit error estimate is provided by the routine but it is possible to obtain a good indication of the accuracy of the solution either
(i)by examining the size of the later Chebyshev coefficients , or
(ii)by comparing the coefficients or the function values for two or more values of n.
8Parallelism and Performance
d05abf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
d05abf 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
The time taken by d05abf depends upon the value of n and upon the complexity of the kernel function .
10Example
This example solves Love's equation:
It will solve the slightly more general equation:
where . The values are used below.
It is evident from the symmetry of the given equation that is an even function. Advantage is taken of this fact both in the application of d05abf, to obtain the and the , and in subsequent applications of c06dcf to obtain at selected points.