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)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

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,j and ω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:
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×h, for i=0,1,,n, for some given constant h.
In (1), h is a uniform mesh, p is related to the order of the method being used and Wi,j, ωi are the starting and the convolution weights respectively. The mesh size h is determined as h=Tn, where n=nw+p-1 and nw is the chosen number of convolution weights wj, for j=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 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'
For Adams' type formulae.
method='B'
For Backward Differentiation Formulae.
Constraint: method='A' or 'B'.
2:     iorder int64int32nag_int scalar
The order of the method to be used. The number of starting weights, p is determined by method and iorder.
If method='A', p=iorder-1.
If method='B', p=iorder.
Constraints:
  • if method='A', 3iorder6;
  • if method='B', 2iorder5.
3:     nomg int64int32nag_int scalar
The number of convolution weights, nw.
Constraint: nomg1.
4:     nwt int64int32nag_int scalar
p, the number of columns in the starting weights.
Constraints:
  • if method='A', nwt=iorder-1;
  • if method='B', nwt=iorder.

Optional Input Parameters

None.

Output Parameters

1:     omeganomg – double array
Contains the first nomg convolution weights.
2:     lensw int64int32nag_int scalar
The number of rows in the weights Wi,j.
3:     swldswnwt – double array
ldsw=n.
swij+1 contains the weights Wi,j, for i=1,2,,lensw and j=0,1,,nwt-1, where n is as defined in Description.
4:     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,method'A' or 'B'.
   ifail=2
On entry,iorder<2 or iorder>6,
ornomg<1.
   ifail=3
On entry,method='A' and iorder=2,
ormethod='B' and iorder=6.
   ifail=4
On entry,method='A' and nwtiorder-1,
ormethod='B' and nwtiorder.
   ifail=5
On entry,method='A' and ldsw<nomg+iorder-2,
ormethod='B' and ldsw<nomg+iorder-1.
   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

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
yt=ft+0tKt,sysds,  0tT, (2)
using nag_inteq_volterra_weights (d05bw). In (2), Kt,s and ft are given and the solution yt is sought on a uniform mesh of size h such that T=nh. Discretization of (2) yields
yi=fi×h+hj=0 p-1Wi,jKi,h,j,hyj+hj=piωi-jKi,h,j,hyj, (3)
where yiyi×h. We propose the following algorithm for computing yi from (3) after a call to nag_inteq_volterra_weights (d05bw):
(a) Equation (3) requires starting values, yj, for j=1,2,,nwt-1, with y0=f0. These starting values can be computed by solving the linear system
yi = fi×h + h j=0 nwt-1 swij+1 K i,h,j,h yj ,   i=1,2,,nwt-1 .  
(b) Compute the inhomogeneous terms
σi = fi×h + h j= 0 nwt-1 swij+1 Ki,h,j,h yj ,   i=nwt,nwt+ 1,,n .  
(c) Start the iteration for i=nwt,nwt+1,,n to compute yi from:
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

The following example generates the first ten convolution and thirteen starting weights generated by the fourth-order BDF method.
function d05bw_example


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

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

fprintf('\nThe convolution weights\n\n');
n = [0:double(nomg)-1]';
fprintf('%3d    %10.4f\n',[n omega]');

fprintf('\nThe weights W\n\n');
n = [1:double(lensw)]';
fprintf('%3d    %10.4f%10.4f%10.4f%10.4f\n',[n sw]');


d05bw example results


The convolution weights

  0        0.4800
  1        0.9216
  2        1.0783
  3        1.0504
  4        0.9962
  5        0.9797
  6        0.9894
  7        1.0003
  8        1.0034
  9        1.0017

The weights W

  1        0.3750    0.7917   -0.2083    0.0417
  2        0.3333    1.3333    0.3333    0.0000
  3        0.3750    1.1250    1.1250    0.3750
  4        0.4800    0.7467    1.5467    0.7467
  5        0.5499    0.5719    1.5879    0.8886
  6        0.5647    0.5829    1.5016    0.8709
  7        0.5545    0.6385    1.4514    0.8254
  8        0.5458    0.6629    1.4550    0.8098
  9        0.5449    0.6578    1.4741    0.8170
 10        0.5474    0.6471    1.4837    0.8262
 11        0.5491    0.6428    1.4831    0.8292
 12        0.5492    0.6438    1.4798    0.8279
 13        0.5488    0.6457    1.4783    0.8263

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