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_abel2_weak (d05bd)

Purpose

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

Syntax

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

Description

nag_inteq_abel2_weak (d05bd) computes the numerical solution of the weakly singular convolution Volterra–Abel integral equation of the second kind
t
y(t) = f(t) + 1/(sqrt(π))(k(ts))/(sqrt(ts))g(s,y(s))ds,  0tT.
0
y(t) = f(t) + 1π 0t k(t-s) t-s g (s,y(s)) ds ,   0tT .
(1)
Note the constant 1/(sqrt(π))1π in (1). It is assumed that the functions involved in (1) are sufficiently smooth.
The function uses a fractional BDF linear multi-step method to generate a family of quadrature rules (see nag_inteq_abel_weak_weights (d05by)). The BDF methods available in nag_inteq_abel2_weak (d05bd) are of orders 44, 55 and 66 ( = p=p say). For a description of the theoretical and practical background to these methods we refer to Lubich (1985) and to Baker and Derakhshan (1987) and Hairer et al. (1988) respectively.
The algorithm is based on computing the solution y(t)y(t) in a step-by-step fashion on a mesh of equispaced points. The size of the mesh is given by T / (N1)T/(N-1), NN being the number of points at which the solution is sought. These methods require 2p12p-1 (including y(0)y(0)) 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 + 2p1N>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 NN. An option is provided which avoids the re-evaluation of the fractional weights when nag_inteq_abel2_weak (d05bd) is to be called several times (with the same value of NN) within the same program unit 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
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 (1985) Fractional linear multistep methods for Abel–Volterra integral equations of the second kind Math. Comput. 45 463–469

Parameters

Compulsory Input Parameters

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

Input Parameters

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

Output Parameters

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

Input Parameters

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

Output Parameters

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

Input Parameters

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

Output Parameters

1:     result – double scalar
The result of the function.
4:     initwt – string (length ≥ 1)
If the fractional weights required by the method need to be calculated by the function then set initwt = 'I'initwt='I' (Initial call).
If initwt = 'S'initwt='S' (Subsequent call), the function assumes the fractional weights have been computed on a previous call and are stored in work.
Constraint: initwt = 'I'initwt='I' or 'S''S'.
Note: when nag_inteq_abel2_weak (d05bd) is re-entered with the value of initwt = 'S'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, TT.
Constraint: tlim > 10 × machine precisiontlim>10×machine precision.
6:     nmesh – int64int32nag_int scalar
NN, the number of equispaced points at which the solution is sought.
Constraint: nmesh = 2m + 2 × iorder1nmesh=2m+2×iorder-1, where m1m1.
7:     work(lwk) – double array
lwk, the dimension of the array, must satisfy the constraint lwk(2 × iorder + 6) × nmesh + 8 × iorder216 × iorder + 1lwk(2×iorder+6)×nmesh+8×iorder2-16×iorder+1.
If initwt = 'S'initwt='S', work must contain fractional weights computed by a previous call of nag_inteq_abel2_weak (d05bd) (see description of initwt).

Optional Input Parameters

1:     iorder – int64int32nag_int scalar
pp, the order of the BDF method to be used.
Default: 44
Constraint: 4iorder64iorder6.
2:     tolnl – double scalar
The accuracy required for the computation of the starting value and the solution of the nonlinear equation at each step of the computation (see Section [Further Comments]).
Default: sqrt(machine precision)machine precision
Constraint: tolnl > 10 × machine precisiontolnl>10×machine precision.

Input Parameters Omitted from the MATLAB Interface

lwk nct

Output Parameters

1:     yn(nmesh) – double array
yn(i)yni contains the approximate value of the true solution y(t)y(t) at the point t = (i1) × ht=(i-1)×h, for i = 1,2,,nmeshi=1,2,,nmesh, where h = tlim / (nmesh1)h=tlim/(nmesh-1).
2:     work(lwk) – double array
lwk(2 × iorder + 6) × nmesh + 8 × iorder216 × iorder + 1lwk(2×iorder+6)×nmesh+8×iorder2-16×iorder+1.
Contains fractional weights which may be used by a subsequent call of nag_inteq_abel2_weak (d05bd).
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,iorder < 4iorder<4 or iorder > 6iorder>6,
ortlim10 × machine precisiontlim10×machine precision,
orinitwt'I'initwt'I' or 'S''S',
orinitwt = 'S'initwt='S' on the first call to nag_inteq_abel2_weak (d05bd),
ortolnl10 × machine precisiontolnl10×machine precision,
ornmesh2m + 2 × iorder1,m1nmesh2m+2×iorder-1,m1,
orlwk < (2 × iorder + 6) × nmesh + 8 × iorder216 × iorder + 1lwk<(2×iorder+6)×nmesh+8×iorder2-16×iorder+1.
  ifail = 2ifail=2
