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_volterra_weights (d05bw)

Purpose

nag_inteq_volterra_weights (d05bw) computes the quadrature weights associated with the Adams methods of orders three to six and the Backward Differentiation Formulae (BDF) methods of orders two to five. These rules, which are referred to as reducible quadrature rules, can then be used in the solution of Volterra integral and integro-differential equations.

Syntax

[omega, lensw, sw, ifail] = d05bw(method, iorder, nomg, nwt)
[omega, lensw, sw, ifail] = nag_inteq_volterra_weights(method, iorder, nomg, nwt)

Description

nag_inteq_volterra_weights (d05bw) computes the weights Wi,jWi,j and ωiωi for a family of quadrature rules related to the Adams methods of orders three to six and the BDF methods of orders two to five, for approximating the integral:
t p1 i
φ(s)dshWi,jφ(j × h) + hωijφ(j × h),  0tT,
0 j = 0 j = p
0t ϕ(s) ds h j=0 p-1 Wi,j ϕ(j×h) + h j=p i ωi-j ϕ(j×h) ,   0tT ,
(1)
with t = i × ht=i×h, for i = 0,1,,ni=0,1,,n, for some given constant hh.
In (1), hh is a uniform mesh, pp is related to the order of the method being used and Wi,jWi,j, ωiωi are the starting and the convolution weights respectively. The mesh size hh is determined as h = T/nh=Tn, where n = nw + p1n=nw+p-1 and nwnw is the chosen number of convolution weights wjwj, for j = 1,2,,nw1j=1,2,,nw-1. A description of how these weights can be used in the solution of a Volterra integral equation of the second kind is given in Section [Further Comments]. For a general discussion of these methods, see Wolkenfelt (1982) for more details.

References

Lambert J D (1973) Computational Methods in Ordinary Differential Equations John Wiley
Wolkenfelt P H M (1982) The construction of reducible quadrature rules for Volterra integral and integro-differential equations IMA J. Numer. Anal. 2 131–152

Parameters

Compulsory Input Parameters

1:     method – string (length ≥ 1)
The type of method to be used.
method = 'A'method='A'
For Adams type formulae.
method = 'B'method='B'
For Backward Differentiation Formulae.
Constraint: method = 'A'method='A' or 'B''B'.
2:     iorder – int64int32nag_int scalar
The order of the method to be used. The number of starting weights, pp is determined by method and iorder.
If method = 'A'method='A', p = iorder1p=iorder-1.
If method = 'B'method='B', p = iorderp=iorder.
Constraints:
  • if method = 'A'method='A', 3iorder63iorder6;
  • if method = 'B'method='B', 2iorder52iorder5.
3:     nomg – int64int32nag_int scalar
The number of convolution weights, nwnw.
Constraint: nomg1nomg1.
4:     nwt – int64int32nag_int scalar
pp, the number of columns in the starting weights.
Constraints:

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

ldsw

Output Parameters

1:     omega(nomg) – double array
Contains the first nomg convolution weights.
2:     lensw – int64int32nag_int scalar
The number of rows in the weights Wi,jWi,j.
3:     sw(ldsw,nwt) – double array
ldsw = nldsw=n.
sw(i,j + 1)swij+1 contains the weights Wi,jWi,j, for i = 1,2,,lenswi=1,2,,lensw and j = 0,1,,nwt1j=0,1,,nwt-1, where nn is as defined in Section [Description].
4:     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,method'A'method'A' or 'B''B'.
  ifail = 2ifail=2
On entry,iorder < 2iorder<2 or iorder > 6iorder>6,
ornomg < 1nomg<1.
  ifail = 3ifail=3
On entry,method = 'A'method='A' and iorder = 2iorder=2,
ormethod = 'B'method='B' and iorder = 6iorder=6.
  ifail = 4ifail=4
On entry,method = 'A'method='A' and nwtiorder1nwtiorder-1,
ormethod = 'B'method='B' and nwtiordernwtiorder.
  ifail = 5ifail=5
On entry,method = 'A'method='A' and ldsw < nomg + iorder2ldsw<nomg+iorder-2,
ormethod = 'B'method='B' and ldsw < nomg + iorder1ldsw<nomg+iorder-1.

Accuracy

Not applicable.

Further Comments

