naginterfaces.library.ode.bvp_​shoot_​bval

naginterfaces.library.ode.bvp_shoot_bval(u, v, a, b, tol, fcn, m1, monlev, comm, data=None, io_manager=None)[source]

bvp_shoot_bval solves a two-point boundary value problem for a system of ordinary differential equations, using a Runge–Kutta–Merson method and a Newton iteration in a shooting and matching technique.

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

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/d02/d02haf.html

Parameters
ufloat, array-like, shape

must be set to the known or estimated value of at and must be set to the known or estimated value of at , for .

vfloat, array-like, shape

must be set to if is a known value and to if is an estimated value, for , for .

afloat

, the initial point of the interval of integration.

bfloat

, the final point of the interval of integration.

tolfloat

Must be set to a small quantity suitable for:

  1. testing the local error in during integration,

  2. testing for the convergence of at ,

  3. calculating the perturbation in estimated boundary values for , which are used to obtain the approximate derivatives of the residuals for use in the Newton iteration.

You are advised to check your results by varying .

fcncallable f = fcn(n, x, y, data=None)

must evaluate the functions (i.e., the derivatives ), for , at a general point .

Parameters
nint

, the number of equations.

xfloat

, the value of the argument.

yfloat, ndarray, shape

, for , the value of the argument.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
ffloat, array-like, shape

The values of , for .

m1int

A value which controls output.

The final solution is not evaluated.

The final values of at interval are calculated and stored in the array by columns, starting with values at stored in , for .

monlevint

Setting disables monitoring of the pseudo-Newton iteration. Setting enables this monitoring.

commdict, communication object, modified in place

Communication structure.

On initial entry: need not be set.

dataarbitrary, optional

User-communication data for callback functions.

io_managerFileObjManager, optional

Manager for I/O in this routine.

Returns
ufloat, ndarray, shape

The known values unaltered, and corrected values of the estimates, unless an error has occurred. If an error has occurred, contains the known values and the latest values of the estimates.

solnfloat, ndarray, shape

The solution when .

wfloat, ndarray, shape

If = 2, 3, 4 or 5, , for , contains the solution at the point where the integration fails and the point of failure is returned in .

Raises
NagValueError
(errno )

On entry, .

Constraint: or .

(errno )

On entry, incorrect number of boundary values were flagged as known.

Number flagged as known: , but number should be .

(errno )

On entry all left-hand boundary values were flagged as known.

(errno )

On entry no left-hand boundary values were flagged as known.

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

In the integration with initial or final parameters, the step size was reduced too far for the integration to proceed. Either this function is not a suitable method for solving the problem, or the initial choice of parameters is very poor.

(errno )

In the integration with initial or final parameters, a suitable initial step could not be found. Either this function is not suitable for solving the problem, or the initial choice of parameters is very poor.

(errno )

An initial step-length could be found for integration to proceed with the current parameters.

(errno )

The step-length required to calculate the Jacobian to sufficient accuracy is too small

(errno )

The Jacobian has an insignificant column. Make sure that the solution vector depends on all the parameters.

(errno )

An internal singular value decomposition has failed.

This error can be avoided by changing the initial parameter estimates.

(errno )

The Newton iteration has failed to converge.

This can indicate a poor initial choice of parameters or a very difficult problem.

Consider varying elements of the parameter convergence control if the residuals are small; otherwise vary initial parameter estimates.

(errno )

Internal error in calculating residual. Please contact NAG.

(errno )

Internal error in calculating Jacobian. Please contact NAG.

(errno )

Internal error in Newton method. Please contact NAG.

Notes

No equivalent traditional C interface for this routine exists in the NAG Library.

bvp_shoot_bval solves a two-point boundary value problem for a system of ordinary differential equations in the range . The system is written in the form:

and the derivatives are evaluated by . Initially, boundary values of the variables must be specified, some at and some at . You must supply estimates of the remaining boundary values (called parameters below); the function corrects these by a form of Newton iteration. It also calculates the complete solution on an equispaced mesh if required.

Starting from the known and estimated values of at , the function integrates the equations from to (using a Runge–Kutta–Merson method). The differences between the values of at from integration and those specified initially should be zero for the true solution. (These differences are called residuals below.) The function uses a generalized Newton method to reduce the residuals to zero, by calculating corrections to the estimated boundary values. This process is repeated iteratively until convergence is obtained, or until the function can no longer reduce the residuals. See Hall and Watt (1976) for a simple discussion of shooting and matching techniques.

References

Hall, G and Watt, J M (ed.), 1976, Modern Numerical Methods for Ordinary Differential Equations, Clarendon Press, Oxford