E04VJF may be used before
E04VHF to determine the sparsity pattern for the Jacobian.
SUBROUTINE E04VJF ( |
NF, N, USRFUN, IAFUN, JAVAR, A, LENA, NEA, IGFUN, JGVAR, LENG, NEG, X, XLOW, XUPP, CW, LENCW, IW, LENIW, RW, LENRW, CUSER, IUSER, RUSER, IFAIL) |
INTEGER |
NF, N, IAFUN(LENA), JAVAR(LENA), LENA, NEA, IGFUN(LENG), JGVAR(LENG), LENG, NEG, LENCW, IW(LENIW), LENIW, LENRW, IUSER(*), IFAIL |
REAL (KIND=nag_wp) |
A(LENA), X(N), XLOW(N), XUPP(N), RW(LENRW), RUSER(*) |
CHARACTER(8) |
CW(LENCW), CUSER(*) |
EXTERNAL |
USRFUN |
|
When using
E04VHF, if you set the optional parameter
and
USRFUN provides none of the derivatives, you may need to call E04VJF to determine the input arrays
IAFUN,
JAVAR,
A,
IGFUN and
JGVAR. These arrays define the pattern of nonzeros in the Jacobian matrix. A typical sequence of calls could be
E04VJF determines the sparsity pattern for the Jacobian and identifies the constant elements automatically. To do so, E04VJF approximates the problem functions,
, at three random perturbations of the given initial point
. If an element of the approximate Jacobian is the same at all three points, then it is taken to be constant. If it is zero, it is taken to be identically zero. Since the random points are not chosen close together, the heuristic will correctly classify the Jacobian elements in the vast majority of cases. In general, E04VJF finds that the Jacobian can be permuted to the form:
where
,
and
are constant. Note that
might contain elements that are also constant, but E04VJF must classify them as nonlinear. This is because
E04VHF ‘removes’ linear variables from the calculation of
by setting them to zero before calling
USRFUN. A knowledgeable user would be able to move such elements from
in
USRFUN and enter them as part of
IAFUN,
JAVAR and
A for
E04VHF.
Note: all optional parameters are described in detail in
Section 11.1 in E04VHF.
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Not applicable.
None.
This example shows how to call E04VJF to determine the sparsity pattern of the Jacobian before calling
E04VHF to solve a sparse nonlinear programming problem without providing the Jacobian information in
USRFUN.
It is a reformulation of Problem 74 from
Hock and Schittkowski (1981) and involves the minimization of the nonlinear function
subject to the bounds
to the nonlinear constraints
and to the linear constraints
The initial point, which is infeasible, is
and
.
The optimal solution (to five figures) is
and
. All the nonlinear constraints are active at the solution.
The formulation of the problem combines the constraints and the objective into a single vector (
).