NAG CL Interface
d05aac (fredholm2_split)
1
Purpose
d05aac solves a linear, nonsingular Fredholm equation of the second kind with a split kernel.
2
Specification
void |
d05aac (double lambda,
double a,
double b,
Integer n,
double |
(*k1)(double x,
double s,
Nag_Comm *comm),
|
|
double |
(*k2)(double x,
double s,
Nag_Comm *comm),
|
|
double |
(*g)(double x,
Nag_Comm *comm),
|
|
Nag_KernelForm kform,
double f[],
double c[],
Nag_Comm *comm,
NagError *fail) |
|
The function may be called by the names: d05aac or nag_inteq_fredholm2_split.
3
Description
d05aac 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 function 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
Arguments
-
1:
– double
Input
-
On entry: the value of the parameter of the integral equation.
-
2:
– double
Input
-
On entry: , the lower limit of integration.
-
3:
– double
Input
-
On entry: , the upper limit of integration.
Constraint:
.
-
4:
– Integer
Input
-
On entry: the number of terms in the Chebyshev series required to approximate .
Constraint:
.
-
5:
– function, supplied by the user
External Function
-
k1 must evaluate the kernel
of the integral equation for
.
The specification of
k1 is:
double |
k1 (double x,
double s,
Nag_Comm *comm)
|
|
-
1:
– double
Input
-
2:
– double
Input
-
On entry: the values of and at which is to be evaluated.
-
3:
– Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to
k1.
- user – double *
- iuser – Integer *
- p – Pointer
The type Pointer will be
void *. Before calling
d05aac you may allocate memory and initialize these pointers with various quantities for use by
k1 when called from
d05aac (see
Section 3.1.1 in the Introduction to the NAG Library CL Interface).
Note: k1 should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by
d05aac. If your code inadvertently
does return any NaNs or infinities,
d05aac is likely to produce unexpected results.
-
6:
– function, supplied by the user
External Function
-
k2 must evaluate the kernel
of the integral equation for
.
The specification of
k2 is:
double |
k2 (double x,
double s,
Nag_Comm *comm)
|
|
-
1:
– double
Input
-
2:
– double
Input
-
On entry: the values of and at which is to be evaluated.
-
3:
– Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to
k2.
- user – double *
- iuser – Integer *
- p – Pointer
The type Pointer will be
void *. Before calling
d05aac you may allocate memory and initialize these pointers with various quantities for use by
k2 when called from
d05aac (see
Section 3.1.1 in the Introduction to the NAG Library CL Interface).
Note: k2 should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by
d05aac. If your code inadvertently
does return any NaNs or infinities,
d05aac is likely to produce unexpected results.
Note that the functions and must be defined, smooth and nonsingular for all and in the interval [].
-
7:
– function, supplied by the user
External Function
-
g must evaluate the function
for
.
The specification of
g is:
double |
g (double x,
Nag_Comm *comm)
|
|
-
1:
– double
Input
-
On entry: the values of at which is to be evaluated.
-
2:
– Nag_Comm *
Pointer to structure of type Nag_Comm; the following members are relevant to
g.
- user – double *
- iuser – Integer *
- p – Pointer
The type Pointer will be
void *. Before calling
d05aac you may allocate memory and initialize these pointers with various quantities for use by
g when called from
d05aac (see
Section 3.1.1 in the Introduction to the NAG Library CL Interface).
Note: g should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by
d05aac. If your code inadvertently
does return any NaNs or infinities,
d05aac is likely to produce unexpected results.
-
8:
– Nag_KernelForm
Input
-
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 .
-
9:
– double
Output
-
On exit: the approximate values
, for
, of
evaluated at the first
n of
Chebyshev points
, (see
Section 3).
If or , .
If , .
If , .
-
10:
– double
Output
-
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.
-
11:
– Nag_Comm *
-
The NAG communication argument (see
Section 3.1.1 in the Introduction to the NAG Library CL Interface).
-
12:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_EIGENVALUES
-
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.
- NE_INT
-
On entry, .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_REAL_2
-
On entry, and .
Constraint: .
7
Accuracy
No explicit error estimate is provided by the function 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
d05aac is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
d05aac 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 function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken by
d05aac increases with
n.
This function may be used to solve an equation with a continuous kernel by defining
k1 and
k2 to be identical.
This function 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
c06dcc.
10.1
Program Text
10.2
Program Data
None.
10.3
Program Results