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_abel1_weak (d05be)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_inteq_abel1_weak (d05be) computes the solution of a weakly singular nonlinear convolution Volterra–Abel integral equation of the first kind using a fractional Backward Differentiation Formulae (BDF) method.

Syntax

[yn, work, ifail] = d05be(ck, cf, cg, initwt, tlim, yn, work, 'iorder', iorder, 'tolnl', tolnl, 'nmesh', nmesh)
[yn, work, ifail] = nag_inteq_abel1_weak(ck, cf, cg, initwt, tlim, yn, work, 'iorder', iorder, 'tolnl', tolnl, 'nmesh', nmesh)
Note: the interface to this routine has changed since earlier releases of the toolbox:
At Mark 22: lwk was removed from the interface

Description

nag_inteq_abel1_weak (d05be) computes the numerical solution of the weakly singular convolution Volterra–Abel integral equation of the first kind
ft+1π0tkt-s t-s gs,ysds=0,  0tT. (1)
Note the constant 1π  in (1). It is assumed that the functions involved in (1) are sufficiently smooth and if
ft=tβwt  with  β>-12​ and ​wt​ smooth, (2)
then the solution yt is unique and has the form yt=tβ-1/2zt, (see Lubich (1987)). It is evident from (1) that f0=0. You are required to provide the value of yt at t=0. If y0 is unknown, Further Comments gives a description of how an approximate value can be obtained.
The function uses a fractional BDF linear multi-step method selected by you to generate a family of quadrature rules (see nag_inteq_abel_weak_weights (d05by)). The BDF methods available in nag_inteq_abel1_weak (d05be) are of orders 4, 5 and 6 (=p say). For a description of the theoretical and practical background related to these methods we refer to Lubich (1987) and to Baker and Derakhshan (1987) and Hairer et al. (1988) respectively.
The algorithm is based on computing the solution yt in a step-by-step fashion on a mesh of equispaced points. The size of the mesh is given by T/N-1, N being the number of points at which the solution is sought. These methods require 2p-2 starting values which are evaluated internally. The computation of the lag term arising from the discretization of (1) is performed by fast Fourier transform (FFT) techniques when N>32+2p-1, and directly otherwise. The function does not provide an error estimate and you are advised to check the behaviour of the solution with a different value of N. An option is provided which avoids the re-evaluation of the fractional weights when nag_inteq_abel1_weak (d05be) is to be called several times (with the same value of N) within the same program with different functions.

References

Baker C T H and Derakhshan M S (1987) FFT techniques in the numerical solution of convolution equations J. Comput. Appl. Math. 20 5–24
Gorenflo R and Pfeiffer A (1991) On analysis and discretization of nonlinear Abel integral equations of first kind Acta Math. Vietnam 16 211–262
Hairer E, Lubich Ch and Schlichte M (1988) Fast numerical solution of weakly singular Volterra integral equations J. Comput. Appl. Math. 23 87–98
Lubich Ch (1987) Fractional linear multistep methods for Abel–Volterra integral equations of the first kind IMA J. Numer. Anal 7 97–106

Parameters

Compulsory Input Parameters

1:     ck – function handle or string containing name of m-file
ck must evaluate the kernel kt of the integral equation (1).
[result] = ck(t)

Input Parameters

1:     t – double scalar
t, the value of the independent variable.

Output Parameters

1:     result – double scalar
The value of kt evaluated at t.
2:     cf – function handle or string containing name of m-file
cf must evaluate the function ft in (1).
[result] = cf(t)

Input Parameters

1:     t – double scalar
t, the value of the independent variable.

Output Parameters

1:     result – double scalar
The value of ft evaluated at t.
3:     cg – function handle or string containing name of m-file
cg must evaluate the function gs,ys in (1).
[result] = cg(s, y)

Input Parameters

1:     s – double scalar
s, the value of the independent variable.
2:     y – double scalar
The value of the solution y at the point s.

Output Parameters

