naginterfaces.library.roots.sys_​deriv_​rcomm

naginterfaces.library.roots.sys_deriv_rcomm(irevcm, x, fvec, fjac, mode, diag, r, qtf, comm, xtol=1.0536712127723509e-08, factor=100.0)[source]

sys_deriv_rcomm is a comprehensive reverse communication function that finds a solution of a system of nonlinear equations by a modification of the Powell hybrid method. You must provide the Jacobian.

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

https://www.nag.com/numeric/nl/nagdoc_28.7/flhtml/c05/c05rdf.html

Parameters
irevcmint

On initial entry: must have the value .

xfloat, ndarray, shape , modified in place

On initial entry: an initial guess at the solution vector.

On intermediate exit: contains the current point.

On final exit: the final estimate of the solution vector.

fvecfloat, ndarray, shape , modified in place

On initial entry: need not be set.

On intermediate entry: if , must not be changed.

If , must be set to the values of the functions computed at the current point .

On final exit: the function values at the final point, .

fjacfloat, ndarray, shape , modified in place

On initial entry: need not be set.

On intermediate entry: if , must not be changed.

If , must contain the value of at the point , for , for .

On final exit: the orthogonal matrix produced by the factorization of the final approximate Jacobian.

modeint

On initial entry: indicates whether or not you have provided scaling factors in .

If , the scaling must have been supplied in .

Otherwise, if , the variables will be scaled internally.

diagfloat, ndarray, shape , modified in place

On initial entry: if , must contain multiplicative scale factors for the variables.

If , need not be set.

On intermediate exit: must not be changed.

On final exit: the scale factors actually used (computed internally if ).

rfloat, ndarray, shape , modified in place

On initial entry: need not be set.

On intermediate exit: must not be changed.

On final exit: the upper triangular matrix produced by the factorization of the final approximate Jacobian, stored row-wise.

qtffloat, ndarray, shape , modified in place

On initial entry: need not be set.

On intermediate exit: must not be changed.

On final exit: the vector .

commdict, communication object, modified in place

Communication structure.

On initial entry: need not be set.

xtolfloat, optional

On initial entry: the accuracy in to which the solution is required.

factorfloat, optional

On initial entry: a quantity to be used in determining the initial step bound. In most cases, should lie between and . (The step bound is if this is nonzero; otherwise the bound is .)

Returns
irevcmint

On intermediate exit: specifies what action you must take before re-entering sys_deriv_rcomm with set to this value. The value of should be interpreted as follows:

Indicates the start of a new iteration. No action is required by you, but and are available for printing.

Indicates that before re-entry to sys_deriv_rcomm, must contain the function values .

Indicates that before re-entry to sys_deriv_rcomm, must contain the value of at the point , for , for .

On final exit: and the algorithm has terminated.

Raises
NagValueError
(errno )

On entry, .

Constraint: , , or .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: or .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and contained a non-positive element.

Warns
NagAlgorithmicWarning
(errno )

No further improvement in the solution is possible. is too small: .

(errno )

The iteration is not making good progress, as measured by the improvement from the last Jacobian evaluations. This failure exit may indicate that the system does not have a zero, or that the solution is very close to the origin (see Accuracy). Otherwise, rerunning sys_deriv_rcomm from a different starting point may avoid the region of difficulty.

(errno )

The iteration is not making good progress, as measured by the improvement from the last iterations. This failure exit may indicate that the system does not have a zero, or that the solution is very close to the origin (see Accuracy). Otherwise, rerunning sys_deriv_rcomm from a different starting point may avoid the region of difficulty.

Notes

The system of equations is defined as:

sys_deriv_rcomm is based on the MINPACK routine HYBRJ (see Moré et al. (1980)). It chooses the correction at each step as a convex combination of the Newton and scaled gradient directions. The Jacobian is updated by the rank-1 method of Broyden. For more details see Powell (1970).

References

Moré, J J, Garbow, B S and Hillstrom, K E, 1980, User guide for MINPACK-1, Technical Report ANL-80-74, Argonne National Laboratory

Powell, M J D, 1970, A hybrid method for nonlinear algebraic equations, Numerical Methods for Nonlinear Algebraic Equations, (ed P Rabinowitz), Gordon and Breach