naginterfaces.library.roots.sys_deriv_easy¶
- naginterfaces.library.roots.sys_deriv_easy(fcnval, fcnjac, x, xtol=1.0536712127723509e-08, data=None, spiked_sorder='C')[source]¶
sys_deriv_easy
is an easy-to-use 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 c05rb
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/c05/c05rbf.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 .
- xfloat, array-like, shape
An initial guess at the solution vector.
- xtolfloat, optional
The accuracy in to which the solution is required.
- 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.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Warns
- NagAlgorithmicWarning
- (errno )
There have been at least calls to and combined. Consider restarting the calculation from the point held in .
- (errno )
No further improvement in the solution is possible. is too small: .
- (errno )
The iteration is not making good progress. 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_easy
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_easy
is based on the MINPACK routine HYBRJ1 (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