naginterfaces.library.ode.bvp_shoot_genpar¶
- naginterfaces.library.ode.bvp_shoot_genpar(p, pe, e, m1, monlev, fcn, bc, ebndry, comm, data=None, io_manager=None)[source]¶
bvp_shoot_genpar
solves a two-point boundary value problem for a system of ordinary differential equations, using initial value techniques and Newton iteration; it generalizes functionbvp_shoot_bval()
to include the case where parameters other than boundary values are to be determined.For full information please refer to the NAG Library document for d02hb
https://www.nag.com/numeric/nl/nagdoc_29.2/flhtml/d02/d02hbf.html
- Parameters
- pfloat, array-like, shape
An estimate for the th argument, , for .
- pefloat, array-like, shape
The elements of must be given small positive values. The element is used
in the convergence test on the th argument in the Newton iteration, and
in perturbing the th argument when approximating the derivatives of the components of the solution with respect to this argument for use in the Newton iteration.
The elements should not be chosen too small.
They should usually be several orders of magnitude larger than machine precision.
- efloat, array-like, shape
The elements of must be given positive values. The element is used in the bound on the local error in the th component of the solution during integration.
The elements should not be chosen too small.
They should usually be several orders of magnitude larger than machine precision.
- m1int
A value which controls exit values.
The final solution is not calculated.
The final values of the solution at interval (length of range)/ are calculated and stored sequentially in the array starting with the values of the solutions evaluated at the first end point (see ) stored in the first column of .
- monlevint
Setting disables monitoring of the pseudo-Newton iteration. Setting enables this monitoring.
- fcncallable f = fcn(n, n1, x, y, p, data=None)
must evaluate the functions (i.e., the derivatives ), for , at a general point .
- Parameters
- nint
, the number of equations.
- n1int
, the number of parameters.
- xfloat
, the value of the argument.
- yfloat, ndarray, shape
, for , the value of the argument.
- pfloat, ndarray, shape
The current estimate of the argument , for .
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- Returns
- ffloat, array-like, shape
The value of , for . The may depend upon the parameters , for . If there are any driving equations (see Notes) then these must be numbered first in the ordering of the components of in .
- bccallable (g1, g2) = bc(n, n1, p, data=None)
must place in and the boundary conditions at and respectively (see ).
- Parameters
- nint
, the number of equations.
- n1int
, the number of parameters.
- pfloat, ndarray, shape
An estimate of the argument , for .
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- Returns
- g1float, array-like, shape
The value of , (where this may be a known value or a function of the parameters , for , for ).
- g2float, array-like, shape
The value of , for , (where these may be known values or functions of the parameters , for ). If , so that there are some driving equations, the first values of need not be set since they are never used.
- ebndrycallable (a, b) = ebndry(n1, p, data=None)
must evaluate the boundary points and , each of which may depend on the arguments .
The integrations in the shooting method are always from to .
- Parameters
- n1int
, the number of parameters.
- pfloat, ndarray, shape
The current estimate of the th argument, , for .
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- Returns
- afloat
, one of the boundary points.
- bfloat
The second boundary point, . Note that forces the direction of integration to be that of increasing . If and are interchanged the direction of integration is reversed.
- 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
- pfloat, ndarray, shape
The corrected value for the th argument, unless an error has occurred, when it contains the last calculated value of the argument.
- solnfloat, ndarray, shape
The solution when .
- wfloat, ndarray, shape
With = 2, 3, 4 or 5 (see Exceptions), , for , contains the solution at the point when the error occurred. contains .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: or .
- (errno )
On entry a negative or zero local error tolerance has been set.
- (errno )
On entry a negative or zero convergence test tolerance has been set.
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
The step length for the integration became too short to proceed when calculating the residual.
- (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 )
An initial step-length could be found for integration to proceed with the current parameters.
- (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 )
The step-length required to calculate the Jacobian to sufficient accuracy is too small
- (errno )
An initial step-length could be found for Jacobian calculation to proceed with the current parameters.
- (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 Newton method. Please contact NAG.
- (errno )
Internal error in calculating Jacobian. Please contact NAG.
- (errno )
Internal error in calculating residual. Please contact NAG.
- (errno )
Internal error in calculating residual. Please contact NAG.
- Notes
No equivalent traditional C interface for this routine exists in the NAG Library.
bvp_shoot_genpar
solves a two-point boundary value problem by determining the unknown parameters of the problem. These parameters may be, but need not be, boundary values; they may include eigenvalue parameters in the coefficients of the differential equations, length of the range of integration, etc. The notation and methods used are similar to those ofbvp_shoot_bval()
and you are advised to study this first. (The parameters correspond precisely to the unknown boundary conditions inbvp_shoot_bval()
.) It is assumed that we have a system of first-order ordinary differential equations of the form:and that the derivatives are evaluated by . The system, including the boundary conditions given by and the range of integration given by , involves the unknown parameters which are to be determined, and for which initial estimates must be supplied. The number of unknown parameters must not exceed the number of equations . If , we assume that equations of the system are not involved in the matching process. These are usually referred to as ‘driving equations’; they are independent of the parameters and of the solutions of the other equations. In numbering the equations for , the driving equations must be put first.
The estimated values of the parameters are corrected by a form of Newton iteration. The Newton correction on each iteration is calculated using a Jacobian matrix whose th element depends on the derivative of the th component of the solution, , with respect to the th parameter, . This matrix is calculated by a simple numerical differentiation technique which requires evaluations of the differential system.
If the argument is set appropriately, the function automatically prints messages to inform you of the flow of the calculation. These messages are discussed in detail in Further Comments.
bvp_shoot_genpar
is a simplified version ofbvp_shoot_genpar_algeq()
which is described in detail in Gladwell (1979).
- References
Gladwell, I, 1979, The development of the boundary value codes in the ordinary differential equations module of the NAG Library, Codes for Boundary Value Problems in Ordinary Differential Equations. Lecture Notes in Computer Science, (eds B Childs, M Scott, J W Daniel, E Denman and P Nelson) (76), Springer–Verlag