The function cannot compute the 2p12p-1 starting values due to an error solving the system of nonlinear equations. Relaxing the value of tolnl and/or increasing the value of nmesh may overcome this problem (see Section [Further Comments] for further details).
  ifail = 3ifail=3
The function cannot compute the solution at a specific step due to an error in the solution of the nonlinear equation (2). Relaxing the value of tolnl and/or increasing the value of nmesh may overcome this problem (see Section [Further Comments] for further details).

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 (2) at each step of computation. This value can affect the accuracy of the solution. However, for most problems, the value of sqrt(ε)ε, where εε is the machine precision, should be sufficient.

Further Comments

In solving (1), initially, nag_inteq_abel2_weak (d05bd) computes the solution of a system of nonlinear equations for obtaining the 2p12p-1 starting values. nag_roots_sys_func_rcomm (c05qd) is used for this purpose. When a failure with ifail = 2ifail=2 occurs (which corresponds 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αg(tn,Yn)Ψn = 0,
Yn-αg(tn,Yn)-Ψn=0,
(2)
is required at each step of computation, where ΨnΨn and αα are constants. nag_inteq_abel2_weak (d05bd) calls nag_roots_contfn_cntin_rcomm (c05ax) to find the root of this equation.
If a failure with ifail = 3ifail=3 occurs (which corresponds to an error exit from nag_roots_contfn_cntin_rcomm (c05ax)), you are advised to relax the value of the tolnl or choose a smaller step size by increasing the value of nmesh.
If a failure with ifail = 2ifail=2 or 33 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

function nag_inteq_abel2_weak_example
ck = @(t) -sqrt(pi);
cf = @(t) sqrt(t) + (3/8)*t*t*pi;
cg = @(s, y) y^3;
initwt = 'Initial';
tlim = 7;
nmesh = int64(71);
work = zeros(1059, 1);
[yn, workOut, ifail] = nag_inteq_abel2_weak(ck, cf, cg, initwt, tlim, nmesh, work);
 yn, ifail
 

yn =

         0
    0.3162
    0.4472
    0.5477
    0.6325
    0.7071
    0.7746
    0.8367
    0.8944
    0.9487
    1.0000
    1.0488
    1.0954
    1.1402
    1.1832
    1.2247
    1.2649
    1.3038
    1.3416
    1.3784
    1.4142
    1.4491
    1.4832
    1.5166
    1.5492
    1.5811
    1.6125
    1.6432
    1.6733
    1.7029
    1.7321
    1.7607
    1.7889
    1.8166
    1.8439
    1.8708
    1.8974
    1.9235
    1.9494
    1.9748
    2.0000
    2.0248
    2.0494
    2.0736
    2.0976
    2.1213
    2.1448
    2.1679
    2.1909
    2.2136
    2.2361
    2.2583
    2.2804
    2.3022
    2.3238
    2.3452
    2.3664
    2.3875
    2.4083
    2.4290
    2.4495
    2.4698
    2.4900
    2.5100
    2.5298
    2.5495
    2.5690
    2.5884
    2.6077
    2.6268
    2.6458


ifail =

                    0


function d05bd_example
ck = @(t) -sqrt(pi);
cf = @(t) sqrt(t) + (3/8)*t*t*pi;
cg = @(s, y) y^3;
initwt = 'Initial';
tlim = 7;
nmesh = int64(71);
work = zeros(1059, 1);
[yn, workOut, ifail] = d05bd(ck, cf, cg, initwt, tlim, nmesh, work);
 yn, ifail
 

yn =

         0
    0.3162
    0.4472
    0.5477
    0.6325
    0.7071
    0.7746
    0.8367
    0.8944
    0.9487
    1.0000
    1.0488
    1.0954
    1.1402
    1.1832
    1.2247
    1.2649
    1.3038
    1.3416
    1.3784
    1.4142
    1.4491
    1.4832
    1.5166
    1.5492
    1.5811
    1.6125
    1.6432
    1.6733
    1.7029
    1.7321
    1.7607
    1.7889
    1.8166
    1.8439
    1.8708
    1.8974
    1.9235
    1.9494
    1.9748
    2.0000
    2.0248
    2.0494
    2.0736
    2.0976
    2.1213
    2.1448
    2.1679
    2.1909
    2.2136
    2.2361
    2.2583
    2.2804
    2.3022
    2.3238
    2.3452
    2.3664
    2.3875
    2.4083
    2.4290
    2.4495
    2.4698
    2.4900
    2.5100
    2.5298
    2.5495
    2.5690
    2.5884
    2.6077
    2.6268
    2.6458


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