1:     result – double scalar
The value of gs,ys evaluated at s and y.
4:     initwt – string (length ≥ 1)
If the fractional weights required by the method need to be calculated by the function then set initwt='I' (Initial call).
If initwt='S' (Subsequent call), the function assumes the fractional weights have been computed by a previous call and are stored in work.
Constraint: initwt='I' or 'S'.
Note: when nag_inteq_abel1_weak (d05be) is re-entered with a value of initwt='S', the values of nmesh, iorder and the contents of work must not be changed
5:     tlim – double scalar
The final point of the integration interval, T.
Constraint: tlim>10×machine precision.
6:     ynnmesh – double array
yn1 must contain the value of yt at t=0 (see Further Comments).
7:     worklwk – double array
lwk, the dimension of the array, must satisfy the constraint lwk2×iorder+6×nmesh+8×iorder2-16×iorder+1.
If initwt='S', work must contain fractional weights computed by a previous call of nag_inteq_abel1_weak (d05be) (see description of initwt).

Optional Input Parameters

1:     iorder int64int32nag_int scalar
Default: 4
p, the order of the BDF method to be used.
Constraint: 4iorder6.
2:     tolnl – double scalar
Suggested value: tolnl=ε where ε is the machine precision.
Default: machine precision
The accuracy required for the computation of the starting value and the solution of the nonlinear equation at each step of the computation (see Further Comments).
Constraint: tolnl>10×machine precision.
3:     nmesh int64int32nag_int scalar
Default: the dimension of the array yn.
N, the number of equispaced points at which the solution is sought.
Constraint: nmesh=2m+2×iorder-1, where m1.

Output Parameters

1:     ynnmesh – double array
yni contains the approximate value of the true solution yt at the point t=i-1×h, for i=1,2,,nmesh, where h=tlim/nmesh-1.
2:     worklwk – double array
lwk=2×iorder+6×nmesh+8×iorder2-16×iorder+1.
Contains fractional weights which may be used by a subsequent call of nag_inteq_abel1_weak (d05be).
3:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
On entry,iorder<4 or iorder>6,
ortlim10×machine precision,
orinitwt'I' or 'S',
orinitwt='S' on the first call to nag_inteq_abel1_weak (d05be),
ortolnl10×machine precision,
ornmesh2m+2×iorder-1,m1,
orlwk<2×iorder+6×nmesh+8×iorder2-16×iorder+1.
   ifail=2
The function cannot compute the 2p-2 starting values due to an error in solving the system of nonlinear equations. Relaxing the value of tolnl and/or increasing the value of nmesh may overcome this problem (see Further Comments for further details).
   ifail=3
The function cannot compute the solution at a specific step due to an error in the solution of the single nonlinear equation (3). Relaxing the value of tolnl and/or increasing the value of nmesh may overcome this problem (see Further Comments for further details).
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

The accuracy depends on nmesh and tolnl, the theoretical behaviour of the solution of the integral equation and the interval of integration. The value of tolnl controls the accuracy required for computing the starting values and the solution of (3) at each step of computation. This value can affect the accuracy of the solution. However, for most problems, the value of ε, where ε is the machine precision, should be sufficient.

Further Comments

Also when solving (1) the initial value y0 is required. This value may be computed from the limit relation (see Gorenflo and Pfeiffer (1991))
-2π k0 g 0,y0 = lim t0 ft t . (3)
If the value of the above limit is known then by solving the nonlinear equation (3) an approximation to y0 can be computed. If the value of the above limit is not known, an approximation should be provided. Following the analysis presented in Gorenflo and Pfeiffer (1991), the following pth-order approximation can be used:
lim t0 ft t fhphp/2 . (4)
However, it must be emphasized that the approximation in (4) may result in an amplification of the rounding errors and hence you are advised (if possible) to determine lim t0 ft t  by analytical methods.
Also when solving (1), initially, nag_inteq_abel1_weak (d05be) computes the solution of a system of nonlinear equation for obtaining the 2p-2 starting values. nag_roots_sys_func_rcomm (c05qd) is used for this purpose. If a failure with ifail=2 occurs (corresponding to an error exit from nag_roots_sys_func_rcomm (c05qd)), you are advised to either relax the value of tolnl or choose a smaller step size by increasing the value of nmesh. Once the starting values are computed successfully, the solution of a nonlinear equation of the form
Yn-αgtn,Yn-Ψn=0, (5)
is required at each step of computation, where Ψn and α are constants. nag_inteq_abel1_weak (d05be) calls nag_roots_contfn_cntin_rcomm (c05ax) to find the root of this equation.
When a failure with ifail=3 occurs (which corresponds to an error exit from nag_roots_contfn_cntin_rcomm (c05ax)), you are advised to either relax the value of the tolnl or choose a smaller step size by increasing the value of nmesh.
If a failure with ifail=2 or 3 persists even after adjustments to tolnl and/or nmesh then you should consider whether there is a more fundamental difficulty. For example, the problem is ill-posed or the functions in (1) are not sufficiently smooth.

