﻿ e05us Method
e05us is designed to find the global minimum of an arbitrary smooth sum of squares function subject to constraints (which may include simple bounds on the variables, linear constraints and smooth nonlinear constraints) by generating a number of different starting points and performing a local search from each using sequential quadratic programming.

# Syntax

C#
public static void e05us(
int m,
int n,
int nclin,
int ncnln,
double[,] a,
double[] bl,
double[] bu,
double[] y,
E05..::..E05US_CONFUN confun,
E05..::..E05US_OBJFUN objfun,
int npts,
double[,] x,
E05..::..E05US_START start,
bool repeat1,
int nb,
double[] objf,
double[,] f,
double[,,] fjac,
int sdfjac,
int[] iter,
double[,] c,
double[,,] cjac,
int sdcjac,
double[,] clamda,
int[,] istate,
E05..::..e05usOptions options,
int[] info,
out int ifail
)
Visual Basic
Public Shared Sub e05us ( _
m As Integer, _
n As Integer, _
nclin As Integer, _
ncnln As Integer, _
a As Double(,), _
bl As Double(), _
bu As Double(), _
y As Double(), _
confun As E05..::..E05US_CONFUN, _
objfun As E05..::..E05US_OBJFUN, _
npts As Integer, _
x As Double(,), _
start As E05..::..E05US_START, _
repeat1 As Boolean, _
nb As Integer, _
objf As Double(), _
f As Double(,), _
fjac As Double(,,), _
sdfjac As Integer, _
iter As Integer(), _
c As Double(,), _
cjac As Double(,,), _
sdcjac As Integer, _
clamda As Double(,), _
istate As Integer(,), _
options As E05..::..e05usOptions, _
info As Integer(), _
<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void e05us(
int m,
int n,
int nclin,
int ncnln,
array<double,2>^ a,
array<double>^ bl,
array<double>^ bu,
array<double>^ y,
E05..::..E05US_CONFUN^ confun,
E05..::..E05US_OBJFUN^ objfun,
int npts,
array<double,2>^ x,
E05..::..E05US_START^ start,
bool repeat1,
int nb,
array<double>^ objf,
array<double,2>^ f,
array<double,3>^ fjac,
int sdfjac,
array<int>^ iter,
array<double,2>^ c,
array<double,3>^ cjac,
int sdcjac,
array<double,2>^ clamda,
array<int,2>^ istate,
E05..::..e05usOptions^ options,
array<int>^ info,
[OutAttribute] int% ifail
)
F#
static member e05us :
m : int *
n : int *
nclin : int *
ncnln : int *
a : float[,] *
bl : float[] *
bu : float[] *
y : float[] *
confun : E05..::..E05US_CONFUN *
objfun : E05..::..E05US_OBJFUN *
npts : int *
x : float[,] *
start : E05..::..E05US_START *
repeat1 : bool *
nb : int *
objf : float[] *
f : float[,] *
fjac : float[,,] *
sdfjac : int *
iter : int[] *
c : float[,] *
cjac : float[,,] *
sdcjac : int *
clamda : float[,] *
istate : int[,] *
options : E05..::..e05usOptions *
info : int[] *
ifail : int byref -> unit

#### Parameters

m
Type: System..::..Int32
On entry: $m$, the number of subfunctions associated with $F\left(x\right)$.
Constraint: ${\mathbf{m}}>0$.
n
Type: System..::..Int32
On entry: $n$, the number of variables.
Constraint: ${\mathbf{n}}>0$.
nclin
Type: System..::..Int32
On entry: ${n}_{L}$, the number of general linear constraints.
Constraint: ${\mathbf{nclin}}\ge 0$.
ncnln
Type: System..::..Int32
On entry: ${n}_{N}$, the number of nonlinear constraints.
Constraint: ${\mathbf{ncnln}}\ge 0$.
a
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{nclin}}$
Note: the second dimension of the array a must be at least ${\mathbf{n}}$ if ${\mathbf{nclin}}>0$, and at least $1$ otherwise.
On entry: the matrix ${A}_{L}$ of general linear constraints in (1). That is, the $\mathit{i}$th row contains the coefficients of the $\mathit{i}$th general linear constraint, for $\mathit{i}=1,2,\dots ,{\mathbf{nclin}}$.
If ${\mathbf{nclin}}=0$, the array a is not referenced.
bl
Type: array<System..::..Double>[]()[][]
An array of size [${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$]
On entry: bl must contain the lower bounds and bu the upper bounds for all the constraints in the following order. The first $n$ elements of each array must contain the bounds on the variables, the next ${n}_{L}$ elements the bounds for the general linear constraints (if any) and the next ${n}_{N}$ elements the bounds for the general nonlinear constraints (if any). To specify a nonexistent lower bound (i.e., ${l}_{j}=-\infty$), set ${\mathbf{bl}}\left[j-1\right]\le -\mathit{bigbnd}$, and to specify a nonexistent upper bound (i.e., ${u}_{j}=+\infty$), set ${\mathbf{bu}}\left[j-1\right]\ge \mathit{bigbnd}$; the default value of $\mathit{bigbnd}$ is ${10}^{20}$, but this may be changed by the optional parameter Infinite Bound Size. To specify the $j$th constraint as an equality, set ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]=\beta$, say, where $\left|\beta \right|<\mathit{bigbnd}$.
Constraints:
• ${\mathbf{bl}}\left[\mathit{j}-1\right]\le {\mathbf{bu}}\left[\mathit{j}-1\right]$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$;
• if ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]=\beta$, $\left|\beta \right|<\mathit{bigbnd}$.
bu
Type: array<System..::..Double>[]()[][]
An array of size [${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$]
On entry: bl must contain the lower bounds and bu the upper bounds for all the constraints in the following order. The first $n$ elements of each array must contain the bounds on the variables, the next ${n}_{L}$ elements the bounds for the general linear constraints (if any) and the next ${n}_{N}$ elements the bounds for the general nonlinear constraints (if any). To specify a nonexistent lower bound (i.e., ${l}_{j}=-\infty$), set ${\mathbf{bl}}\left[j-1\right]\le -\mathit{bigbnd}$, and to specify a nonexistent upper bound (i.e., ${u}_{j}=+\infty$), set ${\mathbf{bu}}\left[j-1\right]\ge \mathit{bigbnd}$; the default value of $\mathit{bigbnd}$ is ${10}^{20}$, but this may be changed by the optional parameter Infinite Bound Size. To specify the $j$th constraint as an equality, set ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]=\beta$, say, where $\left|\beta \right|<\mathit{bigbnd}$.
Constraints:
• ${\mathbf{bl}}\left[\mathit{j}-1\right]\le {\mathbf{bu}}\left[\mathit{j}-1\right]$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$;
• if ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]=\beta$, $\left|\beta \right|<\mathit{bigbnd}$.
y
Type: array<System..::..Double>[]()[][]
An array of size [m]
On entry: the coefficients of the constant vector $y$ of the objective function.
confun
Type: NagLibrary..::..E05..::..E05US_CONFUN
confun must calculate the vector $c\left(x\right)$ of nonlinear constraint functions and (optionally) its Jacobian ($\text{}=\frac{\partial c}{\partial x}$) for a specified $n$-element vector $x$. If there are no nonlinear constraints (i.e., ${\mathbf{ncnln}}=0$), confun will never be called by e05us and confun may be the dummy method E04UDM. (E04UDM is included in the NAG Library.) If there are nonlinear constraints, the first call to confun will occur before the first call to objfun.

