hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

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

[f, c, ifail] = d05aa(lambda, a, b, k1, k2, g, n, ind)
[f, c, ifail] = nag_inteq_fredholm2_split(lambda, a, b, k1, k2, g, n, ind)

Description

nag_inteq_fredholm2_split (d05aa) solves an integral equation of the form
b
f(x)λk(x,s)f(s)ds = g(x)
a
f(x)-λabk(x,s)f(s)ds=g(x)
for axbaxb, when the kernel kk is defined in two parts: k = k1k=k1 for asxasx and k = k2k=k2 for x < sbx<sb. The method used is that of El–Gendi (1969) for which, it is important to note, each of the functions k1k1 and k2k2 must be defined, smooth and nonsingular, for all xx and ss in the interval [a,b][a,b].
An approximation to the solution f(x)f(x) is found in the form of an nn term Chebyshev series i = 1nciTi(x)i=1nciTi(x), where  indicates that the first term is halved in the sum. The coefficients cici, for i = 1,2,,ni=1,2,,n, of this series are determined directly from approximate values fifi, for i = 1,2,,ni=1,2,,n, of the function f(x)f(x) at the first nn of a set of m + 1m+1 Chebyshev points:
xi = (1/2)(a + b + (ba)cos[(i1)π / m]),  i = 1,2,,m + 1.
xi=12(a+b+(b-a)cos[(i-1)π/m]),  i=1,2,,m+1.
The values fifi 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 = n1m=n-1. However, if the kernel kk is centro-symmetric in the interval [a,b][a,b], i.e., if k(x,s) = k(a + bx,a + bs)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(x)g(x) implies symmetry in the function f(x)f(x). In particular, if g(x)g(x) is even about the mid-point of the range of integration, then so also is f(x)f(x), which may be approximated by an even Chebyshev series with m = 2n1m=2n-1. Similarly, if g(x)g(x) is odd about the mid-point then f(x)f(x) may be approximated by an odd series with m = 2nm=2n.

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:     lambda – double scalar
The value of the parameter λλ of the integral equation.
2:     a – double scalar
aa, the lower limit of integration.
3:     b – double scalar
bb, the upper limit of integration.
Constraint: b > ab>a.
4:     k1 – function handle or string containing name of m-file
k1 must evaluate the kernel k(x,s) = k1(x,s)k(x,s)=k1(x,s) of the integral equation for asxasx.
[result] = k1(x, s)

Input Parameters

1:     x – double scalar
2:     s – double scalar
The values of xx and ss at which k1(x,s)k1(x,s) is to be evaluated.

Output Parameters

1:     result – double scalar
The result of the function.
5:     k2 – function handle or string containing name of m-file
k2 must evaluate the kernel k(x,s) = k2(x,s)k(x,s)=k2(x,s) of the integral equation for x < sbx<sb.
[result] = k2(x, s)

Input Parameters

1:     x – double scalar
2:     s – double scalar
The values of xx and ss at which k2(x,s)k2(x,s) is to be evaluated.

Output Parameters

1:     result – double scalar
The result of the function.
Note that the functions k1k1 and k2k2 must be defined, smooth and nonsingular for all xx and ss in the interval [a,ba,b].
6:     g – function handle or string containing name of m-file
g must evaluate the function g(x)g(x) for axbaxb.
[result] = g(x)

Input Parameters

1:     x – double scalar
The values of xx at which g(x)g(x) is to be evaluated.

Output Parameters

1:     result – double scalar
The result of the function.
7:     n – int64int32nag_int scalar
The number of terms in the Chebyshev series required to approximate f(x)f(x).
Constraint: n1n1.
8:     ind – int64int32nag_int scalar
Determines the forms of the kernel, k(x,s)k(x,s), and the function g(x)g(x).
ind = 0ind=0
k(x,s)k(x,s) is not centro-symmetric (or no account is to be taken of centro-symmetry).
ind = 1ind=1
k(x,s)k(x,s) is centro-symmetric and g(x)g(x) is odd.
ind = 2ind=2
k(x,s)k(x,s) is centro-symmetric and g(x)g(x) is even.
ind = 3ind=3
k(x,s)k(x,s) is centro-symmetric but g(x)g(x) is neither odd nor even.
Constraint: ind = 0ind=0, 11, 22 or 33.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

w1 w2 wd ldw1 ldw2

Output Parameters

1:     f(n) – double array
The approximate values fifi, for i = 1,2,,ni=1,2,,n, of f(x)f(x) evaluated at the first n of m + 1m+1 Chebyshev points xixi, (see Section [Description]).
If ind = 0ind=0 or 33, m = n1m=n-1.
If ind = 1ind=1, m = 2 × nm=2×n.
If ind = 2ind=2, m = 2 × n1m=2×n-1.
2:     c(n) – double array
The coefficients cici, for i = 1,2,,ni=1,2,,n, of the Chebyshev series approximation to f(x)f(x).
If ind = 1ind=1 this series contains polynomials of odd order only and if ind = 2ind=2 the series contains even order polynomials only.
3:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
On entry,abab or n < 1n<1.
  ifail = 2ifail=2
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, m = 1m=1, the matrix reduces to a zero-valued number.

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 cici, or
(ii) by comparing the coefficients cici or the function values fifi 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

function nag_inteq_fredholm2_split_example
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] = nag_inteq_fredholm2_split(lambda, a, b, k1, k2, g, n, ind)
 

f =

    0.0000
    0.0946
    0.3593
    0.7071
    0.9630


c =

    0.9440
   -0.4994
    0.0280
   -0.0006
    0.0000


ifail =

                    0


function d05aa_example
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)
 

f =

    0.0000
    0.0946
    0.3593
    0.7071
    0.9630


c =

    0.9440
   -0.4994
    0.0280
   -0.0006
    0.0000


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013