naginterfaces.library.roots.sys_func_rcomm¶
- naginterfaces.library.roots.sys_func_rcomm(irevcm, x, fvec, ml, mu, mode, diag, fjac, r, qtf, comm, xtol=1.0536712127723509e-08, epsfcn=0.0, factor=100.0)[source]¶
sys_func_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.For full information please refer to the NAG Library document for c05qd
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/c05/c05qdf.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, .
- mlint
On initial entry: the number of subdiagonals within the band of the Jacobian matrix. (If the Jacobian is not banded, or you are unsure, set .)
- muint
On initial entry: the number of superdiagonals within the band of the Jacobian matrix. (If the Jacobian is not banded, or you are unsure, set .)
- 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 entry: if , must contain multiplicative scale factors for the variables.
If , need not be set.
On exit: the scale factors actually used (computed internally if ).
- fjacfloat, ndarray, shape , modified in place
On initial entry: need not be set.
On intermediate exit: must not be changed.
On final exit: the orthogonal matrix produced by the factorization of the final approximate Jacobian.
- 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.
- epsfcnfloat, optional
On initial entry: the order of the largest relative error in the functions. It is used in determining a suitable step for a forward difference approximation to the Jacobian. If is less than machine precision (returned by
machine.precision
) then machine precision is used. Consequently a value of will often be suitable.- 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_func_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_func_rcomm
, must contain the function values .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.
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- 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.
- (errno )
The iteration is not making good progress, as measured by the improvement from the last iterations.
- Notes
The system of equations is defined as:
sys_func_rcomm
is based on the MINPACK routine HYBRD (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. At the starting point, the Jacobian is approximated by forward differences, but these are not used again until the rank-1 method fails to produce satisfactory progress. 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