naginterfaces.library.ode.bvp_​coll_​nlin_​solve

naginterfaces.library.ode.bvp_coll_nlin_solve(ffun, fjac, gafun, gbfun, gajac, gbjac, guess, comm, data=None, spiked_sorder='C')[source]

bvp_coll_nlin_solve solves a general two-point boundary value problem for a nonlinear mixed order system of ordinary differential equations.

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

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/d02/d02tlf.html

Parameters
ffuncallable f = ffun(x, y, m, data=None)

must evaluate the functions for given values .

Parameters
xfloat

, the independent variable.

yfloat, ndarray, shape

contains , for , for .

Note: .

mint, ndarray, shape

contains , the order of the th differential equation, for .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
ffloat, array-like, shape

must contain , for .

fjaccallable dfdy = fjac(x, y, m, dfdy, data=None)

must evaluate the partial derivatives of with respect to the elements of

.

Parameters
xfloat

, the independent variable.

yfloat, ndarray, shape

contains , for , for .

Note: .

mint, ndarray, shape

contains , the order of the th differential equation, for .

dfdyfloat, ndarray, shape

Set to zero.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
dfdyfloat, array-like, shape

must contain the partial derivative of with respect to , for , for , for . Only nonzero partial derivatives need be set.

gafuncallable ga = gafun(ya, m, nlbc, data=None)

must evaluate the boundary conditions at the left-hand end of the range, that is functions for given values of .

Parameters
yafloat, ndarray, shape

contains , for , for .

Note: .

mint, ndarray, shape

contains , the order of the th differential equation, for .

nlbcint

The number of boundary conditions at .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
gafloat, array-like, shape

must contain , for .

gbfuncallable gb = gbfun(yb, m, nrbc, data=None)

must evaluate the boundary conditions at the right-hand end of the range, that is functions for given values of .

Parameters
ybfloat, ndarray, shape

contains , for , for .

Note: .

mint, ndarray, shape

contains , the order of the th differential equation, for .

nrbcint

The number of boundary conditions at .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
gbfloat, array-like, shape

must contain , for .

gajaccallable dgady = gajac(ya, m, dgady, data=None)

must evaluate the partial derivatives of with respect to the elements of .

Parameters
yafloat, ndarray, shape

contains , for , for .

Note: .

mint, ndarray, shape

contains , the order of the th differential equation, for .

dgadyfloat, ndarray, shape

Set to zero.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
dgadyfloat, array-like, shape

must contain the partial derivative of with respect to , for , for , for . Only nonzero partial derivatives need be set.

gbjaccallable dgbdy = gbjac(yb, m, dgbdy, data=None)

must evaluate the partial derivatives of with respect to the elements of .

Parameters
ybfloat, ndarray, shape

contains , for , for .

Note: .

mint, ndarray, shape

contains , the order of the th differential equation, for .

dgbdyfloat, ndarray, shape

Set to zero.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
dgbdyfloat, array-like, shape

must contain the partial derivative of with respect to , for , for , for . Only nonzero partial derivatives need be set.

guesscallable (y, dym) = guess(x, m, mmax, data=None)

must return initial approximations for the solution components and the derivatives , for , for .

Try to compute each derivative such that it corresponds to your approximations to , for .

You should not call to compute .

If bvp_coll_nlin_solve is being used in conjunction with bvp_coll_nlin_contin() as part of a continuation process, is not called by bvp_coll_nlin_solve after the call to bvp_coll_nlin_contin().

Parameters
xfloat

, the independent variable; .

mint, ndarray, shape

contains , the order of the th differential equation, for .

mmaxint

.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
yfloat, array-like, shape

must contain , for , for .

Note: .

dymfloat, array-like, shape

must contain , for .

commdict, communication object, modified in place

Communication structure.

This argument must have been initialized by a prior call to bvp_coll_nlin_setup().

dataarbitrary, optional

User-communication data for callback functions.

spiked_sorderstr, optional

If in , in or in are spiked (i.e., have unit extent in all but one dimension, or have size ), selects the storage order to associate with them in the NAG Engine:

spiked_sorder =

row-major storage will be used;

spiked_sorder =

column-major storage will be used.

Raises
NagValueError
(errno )

Either the setup function has not been called or the communication arrays have become corrupted. No solution will be computed.

(errno )

Numerical singularity has been detected in the Jacobian used in the Newton iteration.

No results have been generated. Check the coding of the functions for calculating the Jacobians of system and boundary conditions.

(errno )

All Newton iterations that have been attempted have failed to converge.

No results have been generated. Check the coding of the functions for calculating the Jacobians of system and boundary conditions.

Try to provide a better initial solution approximation.

Warns
NagAlgorithmicWarning
(errno )

A Newton iteration has failed to converge. The computation has not succeeded but results have been returned for an intermediate mesh on which convergence was achieved.

These results should be treated with extreme caution.

(errno )

The expected number of sub-intervals required to continue the computation exceeds the maximum specified: .

Results have been generated which may be useful.

Try increasing this number or relaxing the error requirements.

Notes

bvp_coll_nlin_solve and its associated functions (bvp_coll_nlin_setup(), bvp_coll_nlin_contin(), bvp_coll_nlin_interp() and bvp_coll_nlin_diag()) solve the two-point boundary value problem for a nonlinear mixed order system of ordinary differential equations

over an interval subject to () nonlinear boundary conditions at and () nonlinear boundary conditions at , where . Note that is the th derivative of the th solution component. Hence . The left boundary conditions at are defined as

and the right boundary conditions at as

where and

First, bvp_coll_nlin_setup() must be called to specify the initial mesh, error requirements and other details. Note that the error requirements apply only to the solution components and that no error control is applied to derivatives of solution components. (If error control is required on derivatives then the system must be reduced in order by introducing the derivatives whose error is to be controlled as new variables. See Further Comments.) Then, bvp_coll_nlin_solve can be used to solve the boundary value problem. After successful computation, bvp_coll_nlin_diag() can be used to ascertain details about the final mesh and other details of the solution procedure, and bvp_coll_nlin_interp() can be used to compute the approximate solution anywhere on the interval .

A description of the numerical technique used in bvp_coll_nlin_solve is given in Notes for bvp_coll_nlin_setup.

bvp_coll_nlin_solve can also be used in the solution of a series of problems, for example in performing continuation, when the mesh used to compute the solution of one problem is to be used as the initial mesh for the solution of the next related problem. bvp_coll_nlin_contin() should be used in between calls to bvp_coll_nlin_solve in this context.

See Further Comments for details of how to solve boundary value problems of a more general nature.

The functions are based on modified versions of the codes COLSYS and COLNEW (see Ascher et al. (1979) and Ascher and Bader (1987)). A comprehensive treatment of the numerical solution of boundary value problems can be found in Ascher et al. (1988) and Keller (1992).

References

Ascher, U M and Bader, G, 1987, A new basis implementation for a mixed order boundary value ODE solver, SIAM J. Sci. Stat. Comput. (8), 483–500

Ascher, U M, Christiansen, J and Russell, R D, 1979, A collocation solver for mixed order systems of boundary value problems, Math. Comput. (33), 659–679

Ascher, U M, Mattheij, R M M and Russell, R D, 1988, Numerical Solution of Boundary Value Problems for Ordinary Differential Equations, Prentice–Hall

Keller, H B, 1992, Numerical Methods for Two-point Boundary-value Problems, Dover, New York