PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_inteq_fredholm2_split (d05aa)
Purpose
nag_inteq_fredholm2_split (d05aa) solves a linear, nonsingular Fredholm equation of the second kind with a split kernel.
Syntax
Description
nag_inteq_fredholm2_split (d05aa) 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 .
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
Parameters
Compulsory Input Parameters
- 1:
– double scalar
-
The value of the parameter of the integral equation.
- 2:
– double scalar
-
, the lower limit of integration.
- 3:
– double scalar
-
, the upper limit of integration.
Constraint:
.
- 4:
– function handle or string containing name of m-file
-
k1 must evaluate the kernel
of the integral equation for
.
[result] = k1(x, s)
Input Parameters
- 1:
– double scalar
- 2:
– double scalar
-
The values of and at which is to be evaluated.
Output Parameters
- 1:
– double scalar
-
The value of the kernel
evaluated at
x and
s.
- 5:
– function handle or string containing name of m-file
-
k2 must evaluate the kernel
of the integral equation for
.
[result] = k2(x, s)
Input Parameters
- 1:
– double scalar
- 2:
– double scalar
-
The values of and at which is to be evaluated.
Output Parameters
- 1:
– double scalar
-
The value of the kernel
evaluated at
x and
s.
Note that the functions and must be defined, smooth and nonsingular for all and in the interval [].
- 6:
– function handle or string containing name of m-file
-
g must evaluate the function
for
.
[result] = g(x)
Input Parameters
- 1:
– double scalar
-
The values of at which is to be evaluated.
Output Parameters
- 1:
– double scalar
-
The value of
evaluated at
x.
- 7:
– int64int32nag_int scalar
-
The number of terms in the Chebyshev series required to approximate .
Constraint:
.
- 8:
– int64int32nag_int scalar
-
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 .
Optional Input Parameters
None.
Output Parameters
- 1:
– double array
-
The approximate values
, for
, of
evaluated at the first
n of
Chebyshev points
, (see
Description).
If or , .
If , .
If , .
- 2:
– double array
-
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.
- 3:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
-
-
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.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
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. |
Further Comments
The time taken by
nag_inteq_fredholm2_split (d05aa) 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.
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
nag_sum_chebyshev (c06dc).
Open in the MATLAB editor:
d05aa_example
function d05aa_example
fprintf('d05aa example results\n\n');
lambda = 1;
a = 0;
b = 1;
g = @(x) sin(pi*x)*(1-1/(pi*pi));
k1 = @(x, s) s*(1-x);
k2 = @(x, s) x*(1-s);
n = int64(5);
ind = int64(2);
[f, c, ifail] = d05aa(lambda, a, b, k1, k2, g, n, ind);
xval = 0.1;
s = int64(2);
[res, ifail] = c06dc(xval, a, b, c, s);
fprintf('Kernel is centro-symmetric and G is even so the solution is even\n')
fprintf('\nChebyshev coefficients:\n');
fprintf('%14.4f',c);
fprintf('\n\n x = %5.2f Ans = %7.4f\n',xval,res);
d05aa example results
Kernel is centro-symmetric and G is even so the solution is even
Chebyshev coefficients:
0.9440 -0.4994 0.0280 -0.0006 0.0000
x = 0.10 Ans = 0.3090
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015