A delegate of type E05US_CONFUN.

confun should be tested separately before being used in conjunction with e05us. See also the description of the optional parameter Verify.
objfun
Type: NagLibrary..::..E05..::..E05US_OBJFUN
objfun must calculate either the $i$th element of the vector $f\left(x\right)={\left({f}_{1}\left(x\right),{f}_{2}\left(x\right),\dots ,{f}_{m}\left(x\right)\right)}^{\mathrm{T}}$ or all $m$ elements of $f\left(x\right)$ and (optionally) its Jacobian ($\text{}=\frac{\partial f}{\partial x}$) for a specified $n$-element vector $x$.

A delegate of type E05US_OBJFUN.

objfun should be tested separately before being used in conjunction with e05us. See also the description of the optional parameter Verify.
npts
Type: System..::..Int32
On entry: the number of different starting points to be generated and used. The more points used, the more likely that the best returned solution will be a global minimum.
Constraint: $1\le {\mathbf{nb}}\le {\mathbf{npts}}$.
x
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{n}}$
Note: the second dimension of the array x must be at least ${\mathbf{nb}}$.
On exit: ${\mathbf{x}}\left[\mathit{j}-1,i-1\right]$ contains the final estimate of the $i$th solution, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}$.
start
Type: NagLibrary..::..E05..::..E05US_START
start must calculate the npts starting points to be used by the local optimizer. If you do not wish to write a method specific to your problem then E05UCZ may be used as the actual argument. E05UCZ is supplied in the NAG Library and uses the NAG quasi-random number generators to distribute starting points uniformly across the domain. It is affected by the value of repeat1.

