PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_inteq_abel1_weak (d05be)
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
Note the constant
in
(1). It is assumed that the functions involved in
(1) are sufficiently smooth and if
then the solution
is unique and has the form
, (see
Lubich (1987)). It is evident from
(1) that
. You are required to provide the value of
at
. If
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
,
and
(
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
in a step-by-step fashion on a mesh of equispaced points. The size of the mesh is given by
,
being the number of points at which the solution is sought. These methods require
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
, 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
. 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
) 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:
– function handle or string containing name of m-file
-
ck must evaluate the kernel
of the integral equation
(1).
[result] = ck(t)
Input Parameters
- 1:
– double scalar
-
, the value of the independent variable.
Output Parameters
- 1:
– double scalar
-
The value of
evaluated at
t.
- 2:
– function handle or string containing name of m-file
-
cf must evaluate the function
in
(1).
[result] = cf(t)
Input Parameters
- 1:
– double scalar
-
, the value of the independent variable.
Output Parameters
- 1:
– double scalar
-
The value of
evaluated at
t.
- 3:
– function handle or string containing name of m-file
-
cg must evaluate the function
in
(1).
[result] = cg(s, y)
Input Parameters
- 1:
– double scalar
-
, the value of the independent variable.
- 2:
– double scalar
-
The value of the solution
at the point
s.
Output Parameters
- 1:
– double scalar
-
The value of
evaluated at
s and
y.
- 4:
– string (length ≥ 1)
-
If the fractional weights required by the method need to be calculated by the function then set
(
Initial call).
If
(
Subsequent call), the function assumes the fractional weights have been computed by a previous call and are stored in
work.
Constraint:
or
.
Note: when
nag_inteq_abel1_weak (d05be) is re-entered with a value of
, the values of
nmesh,
iorder and the contents of
work must not be changed
- 5:
– double scalar
-
The final point of the integration interval, .
Constraint:
.
- 6:
– double array
-
must contain the value of
at
(see
Further Comments).
- 7:
– double array
-
lwk, the dimension of the array, must satisfy the constraint
.
If
,
work must contain fractional weights computed by a previous call of
nag_inteq_abel1_weak (d05be) (see description of
initwt).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
Default:
, the order of the BDF method to be used.
Constraint:
.
- 2:
– double scalar
Suggested value:
where
is the
machine precision.
Default:
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:
.
- 3:
– int64int32nag_int scalar
-
Default:
the dimension of the array
yn.
, the number of equispaced points at which the solution is sought.
Constraint:
, where .
Output Parameters
- 1:
– double array
-
contains the approximate value of the true solution at the point , for , where .
- 2:
– double array
-
.
Contains fractional weights which may be used by a subsequent call of nag_inteq_abel1_weak (d05be).
- 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:
-
-
On entry, | or , |
or | , |
or | or , |
or | on the first call to nag_inteq_abel1_weak (d05be), |
or | , |
or | , |
or | . |
-
-
The function cannot compute the
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).
-
-
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).
-
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
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
is required. This value may be computed from the limit relation (see
Gorenflo and Pfeiffer (1991))
If the value of the above limit is known then by solving the nonlinear equation
(3) an approximation to
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
th-order approximation can be used:
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
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
starting values.
nag_roots_sys_func_rcomm (c05qd) is used for this purpose. If a failure with
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
is required at each step of computation, where
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
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
or
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
before time
, satisfies the integral equation (see
Hairer et al. (1988))
In the case of a straight line
, the exact solution is known to be
Example 2
In this example we consider the equation
The solution is given by
.
In the above examples, the fourth-order BDF is used, and
nmesh is set to
.
Open in the MATLAB editor:
d05be_example
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)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015