NAG Library Routine Document
D05AAF
1 Purpose
D05AAF solves a linear, nonsingular Fredholm equation of the second kind with a split kernel.
2 Specification
SUBROUTINE D05AAF ( |
LAMBDA, A, B, K1, K2, G, F, C, N, IND, W1, W2, WD, LDW1, LDW2, IFAIL) |
INTEGER |
N, IND, LDW1, LDW2, IFAIL |
REAL (KIND=nag_wp) |
LAMBDA, A, B, K1, K2, G, F(N), C(N), W1(LDW1,LDW2), W2(LDW2,4), WD(LDW2) |
EXTERNAL |
K1, K2, G |
|
3 Description
D05AAF solves an integral equation of the form
for
, when the kernel
is defined in two parts:
for
and
for
. The method used is that of
El–Gendi (1969) for which, it is important to note, each of the functions
and
must be defined, smooth and nonsingular, for all
and
in the interval
.
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 simultaneous linear algebraic equations formed by applying a quadrature formula (equivalent to the scheme of
Clenshaw and Curtis (1960)) to the integral equation at the above points.
In general . However, if the kernel is centro-symmetric in the interval , i.e., if , then the routine is designed to take advantage of this fact in the formation and solution of the algebraic equations. In this case, symmetry in the function implies symmetry in the function . In particular, if is even about the mid-point of the range of integration, then so also is , which may be approximated by an even Chebyshev series with . Similarly, if is odd about the mid-point then may be approximated by an odd series with .
4 References
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
5 Parameters
- 1: – REAL (KIND=nag_wp)Input
-
On entry: the value of the parameter of the integral equation.
- 2: – REAL (KIND=nag_wp)Input
-
On entry: , the lower limit of integration.
- 3: – REAL (KIND=nag_wp)Input
-
On entry: , the upper limit of integration.
Constraint:
.
- 4: – REAL (KIND=nag_wp) FUNCTION, supplied by the user.External Procedure
-
K1 must evaluate the kernel
of the integral equation for
.
The specification of
K1 is:
- 1: – REAL (KIND=nag_wp)Input
- 2: – REAL (KIND=nag_wp)Input
-
On entry: the values of and at which is to be evaluated.
K1 must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which D05AAF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 5: – REAL (KIND=nag_wp) FUNCTION, supplied by the user.External Procedure
-
K2 must evaluate the kernel
of the integral equation for
.
The specification of
K2 is:
- 1: – REAL (KIND=nag_wp)Input
- 2: – REAL (KIND=nag_wp)Input
-
On entry: the values of and at which is to be evaluated.
K2 must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which D05AAF is called. Parameters denoted as
Input must
not be changed by this procedure.
Note that the functions and must be defined, smooth and nonsingular for all and in the interval [].
- 6: – REAL (KIND=nag_wp) FUNCTION, supplied by the user.External Procedure
-
G must evaluate the function
for
.
The specification of
G is:
- 1: – REAL (KIND=nag_wp)Input
-
On entry: the values of at which is to be evaluated.
G must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which D05AAF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 7: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the approximate values
, for
, of
evaluated at the first
N of
Chebyshev points
, (see
Section 3).
If or , .
If , .
If , .
- 8: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the coefficients
, for
, of the Chebyshev series approximation to
.
If this series contains polynomials of odd order only and if the series contains even order polynomials only.
- 9: – INTEGERInput
-
On entry: the number of terms in the Chebyshev series required to approximate .
Constraint:
.
- 10: – INTEGERInput
-
On entry: determines the forms of the kernel,
, and the function
.
- is not centro-symmetric (or no account is to be taken of centro-symmetry).
- is centro-symmetric and is odd.
- is centro-symmetric and is even.
- is centro-symmetric but is neither odd nor even.
Constraint:
, , or .
- 11: – REAL (KIND=nag_wp) arrayWorkspace
- 12: – REAL (KIND=nag_wp) arrayWorkspace
- 13: – REAL (KIND=nag_wp) arrayWorkspace
-
- 14: – INTEGERInput
-
On entry: the first dimension of the array
W1 as declared in the (sub)program from which D05AAF is called.
Constraint:
.
- 15: – INTEGERInput
-
On entry: the second dimension of the array
W1 and the first dimension of the array
W2 and the dimension of the array
WD as declared in the (sub)program from which D05AAF is called.
Constraint:
.
- 16: – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. 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
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, 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).
Errors or warnings detected by the routine:
-
-
A failure has occurred due to proximity to 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 3.8 in the Essential Introduction for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.7 in the Essential Introduction for further information.
Dynamic memory allocation failed.
See
Section 3.6 in the Essential Introduction for further information.
7 Accuracy
No explicit error estimate is provided by the routine but it is usually 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. |
8 Parallelism and Performance
D05AAF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
D05AAF 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.
The time taken by D05AAF increases with
N.
This routine may be used to solve an equation with a continuous kernel by defining
K1 and
K2 to be identical.
This routine may also be used to solve a Volterra equation by defining
K2 (or
K1) to be identically zero.
10 Example
This example solves the equation
where
Five terms of the Chebyshev series are sought, taking advantage of the centro-symmetry of the
and even nature of
about the mid-point of the range
.
The approximate solution at the point
is calculated by calling
C06DCF.
10.1 Program Text
Program Text (d05aafe.f90)
10.2 Program Data
None.
10.3 Program Results
Program Results (d05aafe.r)