A delegate of type E05US_START.

repeat1
Type: System..::..Boolean
On entry: is passed as an argument to start and may be used to initialize a random number generator to a repeatable, or non-repeatable, sequence. See [Further Comments] for more detail.
nb
Type: System..::..Int32
On entry: the number of solutions to be returned. The method saves up to nb local minima ordered by increasing value of the final objective function. If the defining criterion for ‘best solution’ is only that the value of the objective function is as small as possible then nb should be set to $1$. However, if you want to look at other solutions that may have desirable properties then setting ${\mathbf{nb}}>1$ will produce nb local minima, ordered by increasing value of their objective functions at the minima.
Constraint: $1\le {\mathbf{nb}}\le {\mathbf{npts}}$.
objf
Type: array<System..::..Double>[]()[][]
An array of size [nb]
On exit: ${\mathbf{objf}}\left[i-1\right]$ contains the value of the objective function at the final iterate for the $i$th solution.
f
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [m, dim2]
Note: the second dimension of the array f must be at least ${\mathbf{nb}}$.
On exit: ${\mathbf{f}}\left[\mathit{j}-1,i-1\right]$ contains the value of the $\mathit{j}$th function ${f}_{j}$ at the final iterate, for $\mathit{j}=1,2,\dots ,{\mathbf{m}}$, for the $\mathit{i}$th solution, for $\mathit{i}=1,2,\dots ,{\mathbf{nb}}$.
fjac
Type: array<System..::..Double,3>[,](,)[,][,]
An array of size [dim1, sdfjac, dim3]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{m}}$
Note: the last dimension of the array fjac must be at least ${\mathbf{nb}}$.
On exit: for the $i$th returned solution, the Jacobian matrix of the functions ${f}_{1},{f}_{2},\dots ,{f}_{m}$ at the final iterate, i.e., ${\mathbf{fjac}}\left[\mathit{k}-1,\mathit{j}-1,\mathit{i}-1\right]$ contains the partial derivative of the $\mathit{k}$th function with respect to the $\mathit{j}$th variable, for $\mathit{k}=1,2,\dots ,{\mathbf{m}}$, $\mathit{j}=1,2,\dots ,{\mathbf{n}}$ and $\mathit{i}=1,2,\dots ,{\mathbf{nb}}$. (See also the discussion of parameter fjsl under objfun.)
sdfjac
Type: System..::..Int32
the second dimension of the array fjac.
On entry: the second dimension of the array fjac as declared in the (sub)program from which e05us is called.
Constraint: ${\mathbf{sdfjac}}\ge {\mathbf{n}}$.
iter
Type: array<System..::..Int32>[]()[][]
An array of size [nb]
On exit: ${\mathbf{iter}}\left[i-1\right]$ contains the number of major iterations performed to obtain the $i$th solution. If less than nb solutions are returned then ${\mathbf{iter}}\left[{\mathbf{nb}}-1\right]$ contains the number of starting points that have resulted in a converged solution. If this is close to npts then this might be indicative that fewer than nb local minima exist.
c
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{ncnln}}$
Note: the second dimension of the array c must be at least ${\mathbf{nb}}$.
On exit: if ${\mathbf{ncnln}}>0$, ${\mathbf{c}}\left[\mathit{j}-1,\mathit{i}-1\right]$ contains the value of the $\mathit{j}$th nonlinear constraint function ${c}_{\mathit{j}}$ at the final iterate, for the $\mathit{i}$th solution, for $\mathit{j}=1,2,\dots ,{\mathbf{ncnln}}$.
If ${\mathbf{ncnln}}=0$, the array c is not referenced.
cjac
Type: array<System..::..Double,3>[,](,)[,][,]
An array of size [dim1, sdcjac, dim3]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{ncnln}}$
Note: the last dimension of the array cjac must be at least ${\mathbf{nb}}$.
On exit: if ${\mathbf{ncnln}}>0$, cjac contains the Jacobian matrices of the nonlinear constraint functions at the final iterate for each of the returned solutions, i.e., ${\mathbf{cjac}}\left[\mathit{k}-1,\mathit{j}-1,i-1\right]$ contains the partial derivative of the $\mathit{k}$th constraint function with respect to the $\mathit{j}$th variable, for $\mathit{k}=1,2,\dots ,{\mathbf{ncnln}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{n}}$, for the $i$th solution. (See the discussion of parameter cjsl under confun.)
If ${\mathbf{ncnln}}=0$, the array cjac is not referenced.
sdcjac
Type: System..::..Int32
the second dimension of the array cjac.
On entry: the second dimension of the array cjac as declared in the (sub)program from which e05us is called.
Constraint: if ${\mathbf{ncnln}}>0$, ${\mathbf{sdcjac}}\ge {\mathbf{n}}$.
clamda
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$
Note: the second dimension of the array clamda must be at least ${\mathbf{nb}}$.
On exit: the values of the QP multipliers from the last QP subproblem solved for the $i$th solution. ${\mathbf{clamda}}\left[j-1,i-1\right]$ should be non-negative if ${\mathbf{istate}}\left[j-1,i-1\right]=1$ and non-positive if ${\mathbf{istate}}\left[j-1,i-1\right]=2$.
istate
Type: array<System..::..Int32,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: $\mathrm{dim1}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$
Note: the second dimension of the array istate must be at least ${\mathbf{nb}}$.
On exit: ${\mathbf{istate}}\left[j-1,i-1\right]$ contains the status of the constraints in the QP working set for the $i$th solution. The significance of each possible value of ${\mathbf{istate}}\left[j-1,i-1\right]$ is as follows:
 ${\mathbf{istate}}\left[j-1,i-1\right]$ Meaning $\phantom{-}0$ The constraint is satisfied to within the feasibility tolerance, but is not in the QP working set. $\phantom{-}1$ This inequality constraint is included in the QP working set at its lower bound. $\phantom{-}2$ This inequality constraint is included in the QP working set at its upper bound. $\phantom{-}3$ This constraint is included in the QP working set as an equality. This value of istate can occur only when ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]$.
