naginterfaces.library.roots.sys_​deriv_​expert

naginterfaces.library.roots.sys_deriv_expert(fcnval, fcnjac, fcnmon, x, mode, diag, nprint, xtol=1.0536712127723509e-08, maxfev=None, factor=100.0, data=None, spiked_sorder='C')[source]

sys_deriv_expert is a comprehensive 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 c05rc

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/c05/c05rcf.html

Parameters
fcnvalcallable fvec = fcnval(x, data=None)

must return the values of the functions at a point .

Parameters
xfloat, ndarray, shape

The components of the point at which the functions must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
fvecfloat, array-like, shape

must contain the function values .

fcnjaccallable fjac = fcnjac(x, data=None)

must return the Jacobian at .

Parameters
xfloat, ndarray, shape

The components of the point at which the Jacobian must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
fjacfloat, array-like, shape

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

fcnmoncallable fcnmon(x, fvec, fjac, data=None)

may be used to monitor the progress of the algorithm.

Parameters
xfloat, ndarray, shape

The components of the current evaluation point .

fvecfloat, ndarray, shape

contains the function values .

fjacfloat, ndarray, shape

contains the value of at the point , for , for .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

xfloat, array-like, shape

An initial guess at the solution vector.

modeint

Indicates whether or not you have provided scaling factors in .

If , the scaling must have been specified in .

Otherwise, if , the variables will be scaled internally.

diagfloat, array-like, shape

If , must contain multiplicative scale factors for the variables.

If , need not be set.

nprintint

Indicates whether (and how often) calls to are to be made.

No calls are made.

is called at the beginning of the first iteration, every iterations thereafter and immediately before the return from sys_deriv_expert.

xtolfloat, optional

The accuracy in to which the solution is required.

maxfevNone or int, optional

Note: if this argument is None then a default value will be used, determined as follows: .

The maximum number of calls to and combined. sys_deriv_expert will exit with = 2, if, at the end of an iteration, the number of calls to and combined exceeds .

factorfloat, optional

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 .)

dataarbitrary, optional

User-communication data for callback functions.

spiked_sorderstr, optional

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

spiked_sorder =

row-major storage will be used;

spiked_sorder =

column-major storage will be used.

Returns
xfloat, ndarray, shape

The final estimate of the solution vector.

fvecfloat, ndarray, shape

The function values at the final point returned in .

fjacfloat, ndarray, shape

The orthogonal matrix produced by the factorization of the final approximate Jacobian.

diagfloat, ndarray, shape

The scale factors actually used (computed internally if ).

nfevint

The number of calls made to and combined to evaluate the functions.

njevint

The number of calls made to .

rfloat, ndarray, shape

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

qtffloat, ndarray, shape

The vector .

Raises
NagValueError
(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: .

Warns
NagAlgorithmicWarning
(errno )

There have been at least calls to and combined: . Consider restarting the calculation from the final point held in .

(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_expert 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_expert from a different starting point may avoid the region of difficulty.

NagCallbackTerminateWarning
(errno )

Termination requested in , or .

Notes

The system of equations is defined as:

sys_deriv_expert 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. At the starting point, the Jacobian is requested, but it is not asked for 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