for $a\le x\le b$, when the kernel $k$ is defined in two parts: $k={k}_{1}$ for $a\le s\le x$ and $k={k}_{2}$ for $x<s\le b$. The method used is that of El–Gendi (1969) for which, it is important to note, each of the functions ${k}_{1}$ and ${k}_{2}$ must be defined, smooth and nonsingular, for all $x$ and $s$ in the interval $[a,b]$.
An approximation to the solution $f\left(x\right)$ is found in the form of an $n$ term Chebyshev series $\underset{i=1}{\overset{n}{{\sum}^{\prime}}}}{c}_{i}{T}_{i}\left(x\right)$, where ${}^{\prime}$ indicates that the first term is halved in the sum. The coefficients ${c}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,n$, of this series are determined directly from approximate values ${f}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,n$, of the function $f\left(x\right)$ at the first $n$ of a set of $m+1$ Chebyshev points:
The values ${f}_{i}$ 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 $m=n-1$. However, if the kernel $k$ is centro-symmetric in the interval $[a,b]$, i.e., if $k(x,s)=k(a+b-x,a+b-s)$, 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 $g\left(x\right)$ implies symmetry in the function $f\left(x\right)$. In particular, if $g\left(x\right)$ is even about the mid-point of the range of integration, then so also is $f\left(x\right)$, which may be approximated by an even Chebyshev series with $m=2n-1$. Similarly, if $g\left(x\right)$ is odd about the mid-point then $f\left(x\right)$ may be approximated by an odd series with $m=2n$.
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: $\mathbf{lambda}$ – doubleInput
On entry: the value of the parameter $\lambda $ of the integral equation.
2: $\mathbf{a}$ – doubleInput
On entry: $a$, the lower limit of integration.
3: $\mathbf{b}$ – doubleInput
On entry: $b$, the upper limit of integration.
Constraint:
${\mathbf{b}}>{\mathbf{a}}$.
4: $\mathbf{n}$ – IntegerInput
On entry: the number of terms in the Chebyshev series required to approximate $f\left(x\right)$.
Constraint:
${\mathbf{n}}\ge 1$.
5: $\mathbf{k1}$ – function, supplied by the userExternal Function
k1 must evaluate the kernel $k(x,s)={k}_{1}(x,s)$ of the integral equation for $a\le s\le x$.
On entry: the values of $x$ and $s$ at which ${k}_{1}(x,s)$ is to be evaluated.
3: $\mathbf{comm}$ – 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: $\mathbf{k2}$ – function, supplied by the userExternal Function
k2 must evaluate the kernel $k(x,s)={k}_{2}(x,s)$ of the integral equation for $x<s\le b$.
On entry: the values of $x$ and $s$ at which ${k}_{2}(x,s)$ is to be evaluated.
3: $\mathbf{comm}$ – 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 ${k}_{1}$ and ${k}_{2}$ must be defined, smooth and nonsingular for all $x$ and $s$ in the interval [$a,b$].
7: $\mathbf{g}$ – function, supplied by the userExternal Function
g must evaluate the function $g\left(x\right)$ for $a\le x\le b$.
On entry: the values of $x$ at which $g\left(x\right)$ is to be evaluated.
2: $\mathbf{comm}$ – 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: $\mathbf{kform}$ – Nag_KernelFormInput
On entry: determines the forms of the kernel, $k(x,s)$, and the function $g\left(x\right)$.
${\mathbf{kform}}=\mathrm{Nag\_NoCentroSymm}$
$k(x,s)$ is not centro-symmetric (or no account is to be taken of centro-symmetry).
${\mathbf{kform}}=\mathrm{Nag\_CentroSymmOdd}$
$k(x,s)$ is centro-symmetric and $g\left(x\right)$ is odd.
${\mathbf{kform}}=\mathrm{Nag\_CentroSymmEven}$
$k(x,s)$ is centro-symmetric and $g\left(x\right)$ is even.
On exit: the approximate values
${f}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$, of $f\left(x\right)$ evaluated at the first n of $m+1$ Chebyshev points ${x}_{i}$, (see Section 3).
If ${\mathbf{kform}}=\mathrm{Nag\_NoCentroSymm}$ or $\mathrm{Nag\_CentroSymmNeither}$, $m={\mathbf{n}}-1$.
If ${\mathbf{kform}}=\mathrm{Nag\_CentroSymmOdd}$, $m=2\times {\mathbf{n}}$.
If ${\mathbf{kform}}=\mathrm{Nag\_CentroSymmEven}$, $m=2\times {\mathbf{n}}-1$.
On exit: the coefficients
${c}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$, of the Chebyshev series approximation to $f\left(x\right)$.
If ${\mathbf{kform}}=\mathrm{Nag\_CentroSymmOdd}$ this series contains polynomials of odd order only and if ${\mathbf{kform}}=\mathrm{Nag\_CentroSymmEven}$ the series contains even order polynomials only.
11: $\mathbf{comm}$ – Nag_Comm *
The NAG communication argument (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
12: $\mathbf{fail}$ – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error 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 $\u27e8\mathit{\text{value}}\u27e9$ 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, $m=1$, the matrix reduces to a zero-valued number.
NE_INT
On entry, ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{n}}\ge 1$.
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, ${\mathbf{a}}=\u27e8\mathit{\text{value}}\u27e9$ and ${\mathbf{b}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{b}}>{\mathbf{a}}$.
7Accuracy
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 ${c}_{i}$, or
(ii)by comparing the coefficients ${c}_{i}$ or the function values ${f}_{i}$ for two or more values of n.
8Parallelism 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.
Five terms of the Chebyshev series are sought, taking advantage of the centro-symmetry of the $k(x,s)$ and even nature of $g\left(x\right)$ about the mid-point of the range $[0,1]$.
The approximate solution at the point $x=0.1$ is calculated by calling c06dcc.