options
Type: NagLibrary..::..E05..::..e05usOptions
An Object of type E05.e05usOptions. Used to configure optional parameters to this method.
info
Type: array<System..::..Int32>[]()[][]
An array of size [nb]
On exit: if ${\mathbf{ifail}}={0}$, ${\mathbf{info}}\left[i-1\right]$ does not contain an error value returned by e04us .
If ${\mathbf{ifail}}={8}$ on exit, then not all nb solutions have been found, and ${\mathbf{info}}\left[{\mathbf{nb}}-1\right]$ contains the number of solutions actually found.
ifail
Type: System..::..Int32%
On exit: ${\mathbf{ifail}}={0}$ unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

# Description

The local minimization method is (E04USA not in this release). The problem is assumed to be stated in the following form:
 $minimizex∈Rn​ ​Fx=12∑i=1myi-fix2 subject to l≤xALxcx≤u,$ (1)
where $F\left(x\right)$ (the objective function) is a nonlinear function which can be represented as the sum of squares of $m$ subfunctions $\left({y}_{1}-{f}_{1}\left(x\right)\right),\left({y}_{2}-{f}_{2}\left(x\right)\right),\dots ,\left({y}_{m}-{f}_{m}\left(x\right)\right)$, the ${y}_{i}$ are constant, ${A}_{L}$ is an ${n}_{L}$ by $n$ constant linear constraint matrix, and $c\left(x\right)$ is an ${n}_{N}$ element vector of nonlinear constraint functions. (The matrix ${A}_{L}$ and the vector $c\left(x\right)$ may be empty.) The objective function and the constraint functions are assumed to be smooth, i.e., at least twice-continuously differentiable. (This method will usually solve (1) if any isolated discontinuities are away from the solution.)
e05us solves a user-specified number of local optimization problems with different starting points. You may specify the starting points via the method start. If a random number generator is used to generate the starting points then the parameter repeat1 allows you to specify whether a repeatable set of points are generated or whether different starting points are generated on different calls. The resulting local minima are ordered and the best nb results returned in order of ascending values of the resulting objective function values at the minima. Thus the value returned in position $1$ will be the best result obtained. If a sufficiently high number of different points are chosen then this is likely to be the global minimum.

