naginterfaces.library.inteq.volterra2

naginterfaces.library.inteq.volterra2(ck, cg, cf, method, iorder, alim, tlim, nmesh, tol, thresh, lwk, data=None)[source]

volterra2 computes the solution of a nonlinear convolution Volterra integral equation of the second kind using a reducible linear multi-step method.

For full information please refer to the NAG Library document for d05ba

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/d05/d05baf.html

Parameters
ckcallable retval = ck(t, data=None)

must evaluate the kernel of the integral equation (1).

Parameters
tfloat

, the value of the independent variable.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The value of at the specified point.

cgcallable retval = cg(s, y, data=None)

must evaluate the function in (1).

Parameters
sfloat

, the value of the independent variable.

yfloat

The value of the solution at the point .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The value of at the specified points.

cfcallable retval = cf(t, data=None)

must evaluate the function in (1).

Parameters
tfloat

, the value of the independent variable.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The value of at the specified point.

methodstr, length 1

The type of method which you wish to employ.

For Adams’ type formulae.

For backward differentiation formulae.

iorderint

The order of the method to be used.

alimfloat

, the lower limit of the integration interval.

tlimfloat

The final point of the integration interval, .

nmeshint

The number of equidistant points at which the solution is sought.

tolfloat

The relative accuracy required in the computed values of the solution.

threshfloat

The threshold value for use in the evaluation of the estimated relative errors. For two successive meshes the following condition must hold at each point of the coarser mesh

where is the computed solution on the coarser mesh and is the computed solution at the corresponding point in the finer mesh. If this condition is not satisfied then the step size is halved and the solution is recomputed.

Note: can be used to effect a relative, absolute or mixed error test. If then pure relative error is measured and, if the computed solution is small and , absolute error is measured.

lwkint

The dimension of the array .

dataarbitrary, optional

User-communication data for callback functions.

Returns
ynfloat, ndarray, shape

contains the most recent approximation of the true solution at the specified point , for , where .

errestfloat, ndarray, shape

contains the most recent approximation of the relative error in the computed solution at the point , for , where .

workfloat, ndarray, shape

If = 5 or 6, contains the size of required for the algorithm to proceed further.

Raises
NagValueError
(errno )

On entry, and .

Constraint: if , .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: if , .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

(errno )

On entry, , and .

Constraint: if , .

(errno )

On entry, , and .

Constraint: if , .

(errno )

On entry, .

Constraint: ; that is, .

(errno )

The solution is not converging. See Further Comments.

Warns
NagAlgorithmicWarning
(errno )

The workspace which has been supplied is too small for the required accuracy. The number of extrapolations, so far, is . If you require one more extrapolation extend the size of workspace to: .

(errno )

The workspace which has been supplied is too small for the required accuracy. The number of extrapolations, so far, is . If you require one more extrapolation extend the size of workspace to: .

Notes

volterra2 computes the numerical solution of the nonlinear convolution Volterra integral equation of the second kind

It is assumed that the functions involved in (1) are sufficiently smooth. The function uses a reducible linear multi-step formula selected by you to generate a family of quadrature rules. The reducible formulae available in volterra2 are the Adams–Moulton formulae of orders to , and the backward differentiation formulae (BDF) of orders to . For more information about the behaviour and the construction of these rules we refer to Lubich (1983) and Wolkenfelt (1982).

The algorithm is based on computing the solution in a step-by-step fashion on a mesh of equispaced points. The initial step size which is given by , being the number of points at which the solution is sought, is halved and another approximation to the solution is computed. This extrapolation procedure is repeated until successive approximations satisfy a user-specified error requirement.

The above methods require some starting values. For the Adams’ formula of order greater than and the BDF of order greater than we employ an explicit Dormand–Prince–Shampine Runge–Kutta method (see Shampine (1986)). The above scheme avoids the calculation of the kernel, , on the negative real line.

References

Lubich, Ch, 1983, On the stability of linear multi-step methods for Volterra convolution equations, IMA J. Numer. Anal. (3), 439–465

Shampine, L F, 1986, Some practical Runge–Kutta formulas, Math. Comput. (46(173)), 135–150

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