naginterfaces.library.ode.bvp_shoot_genpar_intern¶
- naginterfaces.library.ode.bvp_shoot_genpar_intern(h, e, parerr, param, m1, aux, bcaux, raaux, prsol, data=None)[source]¶
bvp_shoot_genpar_intern
solves a two-point boundary value problem for a system of ordinary differential equations, using initial value techniques and Newton iteration; it generalizesbvp_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 d02ag
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/d02/d02agf.html
- Parameters
- hfloat
must be set to an estimate of the step size, , needed for integration.
- efloat, array-like, shape
must be set to a small quantity to control the th solution component. The element is used:
in the bound on the local error in the th component of the solution during integration,
in the convergence test on the th component of the solution at the matching point in the Newton iteration.
The elements should not be chosen too small.
They should usually be several orders of magnitude larger than machine precision.
- parerrfloat, array-like, shape
must be set to a small quantity to control the th parameter component. The element is used:
in the convergence test on the th parameter in the Newton iteration,
in perturbing the th parameter when approximating the derivatives of the components of the solution with respect to the th parameter, 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.
- paramfloat, array-like, shape
must be set to an estimate for the th parameter, , for .
- m1int
Determines whether or not the final solution is computed as well as the parameter 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 evaluated at the first end point (see ) stored in .
- auxcallable f = aux(n, y, x, param, data=None)
must evaluate the functions (i.e., the derivatives ) for given values of its arguments, ,
- Parameters
- nint
, the total number of differential equations.
- yfloat, ndarray, shape
, for , the value of the argument.
- xfloat
, the value of the argument.
- paramfloat, ndarray, shape
, for , the value of the parameters.
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- Returns
- ffloat, array-like, shape
The value of , for .
- bcauxcallable (g0, g1) = bcaux(n, param, data=None)
must evaluate the values of at the end points of the range given the values of .
- Parameters
- nint
, the total number of differential equations.
- paramfloat, ndarray, shape
, for , the value of the parameters.
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- Returns
- g0float, array-like, shape
The values , for , at the boundary point (see ).
- g1float, array-like, shape
The values , for , at the boundary point (see ).
- raauxcallable (x0, x1, r) = raaux(param, data=None)
must evaluate the end points, and , of the range and the matching point, , given the values .
- Parameters
- paramfloat, ndarray, shape
, for , the value of the parameters.
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- Returns
- x0float
Must contain the left-hand end of the range, .
- x1float
Must contain the right-hand end of the range .
- rfloat
Must contain the matching point, .
- prsolcallable prsol(param, res, err, data=None)
is called at each iteration of the Newton method and can be used to print the current values of the parameters , for , their errors, , and the sum of squares of the errors at the matching point, .
- Parameters
- paramfloat, ndarray, shape
, for , the current value of the parameters.
- resfloat
The sum of squares of the errors in the arguments, .
- errfloat, ndarray, shape
The errors in the parameters, , for .
- dataarbitrary, optional, modifiable in place
User-communication data for callback functions.
- dataarbitrary, optional
User-communication data for callback functions.
- Returns
- hfloat
The last step length used.
- paramfloat, ndarray, shape
The corrected value for the th parameter, unless an error has occurred, when it contains the last calculated value of the parameter (possibly perturbed by if the error occurred when calculating the approximate derivatives).
- cfloat, ndarray, shape
The solution when (see ).
If , the elements of are not used.
- Raises
- NagValueError
- (errno )
On entry, and .
Constraint: .
- (errno )
No further progress can be made when stepping to obtain a Jacobian update for the current parameter values. Step length .
- (errno )
Currently the matching point does not lie in range .
If , or depend on the parameters then this may occur when care is not taken to avoid it.
, and .
- (errno )
No further progress can be made when stepping to a solution corresponding to the current parameter values.
Step length .
- (errno )
The Jacobian for parameter corrections is singular.
- (errno )
The Newton method failed to converge while updating parameter values.
- (errno )
The Newton method has not converged after iterations while updating parameter values.
- Notes
No equivalent traditional C interface for this routine exists in the NAG Library.
bvp_shoot_genpar_intern
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 (as they are inbvp_shoot_bval()
); 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. (There the parameters correspond to the unknown boundary conditions.) It is assumed that we have a system of first-order ordinary differential equations of the formand that derivatives are evaluated by . The system, including the boundary conditions given by , and the range of integration and matching point, , 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 last.
The estimated values of the parameters are corrected by a form of Newton iteration. The Newton correction on each iteration is calculated using a 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.