# References

Gill P E, Murray W and Wright M H (1981) Practical Optimization Academic Press
Hock W and Schittkowski K (1981) Test Examples for Nonlinear Programming Codes. Lecture Notes in Economics and Mathematical Systems 187 Springer–Verlag

# Error Indicators and Warnings

Note: e05us may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDA, LDX, LDFJAC, LDC, LDCJAC, LDCLDA, LISTAT) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
${\mathbf{ifail}}=1$
An input value is incorrect. One, or more, of the following requirements are violated:
• ${\mathbf{listat}}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$;
• ${\mathbf{ldc}}\ge {\mathbf{ncnln}}$;
• ${\mathbf{sdcjac}}\ge {\mathbf{n}}$ and ${\mathbf{ncnln}}>0$;
• ${\mathbf{ldx}}\ge {\mathbf{n}}$;
• ${\mathbf{m}}>0$;
• ${\mathbf{sdcjac}}\ge 1$ and ${\mathbf{ncnln}}=0$;
• ${\mathbf{ldclda}}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$;
• $\mathbf{_ldr}\ge {\mathbf{n}}$;
• $\mathbf{_sdr}\ge {\mathbf{n}}$;
• ${\mathbf{n}}>0$;
• ${\mathbf{nclin}}\ge 0$;
• ${\mathbf{ncnln}}\ge 0$;
• ${\mathbf{lda}}\ge {\mathbf{nclin}}$;
• ${\mathbf{ldcjac}}\ge {\mathbf{ncnln}}$;
• ${\mathbf{ldfjac}}\ge {\mathbf{m}}$;
• ${\mathbf{bl}}\left[i-1\right]\le {\mathbf{bu}}\left[i-1\right]$ for all $i$;
• ${\mathbf{sdfjac}}\ge {\mathbf{n}}$;
• ${\mathbf{nb}}<1$;
• ${\mathbf{nb}}>{\mathbf{npts}}$.
Set ${\mathbf{ifail}}={-}{1}$ and re-enter e05us for more detailed information.
${\mathbf{ifail}}=2$
e05us has terminated without finding any solutions. The majority of calls to the local optimizer have failed to find a feasible point for the linear constraints and bounds, which means that either no feasible point exists for the given value of the optional parameter Linear Feasibility Tolerance (default value $\sqrt{{\mathbf{x02aj}}}$, the square root of the machine precision, or no feasible point could be found in the number of iterations specified by the optional parameter Minor Iteration Limit. You should check that there are no constraint redundancies. If the data for the constraints are accurate only to an absolute precision $\sigma$, you should ensure that the value of the optional parameter Linear Feasibility Tolerance is greater than $\sigma$. For example, if all elements of ${A}_{L}$ are of order unity and are accurate to only three decimal places, Linear Feasibility Tolerance should be at least ${10}^{-3}$.
${\mathbf{ifail}}=3$
e05us has failed to find any solutions. The majority of local optimizations could not find a feasible point for the nonlinear constraints. The problem may have no feasible solution. This behaviour will occur if there is no feasible point for the nonlinear constraints. (However, there is no general test that can determine whether a feasible point exists for a set of nonlinear constraints.)
${\mathbf{ifail}}=4$
e05us has failed to find any solutions. The majority of local optimizations have failed because the limiting number of iterations have been reached.
${\mathbf{ifail}}=5$
${\mathbf{ifail}}=7$
The user-supplied derivatives of the objective function and/or nonlinear constraints appear to be incorrect.
Large errors were found in the derivatives of the objective function and/or nonlinear constraints. This value of ifail will occur if the verification process indicated that at least one gradient or Jacobian element had no correct figures. You should refer to or enable the printed output to determine which elements are suspected to be in error.
As a first-step, you should check that the code for the objective and constraint values is correct – for example, by computing the function at a point where the correct value is known. However, care should be taken that the chosen point fully tests the evaluation of the function. It is remarkable how often the values $x=0$ or $x=1$ are used to test function evaluation procedures, and how often the special properties of these numbers make the test meaningless.
Special care should be used in this test if computation of the objective function involves subsidiary data communicated in storage, including iuser and ruser in a multithreaded environment. Although the first evaluation of the function may be correct, subsequent calculations may be in error because some of the subsidiary data has accidentally been overwritten.
Gradient checking will be ineffective if the objective function uses information computed by the constraints, since they are not necessarily computed before each function evaluation.
Errors in programming the function may be quite subtle in that the function value is almost correct. For example, the function may not be accurate to full precision because of the inaccurate calculation of a subsidiary quantity, or the limited accuracy of data upon which the function depends. A common error on machines where numerical calculations are usually performed in double precision is to include even one single precision constant in the calculation of the function; since some compilers do not convert such constants to double precision, half the correct figures may be lost by such a seemingly trivial error.
${\mathbf{ifail}}=8$
Not all nb solutions have been found. ${\mathbf{info}}\left[{\mathbf{nb}}-1\right]$ contains the number actually found.
${\mathbf{ifail}}=9$
You terminated the computation by setting ${\mathbf{mode}}<0$ in start.
If E05UCZ has been used as the actual argument for start then the message displayed, when ${\mathbf{ifail}}={0}$ or ${-}{1}$ on entry to e05us, will have the following meaning:
 $-998$ – failure to allocate space, a smaller value of npts should be tried; $-997$ – an internal error has occurred. Please contact NAG for assistance.
${\mathbf{ifail}}=10$
Failed to initialize optional parameter arrays.
${\mathbf{ifail}}=-9000$
An error occured, see message report.
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-4000$
Invalid dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-8000$
Negative dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$

# Accuracy

If ${\mathbf{ifail}}={0}$ on exit and the value of ${\mathbf{info}}\left[i-1\right]=0$, then the vector returned in the array x for solution $i$ is an estimate of the solution to an accuracy of approximately Optimality Tolerance.

# Parallelism and Performance

None.

You should be wary of requesting much intermediate output from the local optimizer, since large volumes may be produced if npts is large.
The auxiliary routine E05UCZ makes use of the NAG quasi-random Sobol generator (g05yl and g05ym). If E05UCZ is used as the actual argument for start and ${\mathbf{repeat1}}=\mathrm{false}$ then a randomly chosen value for iskip is used, otherwise iskip is set to $100$. If repeat1 is set to false and the program is executed several times, each time producing the same best answer, then there is increased probability that this answer is a global minimum. However, if it is important that identical results be obtained on successive runs, then repeat1 should be set to true.

# Example

This example is based on Problem 57 in Hock and Schittkowski (1981) and involves the minimization of the sum of squares function
 $Fx=12∑i=144yi-fix2,$
where
 $fix=x1+0.49-x1e-x2ai-8$
and
 $iyiaiiyiai10.498230.412220.498240.402230.4810250.422440.4710260.402450.4810270.402460.4710280.412670.4612290.402680.4612300.412690.4512310.4128100.4312320.4028110.4514330.4030120.4314340.4030130.4314350.3830140.4416360.4132150.4316370.4032160.4316380.4034170.4618390.4136180.4518400.3836190.4220410.4038200.4220420.4038210.4320430.3940220.4122440.3942$
subject to the bounds
 $x1≥-0.4x2≥-4.0$
to the general linear constraint
 $x1+x2≥1.0$
and to the nonlinear constraint
 $0.49x2-x1x2≥0.09.$
The optimal solution (to five figures) is
 $x*=0.41995,1.28484T,$
and $F\left({x}^{*}\right)=0.01423$. The nonlinear constraint is active at the solution.

Example program (C#): e05use.cs

Example program data: e05use.d

Example program results: e05use.r