Reducible quadrature rules are most appropriate for solving Volterra integral equations (and integro-differential equations). In this section, we propose the following algorithm which you may find useful in solving a linear Volterra integral equation of the form
t
y(t) = f(t) + K(t,s)y(s)ds,  0tT,
0
y(t)=f(t)+0tK(t,s)y(s)ds,  0tT,
(2)
using nag_inteq_volterra_weights (d05bw). In (2), K(t,s)K(t,s) and f(t)f(t) are given and the solution y(t)y(t) is sought on a uniform mesh of size hh such that T = nhT=nh. Discretization of (2) yields
p1 i
yi = f(i × h) + hWi,jK(i,h,j,h)yj + hωijK(i,h,j,h)yj,
j = 0 j = p
yi=f(i×h)+hj=0 p-1Wi,jK(i,h,j,h)yj+hj=piωi-jK(i,h,j,h)yj,
(3)
where yiy(i × h)yiy(i×h). We propose the following algorithm for computing yiyi from (3) after a call to nag_inteq_volterra_weights (d05bw):
(a) Equation (3) requires starting values, yjyj, for j = 1,2,,nwt1j=1,2,,nwt-1, with y0 = f(0)y0=f(0). These starting values can be computed by solving the linear system
nwt1
yi = f(i × h) + hsw(i,j + 1)K(i,h,j,h)yj,  i = 1,2,,nwt1.
j = 0
yi = f(i×h) + h j=0 nwt-1 swij+1 K (i,h,j,h) yj ,   i=1,2,,nwt-1 .
(b) Compute the inhomogeneous terms
nwt1
σi = f(i × h) + hsw(i,j + 1)K(i,h,j,h)yj,  i = nwt,nwt + 1,,n.
j = 0
σi = f(i×h) + h j= 0 nwt-1 swij+1 K(i,h,j,h) yj ,   i=nwt,nwt+ 1,,n .
(c) Start the iteration for i = nwt,nwt + 1,,ni=nwt,nwt+1,,n to compute yiyi from:
i 1
(1h × omega(1)K(i,h,i,h))yi = σi + homega( i j + 1 )K(i,h,j,h)yj.
j = nwt
( 1 - h × omega1 K (i,h,i,h) ) y i = σ i + h j = nwt i - 1 omega i - j + 1 K (i,h,j,h) y j .
Note that for a nonlinear integral equation, the solution of a nonlinear algebraic system is required at step (a) and a single nonlinear equation at step (c).

Example

function nag_inteq_volterra_weights_example
method = 'BDF';
iorder = int64(4);
nomg = int64(10);
nwt = int64(4);
[omega, lensw, sw, ifail] = nag_inteq_volterra_weights(method, iorder, nomg, nwt)
 

omega =

    0.4800
    0.9216
    1.0783
    1.0504
    0.9962
    0.9797
    0.9894
    1.0003
    1.0034
    1.0017


lensw =

                   13


sw =

    0.3750    0.7917   -0.2083    0.0417
    0.3333    1.3333    0.3333         0
    0.3750    1.1250    1.1250    0.3750
    0.4800    0.7467    1.5467    0.7467
    0.5499    0.5719    1.5879    0.8886
    0.5647    0.5829    1.5016    0.8709
    0.5545    0.6385    1.4514    0.8254
    0.5458    0.6629    1.4550    0.8098
    0.5449    0.6578    1.4741    0.8170
    0.5474    0.6471    1.4837    0.8262
    0.5491    0.6428    1.4831    0.8292
    0.5492    0.6438    1.4798    0.8279
    0.5488    0.6457    1.4783    0.8263


ifail =

                    0


function d05bw_example
method = 'BDF';
iorder = int64(4);
nomg = int64(10);
nwt = int64(4);
[omega, lensw, sw, ifail] = d05bw(method, iorder, nomg, nwt)
 

omega =

    0.4800
    0.9216
    1.0783
    1.0504
    0.9962
    0.9797
    0.9894
    1.0003
    1.0034
    1.0017


lensw =

                   13


sw =

    0.3750    0.7917   -0.2083    0.0417
    0.3333    1.3333    0.3333         0
    0.3750    1.1250    1.1250    0.3750
    0.4800    0.7467    1.5467    0.7467
    0.5499    0.5719    1.5879    0.8886
    0.5647    0.5829    1.5016    0.8709
    0.5545    0.6385    1.4514    0.8254
    0.5458    0.6629    1.4550    0.8098
    0.5449    0.6578    1.4741    0.8170
    0.5474    0.6471    1.4837    0.8262
    0.5491    0.6428    1.4831    0.8292
    0.5492    0.6438    1.4798    0.8279
    0.5488    0.6457    1.4783    0.8263


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