Example

We solve the following integral equations.
Example 1
The density of the probability that a Brownian motion crosses a one-sided moving boundary at before time t, satisfies the integral equation (see Hairer et al. (1988))
-1t exp 12-at2/t+0texp -12at-as2/t-s t-s ysds=0,  0t7.  
In the case of a straight line at=1+t, the exact solution is known to be
yt=12πt3 exp- 1+t 2/2t  
Example 2
In this example we consider the equation
-2log1+t+t 1+t +0t ys t-s ds= 0,   0t 5.  
The solution is given by yt=11+t .
In the above examples, the fourth-order BDF is used, and nmesh is set to 26+7.
function d05be_example


fprintf('d05be example results\n\n');

ck = @(t) exp(-0.5*t);
cf = @(t) -exp( -0.5*(1+t)^2/t)/sqrt(pi*t);
cg = @(s, y) y;
initwt = 'Initial';
tlim = 7;
nmesh = 71;
yn = zeros(nmesh,1);
work = zeros(1059, 1);
[yn, work, ifail] = d05be( ...
				 ck, cf, cg, initwt, tlim, yn, work);

h = tlim/double(nmesh-1);
fprintf('Example 1\n\n The stepsize h = %8.4f\n\n',h);
fprintf('     t        Approximate\n');
fprintf('                Solution\n');
t = [0:h:tlim];
sol = [t' yn];
solp = sol(6:5:nmesh,1:2);
fprintf('%8.4f%15.4f\n',solp');

sol1 = @(t)(exp(-(t+1).^2./(2*t))./(sqrt(2*pi)*t.^(3/2)));
[errmax,j] = max(yn - sol1(t)');
fprintf('\nThe maximum absolute error, %10.2e ',errmax);
fprintf(' occurred at t = %8.4f\nwith solution %8.4f\n\n',t(j), yn(j));

ck2 = @(t) sqrt(pi);
cf2 = @(t) -2*log(sqrt(1+t)+sqrt(t))/sqrt(1+t);
cg2 = @(s, y) y;
initwt = 'Subsequent';
tlim = 5;
yn(1) = 1;
[yn, work, ifail] = d05be( ...
			   ck2, cf2, cg2, initwt, tlim, yn, work);
h = tlim/double(nmesh-1);

fprintf('\n\nExample 2\n\n The stepsize h = %8.4f\n\n',h);
fprintf('     t        Approximate\n');
fprintf('                Solution\n');
t = [0:h:tlim];
sol = [t' yn];
solp = sol(8:7:nmesh,1:2);
fprintf('%8.4f%15.4f\n',solp');

sol2 = @(t)(1./(1+t));
[errmax,j] = max(yn - sol2(t)');
fprintf('\nThe maximum absolute error, %10.2e ',errmax);
fprintf(' occurred at t = %8.4f\nwith solution %8.4f\n\n',t(j), yn(j));


d05be example results

Example 1

 The stepsize h =   0.1000

     t        Approximate
                Solution
  0.5000         0.1191
  1.0000         0.0528
  1.5000         0.0265
  2.0000         0.0146
  2.5000         0.0086
  3.0000         0.0052
  3.5000         0.0033
  4.0000         0.0022
  4.5000         0.0014
  5.0000         0.0010
  5.5000         0.0007
  6.0000         0.0004
  6.5000         0.0003
  7.0000         0.0002

The maximum absolute error,   2.86e-03  occurred at t =   0.1000
with solution   0.0326



Example 2

 The stepsize h =   0.0714

     t        Approximate
                Solution
  0.5000         0.6667
  1.0000         0.5000
  1.5000         0.4000
  2.0000         0.3333
  2.5000         0.2857
  3.0000         0.2500
  3.5000         0.2222
  4.0000         0.2000
  4.5000         0.1818
  5.0000         0.1667

The maximum absolute error,   3.17e-06  occurred at t =   0.0714
with solution   0.9333


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–2015