Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_glopt_nlp_multistart_sqp_lsq (e05us)

## Purpose

nag_glopt_nlp_multistart_sqp_lsq (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

[x, objf, f, fjac, iter, c, cjac, clamda, istate, iopts, opts, user, info, ifail] = e05us(n, ncnln, a, bl, bu, y, confun, objfun, npts, start, repeat1, nb, iopts, opts, 'm', m, 'nclin', nclin, 'user', user)
[x, objf, f, fjac, iter, c, cjac, clamda, istate, iopts, opts, user, info, ifail] = nag_glopt_nlp_multistart_sqp_lsq(n, ncnln, a, bl, bu, y, confun, objfun, npts, start, repeat1, nb, iopts, opts, 'm', m, 'nclin', nclin, 'user', user)
Before calling nag_glopt_nlp_multistart_sqp_lsq (e05us), the optional parameter arrays iopts and opts must be initialized for use with nag_glopt_nlp_multistart_sqp_lsq (e05us) by calling nag_glopt_optset (e05zk) with optstr set to ‘Initialize = e05usc’. Optional parameters may subsequently be specified by calling nag_glopt_optset (e05zk) before the call to nag_glopt_nlp_multistart_sqp_lsq (e05us).
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 24: user added as parameter to start, r no longer returned
.

## Description

The local minimization method is (e04us). The problem is assumed to be stated in the following form:
m
minimize ​ ​F(x) = (1/2) (yifi(x)) 2  subject to  l(
 x ALx c(x)
)
u,
xRn i = 1
$minimize x∈Rn ​ ​ F(x) = 12 ∑ i=1 m ( yi- fi (x) ) 2 subject to l≤ x ALx c(x) ≤u,$
(1)
where F(x)$F\left(x\right)$ (the objective function) is a nonlinear function which can be represented as the sum of squares of m$m$ subfunctions (y1f1(x)),(y2f2(x)),,(ymfm(x))$\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 yi${y}_{i}$ are constant, AL${A}_{L}$ is an nL${n}_{L}$ by n$n$ constant linear constraint matrix, and c(x)$c\left(x\right)$ is an nN${n}_{N}$ element vector of nonlinear constraint functions. (The matrix AL${A}_{L}$ and the vector c(x)$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. (The method of (e04us) will usually solve (1) if any isolated discontinuities are away from the solution.)
nag_glopt_nlp_multistart_sqp_lsq (e05us) solves a user-specified number of local optimization problems with different starting points. You may specify the starting points via the function 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$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

## Parameters

### Compulsory Input Parameters

1:     n – int64int32nag_int scalar
n$n$, the number of variables.
Constraint: n > 0${\mathbf{n}}>0$.
2:     ncnln – int64int32nag_int scalar
nN${n}_{N}$, the number of nonlinear constraints.
Constraint: ncnln0${\mathbf{ncnln}}\ge 0$.
3:     a(lda, : $:$) – double array
The first dimension of the array a must be at least nclin${\mathbf{nclin}}$
The second dimension of the array must be at least n${\mathbf{n}}$ if nclin > 0${\mathbf{nclin}}>0$, and at least 1$1$ otherwise
The matrix AL${A}_{L}$ of general linear constraints in (1). That is, the i$\mathit{i}$th row contains the coefficients of the i$\mathit{i}$th general linear constraint, for i = 1,2,,nclin$\mathit{i}=1,2,\dots ,{\mathbf{nclin}}$.
If nclin = 0${\mathbf{nclin}}=0$, the array a is not referenced.
4:     bl(${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – double array
5:     bu(${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – double array
bl must contain the lower bounds and bu the upper bounds for all the constraints in the following order. The first n$n$ elements of each array must contain the bounds on the variables, the next nL${n}_{L}$ elements the bounds for the general linear constraints (if any) and the next nN${n}_{N}$ elements the bounds for the general nonlinear constraints (if any). To specify a nonexistent lower bound (i.e., lj = ${l}_{j}=-\infty$), set bl(j)bigbnd${\mathbf{bl}}\left(j\right)\le -\mathit{bigbnd}$, and to specify a nonexistent upper bound (i.e., uj = + ${u}_{j}=+\infty$), set bu(j)bigbnd${\mathbf{bu}}\left(j\right)\ge \mathit{bigbnd}$; the default value of bigbnd$\mathit{bigbnd}$ is 1020${10}^{20}$, but this may be changed by the optional parameter Infinite Bound Size. To specify the j$j$th constraint as an equality, set bl(j) = bu(j) = β${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)=\beta$, say, where |β| < bigbnd$|\beta |<\mathit{bigbnd}$.
Constraints:
• bl(j)bu(j)${\mathbf{bl}}\left(\mathit{j}\right)\le {\mathbf{bu}}\left(\mathit{j}\right)$, for j = 1,2,,n + nclin + ncnln$\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$;
• if bl(j) = bu(j) = β${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)=\beta$, |β| < bigbnd$|\beta |<\mathit{bigbnd}$.
6:     y(m) – double array
m, the dimension of the array, must satisfy the constraint m > 0${\mathbf{m}}>0$.
The coefficients of the constant vector y$y$ of the objective function.
7:     confun – function handle or string containing name of m-file
confun must calculate the vector c(x)$c\left(x\right)$ of nonlinear constraint functions and (optionally) its Jacobian ( = (c)/(x) $\text{}=\frac{\partial c}{\partial x}$) for a specified n$n$-element vector x$x$. If there are no nonlinear constraints (i.e., ncnln = 0${\mathbf{ncnln}}=0$), confun will never be called by nag_glopt_nlp_multistart_sqp_lsq (e05us) and confun may be the string 'e04udm'. (nag_opt_nlp1_dummy_confun (e04udm) is included in the NAG Toolbox.) If there are nonlinear constraints, the first call to confun will occur before the first call to objfun.
[mode, c, cjsl, user] = confun(mode, ncnln, n, ldcjsl, needc, x, cjsl, nstate, user)

Input Parameters

1:     mode – int64int32nag_int scalar
Indicates which values must be assigned during each call of confun. Only the following values need be assigned, for each value of i$i$ such that needc(i) > 0${\mathbf{needc}}\left(i\right)>0$:
mode = 0${\mathbf{mode}}=0$
c(i)${\mathbf{c}}\left(i\right)$, the i$i$th nonlinear constraint.
mode = 1${\mathbf{mode}}=1$
All available elements in the i$i$th row of cjsl.
mode = 2${\mathbf{mode}}=2$
c(i)${\mathbf{c}}\left(i\right)$ and all available elements in the i$i$th row of cjsl.
2:     ncnln – int64int32nag_int scalar
nN${n}_{N}$, the number of nonlinear constraints.
3:     n – int64int32nag_int scalar
n$n$, the number of variables.
4:     ldcjsl – int64int32nag_int scalar
ldcjsl is the first dimension of the array cjsl.
5:     needc(ncnln) – int64int32nag_int array
The indices of the elements of c and/or cjsl that must be evaluated by confun. If needc(i) > 0${\mathbf{needc}}\left(i\right)>0$, c(i)${\mathbf{c}}\left(i\right)$ and/or the available elements of the i$i$th row of cjsl (see parameter mode) must be evaluated at x$x$.
6:     x(n) – double array
x$x$, the vector of variables at which the constraint functions and/or the available elements of the constraint Jacobian are to be evaluated.
7:     cjsl(ldcjsl, : $:$) – double array
The second dimension of the array must be at least n${\mathbf{n}}$
cjsl may be regarded as a two-dimensional ‘slice’ of the three-dimensional array cjac of nag_glopt_nlp_multistart_sqp_lsq (e05us).
Unless ${\mathbf{Derivative Level}}=2$ or 3$3$, the elements of cjsl are set to special values which enable nag_glopt_nlp_multistart_sqp_lsq (e05us) to detect whether they are changed by confun.
8:     nstate – int64int32nag_int scalar
If nstate = 1${\mathbf{nstate}}=1$ then nag_glopt_nlp_multistart_sqp_lsq (e05us) is calling confun for the first time on the current local optimization problem. This parameter setting allows you to save computation time if certain data must be read or calculated only once.
9:     user – Any MATLAB object
confun is called from nag_glopt_nlp_multistart_sqp_lsq (e05us) with the object supplied to nag_glopt_nlp_multistart_sqp_lsq (e05us).

Output Parameters

1:     mode – int64int32nag_int scalar
May be set to a negative value if you wish to abandon the solution to the current local minimization problem. In this case nag_glopt_nlp_multistart_sqp_lsq (e05us) will move to the next local minimization problem.
2:     c(ncnln) – double array
If needc(i) > 0${\mathbf{needc}}\left(i\right)>0$ and mode = 0${\mathbf{mode}}=0$ or 2$2$, c(i)${\mathbf{c}}\left(i\right)$ must contain the value of ci(x)${c}_{i}\left(x\right)$. The remaining elements of c, corresponding to the non-positive elements of needc, need not be set.
3:     cjsl(ldcjsl, : $:$) – double array
The second dimension of the array will be n${\mathbf{n}}$
cjsl may be regarded as a two-dimensional ‘slice’ of the three-dimensional array cjac of nag_glopt_nlp_multistart_sqp_lsq (e05us).
If needc(i) > 0${\mathbf{needc}}\left(i\right)>0$ and mode = 1${\mathbf{mode}}=1$ or 2$2$, the i$i$th row of cjsl must contain the available elements of the vector ci$\nabla {c}_{i}$ given by
 ∇ci = (( ∂ ci)/( ∂ x1),( ∂ ci)/( ∂ x2), … ,( ∂ ci)/( ∂ xn))T, $∇ci=( ∂ci ∂x1 , ∂ci ∂x2 ,…, ∂ci ∂xn )T,$
where (ci)/(xj) $\frac{\partial {c}_{i}}{\partial {x}_{j}}$ is the partial derivative of the i$i$th constraint with respect to the j$j$th variable, evaluated at the point x$x$. See also the parameter nstate. The remaining rows of cjsl, corresponding to non-positive elements of needc, need not be set.
If all elements of the constraint Jacobian are known (i.e., ${\mathbf{Derivative Level}}=2$ or 3$3$; note the default is ${\mathbf{Derivative Level}}=3$), any constant elements may be assigned to cjsl one time only at the start of each local optimization. An element of cjsl that is not subsequently assigned in confun will retain its initial value throughout the local optimization. Constant elements may be loaded into cjsl during the first call to confun for the local optimization (signalled by the value nstate = 1${\mathbf{nstate}}=1$). The ability to preload constants is useful when many Jacobian elements are identically zero, in which case cjsl may be initialized to zero and nonzero elements may be reset by confun.
Note that constant nonzero elements do affect the values of the constraints. Thus, if cjsl(i,j)${\mathbf{cjsl}}\left(i,j\right)$ is set to a constant value, it need not be reset in subsequent calls to confun, but the value cjsl(i,j) × x(j)${\mathbf{cjsl}}\left(i,j\right)×{\mathbf{x}}\left(j\right)$ must nonetheless be added to c(i)${\mathbf{c}}\left(i\right)$. For example, if cjsl(1,1) = 2${\mathbf{cjsl}}\left(1,1\right)=2$ and cjsl(1,2) = 5${\mathbf{cjsl}}\left(1,2\right)=-5$ then the term 2 × x(1)5 × x(2)$2×{\mathbf{x}}\left(1\right)-5×{\mathbf{x}}\left(2\right)$ must be included in the definition of c(1)${\mathbf{c}}\left(1\right)$.
It must be emphasized that, if ${\mathbf{Derivative Level}}=0$ or 1$1$, unassigned elements of cjsl are not treated as constant; they are estimated by finite differences, at nontrivial expense. If you do not supply a value for the optional parameter Difference Interval, an interval for each element of x$x$ is computed automatically at the start of each local optimization. The automatic procedure can usually identify constant elements of cjsl, which are then computed once only by finite differences.
4:     user – Any MATLAB object
confun should be tested separately before being used in conjunction with nag_glopt_nlp_multistart_sqp_lsq (e05us). See also the description of the optional parameter Verify.
8:     objfun – function handle or string containing name of m-file
objfun must calculate either the i$i$th element of the vector f(x) = (f1(x),f2(x),,fm(x))T $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$m$ elements of f(x)$f\left(x\right)$ and (optionally) its Jacobian ( = (f)/(x) $\text{}=\frac{\partial f}{\partial x}$) for a specified n$n$-element vector x$x$.
[mode, f, fjsl, user] = objfun(mode, m, n, ldfjsl, needfi, x, fjsl, nstate, user)

Input Parameters

1:     mode – int64int32nag_int scalar
Indicates which values must be assigned during each call of objfun. Only the following values need be assigned:
mode = 0${\mathbf{mode}}=0$ and needfi = i${\mathbf{needfi}}=i$, where i > 0$i>0$
f(i)${\mathbf{f}}\left(i\right)$.
mode = 0${\mathbf{mode}}=0$ and needfi < 0${\mathbf{needfi}}<0$
f.
mode = 1${\mathbf{mode}}=1$ and needfi < 0${\mathbf{needfi}}<0$
All available elements of fjsl.
mode = 2${\mathbf{mode}}=2$ and needfi < 0${\mathbf{needfi}}<0$
f and all available elements of fjsl.
2:     m – int64int32nag_int scalar
m$m$, the number of subfunctions.
3:     n – int64int32nag_int scalar
n$n$, the number of variables.
4:     ldfjsl – int64int32nag_int scalar
ldfjsl is the first dimension of the array fjsl.
5:     needfi – int64int32nag_int scalar
If needfi = i > 0${\mathbf{needfi}}=i>0$, only the i$i$th element of f(x)$f\left(x\right)$ needs to be evaluated at x$x$; the remaining elements need not be set. This can result in significant computational savings when mn$m\gg n$.
6:     x(n) – double array
x$x$, the vector of variables at which the objective function and/or all available elements of its gradient are to be evaluated.
7:     fjsl(ldfjsl, : $:$) – double array
The first dimension of the array fjsl must be at least
The second dimension of the array must be at least n${\mathbf{n}}$
fjsl may be regarded as a two-dimensional ‘slice’ of the three-dimensional array fjac of nag_glopt_nlp_multistart_sqp_lsq (e05us).
Is set to a special value.
8:     nstate – int64int32nag_int scalar
If nstate = 1${\mathbf{nstate}}=1$ then nag_glopt_nlp_multistart_sqp_lsq (e05us) is calling objfun for the first time on the current local optimization problem. This parameter setting allows you to save computation time if certain data must be read or calculated only once.
9:     user – Any MATLAB object
objfun is called from nag_glopt_nlp_multistart_sqp_lsq (e05us) with the object supplied to nag_glopt_nlp_multistart_sqp_lsq (e05us).

Output Parameters

1:     mode – int64int32nag_int scalar
May be set to a negative value if you wish to abandon the solution to the current local minimization problem. In this case nag_glopt_nlp_multistart_sqp_lsq (e05us) will move to the next local minimization problem.
2:     f(m) – double array
If mode = 0${\mathbf{mode}}=0$ and needfi = i > 0${\mathbf{needfi}}=i>0$, f(i)${\mathbf{f}}\left(i\right)$ must contain the value of fi${f}_{i}$ at x$x$.
If mode = 0${\mathbf{mode}}=0$ or 2$2$ and needfi < 0${\mathbf{needfi}}<0$, f(i)${\mathbf{f}}\left(\mathit{i}\right)$ must contain the value of fi${f}_{\mathit{i}}$ at x$x$, for i = 1,2,,m$\mathit{i}=1,2,\dots ,m$.
3:     fjsl(ldfjsl, : $:$) – double array
The first dimension of the array fjsl will be
The second dimension of the array will be n${\mathbf{n}}$
fjsl may be regarded as a two-dimensional ‘slice’ of the three-dimensional array fjac of nag_glopt_nlp_multistart_sqp_lsq (e05us).
If mode = 1${\mathbf{mode}}=1$ or 2$2$ and needfi < 0${\mathbf{needfi}}<0$, the i$i$th row of fjsl must contain the available elements of the vector fi$\nabla {f}_{i}$ given by
 ∇fi = ( ∂ fi / ∂ x1, ∂ fi / ∂ x2, … , ∂ fi / ∂ xn)T , $∇fi = ( ∂fi/ ∂x1, ∂fi/ ∂x2 ,…, ∂fi/ ∂xn )T ,$
evaluated at the point x$x$. See also the parameter nstate.
4:     user – Any MATLAB object
objfun should be tested separately before being used in conjunction with nag_glopt_nlp_multistart_sqp_lsq (e05us). See also the description of the optional parameter Verify.
9:     npts – int64int32nag_int scalar
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: 1nbnpts$1\le {\mathbf{nb}}\le {\mathbf{npts}}$.
10:   start – function handle or string containing name of m-file
start must calculate the npts starting points to be used by the local optimizer. If you do not wish to write a function specific to your problem then nag_glopt_multistart_start_points (e05ucz) may be used as the actual argument. nag_glopt_multistart_start_points (e05ucz) is supplied in the NAG Toolbox and uses the NAG quasi-random number generators to distribute starting points uniformly across the domain. It is affected by the value of repeat1.
[quas, user, mode] = start(npts, quas, n, repeat1, bl, bu, user, mode)

Input Parameters

1:     npts – int64int32nag_int scalar
Indicates the number of starting points.
2:     quas(n,npts) – double array
All elements of quas will have been set to zero, so only nonzero values need be set subsequently.
3:     n – int64int32nag_int scalar
The number of variables.
4:     repeat1 – logical scalar
Specifies whether a repeatable or non-repeatable sequence of points are to be generated.
5:     bl(n) – double array
The lower bounds on the variables. These may be used to ensure that the starting points generated in some sense ‘cover’ the region, but there is no requirement that a starting point be feasible.
6:     bu(n) – double array
The upper bounds on the variables. (See bl.)
7:     user – Any MATLAB object
start is called from nag_glopt_nlp_multistart_sqp_lsq (e05us) with the object supplied to nag_glopt_nlp_multistart_sqp_lsq (e05us).
8:     mode – int64int32nag_int scalar
mode will contain 0$0$.

Output Parameters

1:     quas(n,npts) – double array
Must contain the starting points for the npts local minimizations, i.e., quas(j,i)${\mathbf{quas}}\left(j,i\right)$ must contain the j$j$th component of the i$i$th starting point.
2:     user – Any MATLAB object
3:     mode – int64int32nag_int scalar
If you set mode to a negative value then nag_glopt_nlp_multistart_sqp_lsq (e05us) will terminate immediately with ${\mathbf{ifail}}={\mathbf{9}}$.
11:   repeat1 – logical scalar
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 Section [Further Comments] for more detail.
12:   nb – int64int32nag_int scalar
The number of solutions to be returned. The function 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$1$. However, if you want to look at other solutions that may have desirable properties then setting nb > 1${\mathbf{nb}}>1$ will produce nb local minima, ordered by increasing value of their objective functions at the minima.
Constraint: 1nbnpts$1\le {\mathbf{nb}}\le {\mathbf{npts}}$.
13:   iopts(740$740$) – int64int32nag_int array
14:   opts(485$485$) – double array
The arrays iopts and opts must not be altered between calls to any of the functions nag_glopt_nlp_multistart_sqp_lsq (e05us) and nag_glopt_optset (e05zk).

### Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The dimension of the array y.
m$m$, the number of subfunctions associated with F(x)$F\left(x\right)$.
Constraint: m > 0${\mathbf{m}}>0$.
2:     nclin – int64int32nag_int scalar
Default: The first dimension of the array a.
nL${n}_{L}$, the number of general linear constraints.
Constraint: nclin0${\mathbf{nclin}}\ge 0$.
3:     user – Any MATLAB object
user is not used by nag_glopt_nlp_multistart_sqp_lsq (e05us), but is passed to confun, objfun and start. Note that for large objects it may be more efficient to use a global variable which is accessible from the m-files than to use user.

### Input Parameters Omitted from the MATLAB Interface

lda ldx ldfjac sdfjac ldc ldcjac sdcjac ldclda listat iuser ruser

### Output Parameters

1:     x(ldx, : $:$) – double array
The first dimension of the array x will be n${\mathbf{n}}$
The second dimension of the array will be nb${\mathbf{nb}}$
ldxn$\mathit{ldx}\ge {\mathbf{n}}$.
x(j,i)${\mathbf{x}}\left(\mathit{j},i\right)$ contains the final estimate of the i$i$th solution, for j = 1,2,,n$\mathit{j}=1,2,\dots ,{\mathbf{n}}$.
2:     objf(nb) – double array
objf(i)${\mathbf{objf}}\left(i\right)$ contains the value of the objective function at the final iterate for the i$i$th solution.
3:     f(m, : $:$) – double array
The second dimension of the array will be nb${\mathbf{nb}}$
F(j,i)${\mathbf{F}}\left(\mathit{j},i\right)$ contains the value of the j$\mathit{j}$th function fj${f}_{j}$ at the final iterate, for j = 1,2,,m$\mathit{j}=1,2,\dots ,{\mathbf{m}}$, for the i$\mathit{i}$th solution, for i = 1,2,,nb$\mathit{i}=1,2,\dots ,{\mathbf{nb}}$.
4:     fjac(ldfjac,sdfjac, : $:$) – double array
Note: the last dimension of the array fjac must be at least nb${\mathbf{nb}}$.
ldfjacm$\mathit{ldfjac}\ge {\mathbf{m}}$.
sdfjacn$\mathit{sdfjac}\ge {\mathbf{n}}$.
For the i$i$th returned solution, the Jacobian matrix of the functions f1 , f2 ,, fm ${f}_{1},{f}_{2},\dots ,{f}_{m}$ at the final iterate, i.e., fjac(k,j,i)${\mathbf{fjac}}\left(\mathit{k},\mathit{j},\mathit{i}\right)$ contains the partial derivative of the k$\mathit{k}$th function with respect to the j$\mathit{j}$th variable, for k = 1,2,,m$\mathit{k}=1,2,\dots ,{\mathbf{m}}$, j = 1,2,,n$\mathit{j}=1,2,\dots ,{\mathbf{n}}$ and i = 1,2,,nb$\mathit{i}=1,2,\dots ,{\mathbf{nb}}$. (See also the discussion of parameter fjsl under objfun.)
5:     iter(nb) – int64int32nag_int array
iter(i)${\mathbf{iter}}\left(i\right)$ contains the number of major iterations performed to obtain the i$i$th solution. If less than nb solutions are returned then iter(nb)${\mathbf{iter}}\left({\mathbf{nb}}\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.
6:     c(ldc, : $:$) – double array
The first dimension of the array c will be ncnln${\mathbf{ncnln}}$
The second dimension of the array will be nb${\mathbf{nb}}$
ldcncnln$\mathit{ldc}\ge {\mathbf{ncnln}}$.
If ncnln > 0${\mathbf{ncnln}}>0$, c(j,i)${\mathbf{c}}\left(\mathit{j},\mathit{i}\right)$ contains the value of the j$\mathit{j}$th nonlinear constraint function cj${c}_{\mathit{j}}$ at the final iterate, for the i$\mathit{i}$th solution, for j = 1,2,,ncnln$\mathit{j}=1,2,\dots ,{\mathbf{ncnln}}$.
If ncnln = 0${\mathbf{ncnln}}=0$, the array c is not referenced.
7:     cjac(ldcjac,sdcjac, : $:$) – double array
Note: the last dimension of the array cjac must be at least nb${\mathbf{nb}}$.
ldcjacncnln$\mathit{ldcjac}\ge {\mathbf{ncnln}}$.
If ncnln > 0${\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., cjac(k,j,i)${\mathbf{cjac}}\left(\mathit{k},\mathit{j},i\right)$ contains the partial derivative of the k$\mathit{k}$th constraint function with respect to the j$\mathit{j}$th variable, for k = 1,2,,ncnln$\mathit{k}=1,2,\dots ,{\mathbf{ncnln}}$ and j = 1,2,,n$\mathit{j}=1,2,\dots ,{\mathbf{n}}$, for the i$i$th solution. (See the discussion of parameter cjsl under confun.)
If ncnln = 0${\mathbf{ncnln}}=0$, the array cjac is not referenced.
8:     clamda(ldclda, : $:$) – double array
The first dimension of the array clamda will be ${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$
The second dimension of the array will be nb${\mathbf{nb}}$
ldcldan + nclin + ncnln$\mathit{ldclda}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$.
The values of the QP multipliers from the last QP subproblem solved for the i$i$th solution. clamda(j,i)${\mathbf{clamda}}\left(j,i\right)$ should be non-negative if istate(j,i) = 1${\mathbf{istate}}\left(j,i\right)=1$ and non-positive if istate(j,i) = 2${\mathbf{istate}}\left(j,i\right)=2$.
9:     istate(listat, : $:$) – int64int32nag_int array
The first dimension of the array istate will be ${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$
The second dimension of the array will be nb${\mathbf{nb}}$
listatn + nclin + ncnln$\mathit{listat}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$.
istate(j,i)${\mathbf{istate}}\left(j,i\right)$ contains the status of the constraints in the QP working set for the i$i$th solution. The significance of each possible value of istate(j,i)${\mathbf{istate}}\left(j,i\right)$ is as follows:
 istate(j,i)${\mathbf{istate}}\left(j,i\right)$ Meaning − 0$\phantom{-}0$ The constraint is satisfied to within the feasibility tolerance, but is not in the QP working set. − 1$\phantom{-}1$ This inequality constraint is included in the QP working set at its lower bound. − 2$\phantom{-}2$ This inequality constraint is included in the QP working set at its upper bound. − 3$\phantom{-}3$ This constraint is included in the QP working set as an equality. This value of istate can occur only when bl(j) = bu(j)${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)$.
10:   iopts(740$740$) – int64int32nag_int array
11:   opts(485$485$) – double array
12:   user – Any MATLAB object
13:   info(nb) – int64int32nag_int array
If ifail > 0${\mathbf{ifail}}>0$, info(i)${\mathbf{info}}\left(i\right)$ contains an error value returned by nag_opt_lsq_gencon_deriv (e04us).
If ${\mathbf{ifail}}={\mathbf{8}}$ on exit, then not all nb solutions have been found, and info(nb)${\mathbf{info}}\left({\mathbf{nb}}\right)$ contains the number of solutions actually found.
14:   ifail – int64int32nag_int scalar
${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see [Error Indicators and Warnings]).

## Error Indicators and Warnings

Note: nag_glopt_nlp_multistart_sqp_lsq (e05us) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

ifail = 1${\mathbf{ifail}}=1$
An input value is incorrect. One or more of the following requirements are violated:
• Constraint: 1nbnpts$1\le {\mathbf{nb}}\le {\mathbf{npts}}$.
• Constraint: bl(i)bu(i)${\mathbf{bl}}\left(i\right)\le {\mathbf{bu}}\left(i\right)$, for all i$i$.
• Constraint: if ncnln > 0${\mathbf{ncnln}}>0$, sdcjacn$\mathit{sdcjac}\ge {\mathbf{n}}$.
• Constraint: ldanclin$\mathit{lda}\ge {\mathbf{nclin}}$.
• Constraint: ldcjacncnln$\mathit{ldcjac}\ge {\mathbf{ncnln}}$.
• Constraint: ldcldan + nclin + ncnln$\mathit{ldclda}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$.
• Constraint: ldcncnln$\mathit{ldc}\ge {\mathbf{ncnln}}$.
• Constraint: ldfjacm$\mathit{ldfjac}\ge {\mathbf{m}}$.
• Constraint: ldxn$\mathit{ldx}\ge {\mathbf{n}}$.
• Constraint: listatn + nclin + ncnln$\mathit{listat}\ge {\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$.
• Constraint: m > 0${\mathbf{m}}>0$.
• Constraint: n > 0${\mathbf{n}}>0$.
• Constraint: nclin0${\mathbf{nclin}}\ge 0$.
• Constraint: ncnln0${\mathbf{ncnln}}\ge 0$.
• Constraint: sdfjacn$\mathit{sdfjac}\ge {\mathbf{n}}$.
ifail = 2${\mathbf{ifail}}=2$
nag_glopt_nlp_multistart_sqp_lsq (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(macheps)$\sqrt{\mathit{macheps}}$, where macheps$\mathit{macheps}$ is 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 AL${A}_{L}$ are of order unity and are accurate to only three decimal places, Linear Feasibility Tolerance should be at least 103${10}^{-3}$.
No solution obtained. Linear constraints may be infeasible.
ifail = 3${\mathbf{ifail}}=3$
nag_glopt_nlp_multistart_sqp_lsq (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.)
No solution obtained. Nonlinear constraints may be infeasible.
ifail = 4${\mathbf{ifail}}=4$
nag_glopt_nlp_multistart_sqp_lsq (e05us) has failed to find any solutions. The majority of local optimizations have failed because the limiting number of iterations have been reached.
No solution obtained. Many potential solutions reach iteration limit.
ifail = 7${\mathbf{ifail}}=7$
User-supplied derivatives probably wrong.
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$x=0$ or x = 1$x=1$ are used to test function evaluation procedures, and how often the special properties of these numbers make the test meaningless.
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.
W ifail = 8${\mathbf{ifail}}=8$
Only _$_$ solutions obtained.
Not all nb solutions have been found. info(nb)${\mathbf{info}}\left({\mathbf{nb}}\right)$ contains the number actually found.
ifail = 9${\mathbf{ifail}}=9$
User terminated computation from start procedure.
ifail = 10${\mathbf{ifail}}=10$
Failed to initialize optional parameter arrays.
ifail = 999${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.

## Accuracy

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

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 nag_glopt_multistart_start_points (e05ucz) makes use of the NAG quasi-random Sobol generator (nag_rand_quasi_init (g05yl) and nag_rand_quasi_uniform (g05ym)). If nag_glopt_multistart_start_points (e05ucz) is used as the actual argument for start (see the description of start) and repeat1 = false${\mathbf{repeat1}}=\mathbf{false}$ then a randomly chosen value for iskip is used, otherwise iskip is set to 100$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.

### Description of the Printed Output

See Section [Description of Printed output] in (e04us).

## Example

```function nag_glopt_nlp_multistart_sqp_lsq_example
npts = int64(1);
repeat = true;
nclin = 1;
ncnln = 1;
nb = int64(1);
n = int64(2);

bl = [0.4; -4.0; 1.0; 0.0];
bu = [1e25; 1e25; 1e25; 1e25];

a = [1, 1];

x = [0.4; 0];

y = [0.49; 0.49; 0.48; 0.47; 0.48; 0.47; 0.46; 0.46; 0.45; 0.43; 0.45; ...
0.43; 0.43; 0.44; 0.43; 0.43; 0.46; 0.45; 0.42; 0.42; 0.43; 0.41 ; ...
0.41; 0.40; 0.42; 0.40; 0.40; 0.41; 0.40; 0.41; 0.41; 0.40; 0.40 ; ...
0.40; 0.38; 0.41; 0.40; 0.40; 0.41; 0.38; 0.40; 0.40; 0.39; 0.39];

% Initialise nag_glopt_nlp_multistart_sqp_lsq
[iopts, opts, ifail] = nag_glopt_optset( ...
'Initialize = nag_glopt_nlp_multistart_sqp_lsq', ...
zeros(740, 1,'int64'), zeros(485,1));
[iopts, opts, ifail] = nag_glopt_optset('List', iopts, opts);
[iopts, opts, ifail] = nag_glopt_optset('print level = 10', iopts, opts);

% Solve the problem
[x, objf, f, fjac, iter, c, cjac, clamda, istate, iopts, opts, user, ...
info, ifail] = nag_glopt_nlp_multistart_sqp_lsq(n, int64(ncnln), a, ...
bl, bu, y, @confun, @objfun, ...
npts, @start, repeat, nb, iopts, opts);

if ifail == 8
l = double(info(nb));
fprintf('\nOnly %d solutions found\n', info(nb));
else
l = double(nb);
end

for i=1:l
fprintf('\nSolution number %d\n\n', i);

fprintf('e04us returned with ifail = %d\n\n', info(i));

fprintf(' Variable Istate           Value Lagrange Multiplier\n');
for j=1:double(n)
fprintf(' %3d      %3d     %14.6g %12.4g\n', j, istate(j,i), x(j,i), clamda(j,i));
end

if nclin > 0
ax = a*x(:,i);
fprintf('\n L Con    Istate           Value Lagrange Multiplier\n');
for k=double(n+1):double(n+nclin)
j=k-n;
fprintf(' %3d      %3d     %14.6g %12.4g\n', j, istate(k,i), ax(j), clamda(k,i));
end
end

if ncnln > 0
fprintf('\n NL Con  Istate            Value Lagrange Multiplier\n');
for k=double(n+nclin+1):double(n+nclin +ncnln)
j=k-n-nclin;
fprintf(' %3d      %3d     %14.6g %12.4g\n', j, istate(k,i), c(j,i), clamda(j,i));
end
end

fprintf('\nFinal objective value = %15.7g\n', objf(i));
fprintf('clamda: ');
disp(transpose(clamda(1:double(n+nclin +ncnln),i)));
fprintf('\n ------------------------------------------------------\n');
end

function [mode, c, cjsl, user] = confun(mode, ncnln, n, ldcjsl, ...
needc, x, cjsl, nstate, user)
c = zeros(ncnln, 1);

if (nstate == 1)
% First call to confun.  Set all Jacobian elements to zero.
% Note that this will only work when 'Derivative Level = 3'
% (the default).
cjsl(1:double(ncnln),1:double(n)) = 0;
end

if ( needc(1) > 0 )

if (mode==0 || mode==2)
c(1) = -0.09 - x(1)*x(2) + 0.49*x(2);
end

if (mode==1 || mode==2)
cjsl(1,1) = -x(2);
cjsl(1,2) = -x(1) + 0.49;
end

end

function [mode, f, fjac, user] = objfun(mode, m, n, ldfj, needfi, x, fjac, ...
nstate, user)
% Evaluate the subfunctions and their 1st derivatives.

a = [ 8;  8; 10; 10; 10; 10; 12; 12; 12; 12; 14; 14; 14; 16; 16; 16; 18; ...
18; 20; 20; 20; 22; 22; 22; 24; 24; 24; 26; 26; 26; 28; 28; 30; 30; ...
30; 32; 32; 34; 36; 36; 38; 38; 40; 42];

f = zeros(m, 1);

if needfi > 0
f(needfi) = x(1) + (0.49-x(1))*exp(-x(2)*(a(needfi)-8.0));
return;
end

temp = exp(-x(2)*(a-8.0));

if (mode==0 || mode==2)
f = x(1) + (0.49-x(1))*temp;
end

if (mode==1 || mode==2)
fjac(:,1) = 1.0 - temp;
fjac(:,2) = -(0.49-x(1)).*(a-8.0).*temp;
end

function [quas, mode, user] = start(npts, quas, n, repeat, bl, bu, mode, user)
quas(1, 1) = 0.4;
quas(2, 1) = 0.0;
```
```

Calls to E05ZKF
---------------

LIST
PRINT LEVEL = 10

*** E05USF

Parameters
----------

Linear constraints.....         1       Variables..............         2
Nonlinear constraints..         1       Subfunctions...........        44

Infinite bound size....  1.00E+20       COLD start.............
Infinite step size.....  1.00E+20       EPS (machine precision)  1.11E-16
Step limit.............  2.00E+00       Hessian................        NO

Linear feasibility.....  1.05E-08       Crash tolerance........  1.00E-02
Nonlinear feasibility..  1.05E-08       Optimality tolerance...  3.26E-12
Line search tolerance..  9.00E-01       Function precision.....  4.37E-15

Derivative level.......         3       Monitoring file........        -1
Verify level...........         0

Major iterations limit.        50       Major print level......        10
Minor iterations limit.        50       Minor print level......         0

J'J initial Hessian....                 Reset frequency........         2

Workspace provided is     IWORK(       9),  WORK(     306).
To solve problem we need  IWORK(       9),  WORK(     306).

-----------------------------------------

The constraint Jacobian seems to be ok.

The largest relative error was    1.89E-08  in constraint    1

----------------------------------------

The objective Jacobian seems to be ok.

The largest relative error was    1.04E-08  in subfunction    3

Maj  Mnr    Step Merit Function Norm Gz  Violtn Cond Hz
0    2 0.0E+00   2.224070E-02 8.5E-02 3.6E-02 1.0E+00
1    1 1.0E+00   1.455402E-02 1.5E-03 9.8E-03 1.0E+00
2    1 1.0E+00   1.436491E-02 4.9E-03 7.2E-04 1.0E+00
3    1 1.0E+00   1.427013E-02 2.9E-03 9.2E-06 1.0E+00
4    1 1.0E+00   1.422989E-02 1.6E-04 3.6E-05 1.0E+00
5    1 1.0E+00   1.422983E-02 5.4E-07 6.4E-08 1.0E+00
6    1 1.0E+00   1.422983E-02 3.4E-09 9.8E-13 1.0E+00

Exit from NP problem after     6 major iterations,
8 minor iterations.

Varbl State     Value       Lower Bound   Upper Bound    Lagr Mult   Slack

V   1    FR   0.419953      0.400000          None           .      1.9953E-02
V   2    FR    1.28485      -4.00000          None           .       5.285

L Con State     Value       Lower Bound   Upper Bound    Lagr Mult   Slack

L   1    FR    1.70480       1.00000          None           .      0.7048

N Con State     Value       Lower Bound   Upper Bound    Lagr Mult   Slack

N   1    LL  -9.767742E-13       .            None      3.3358E-02 -9.7677E-13

Exit E05USF - Optimal solution found.

Final objective value =   0.1422983E-01

Solution number 1

e04us returned with ifail = 0

Variable Istate           Value Lagrange Multiplier
1        0           0.419953            0
2        0            1.28485            0

L Con    Istate           Value Lagrange Multiplier
1        0             1.7048            0

NL Con  Istate            Value Lagrange Multiplier
1        1       -9.76774e-13            0

Final objective value =      0.01422983
clamda:          0         0         0    0.0334

------------------------------------------------------

```
```function e05us_example
npts = int64(1);
repeat = true;
nclin = 1;
ncnln = 1;
nb = int64(1);
n = int64(2);

bl = [0.4; -4.0; 1.0; 0.0];
bu = [1e25; 1e25; 1e25; 1e25];

a = [1, 1];

x = [0.4; 0];

y = [0.49; 0.49; 0.48; 0.47; 0.48; 0.47; 0.46; 0.46; 0.45; 0.43; 0.45; ...
0.43; 0.43; 0.44; 0.43; 0.43; 0.46; 0.45; 0.42; 0.42; 0.43; 0.41 ; ...
0.41; 0.40; 0.42; 0.40; 0.40; 0.41; 0.40; 0.41; 0.41; 0.40; 0.40 ; ...
0.40; 0.38; 0.41; 0.40; 0.40; 0.41; 0.38; 0.40; 0.40; 0.39; 0.39];

% Initialise e05us
[iopts, opts, ifail] = e05zk('Initialize = e05us', zeros(740, 1,'int64'), ...
zeros(485,1));
[iopts, opts, ifail] = e05zk('List', iopts, opts);
[iopts, opts, ifail] = e05zk('print level = 10', iopts, opts);

% Solve the problem
[x, objf, f, fjac, iter, c, cjac, clamda, istate, iopts, opts, user, ...
info, ifail] = e05us(n, int64(ncnln), a, bl, bu, y, @confun, @objfun, ...
npts, @start, repeat, nb, iopts, opts);

if ifail == 8
l = double(info(nb));
fprintf('\nOnly %d solutions found\n', info(nb));
else
l = double(nb);
end

for i=1:l
fprintf('\nSolution number %d\n\n', i);

fprintf('e04us returned with ifail = %d\n\n', info(i));

fprintf(' Variable Istate           Value Lagrange Multiplier\n');
for j=1:double(n)
fprintf(' %3d      %3d     %14.6g %12.4g\n', j, istate(j,i), x(j,i), clamda(j,i));
end

if nclin > 0
ax = a*x(:,i);
fprintf('\n L Con    Istate           Value Lagrange Multiplier\n');
for k=double(n+1):double(n+nclin)
j=k-n;
fprintf(' %3d      %3d     %14.6g %12.4g\n', j, istate(k,i), ax(j), clamda(k,i));
end
end

if ncnln > 0
fprintf('\n NL Con  Istate            Value Lagrange Multiplier\n');
for k=double(n+nclin+1):double(n+nclin +ncnln)
j=k-n-nclin;
fprintf(' %3d      %3d     %14.6g %12.4g\n', j, istate(k,i), c(j,i), clamda(j,i));
end
end

fprintf('\nFinal objective value = %15.7g\n', objf(i));
fprintf('clamda: ');
disp(transpose(clamda(1:double(n+nclin +ncnln),i)));
fprintf('\n ------------------------------------------------------\n');
end

function [mode, c, cjsl, user] = confun(mode, ncnln, n, ldcjsl, ...
needc, x, cjsl, nstate, user)
c = zeros(ncnln, 1);

if (nstate == 1)
% First call to confun.  Set all Jacobian elements to zero.
% Note that this will only work when 'Derivative Level = 3'
% (the default).
cjsl(1:double(ncnln),1:double(n)) = 0;
end

if ( needc(1) > 0 )

if (mode==0 || mode==2)
c(1) = -0.09 - x(1)*x(2) + 0.49*x(2);
end

if (mode==1 || mode==2)
cjsl(1,1) = -x(2);
cjsl(1,2) = -x(1) + 0.49;
end

end

function [mode, f, fjac, user] = objfun(mode, m, n, ldfj, needfi, x, fjac, ...
nstate, user)
% Evaluate the subfunctions and their 1st derivatives.

a = [ 8;  8; 10; 10; 10; 10; 12; 12; 12; 12; 14; 14; 14; 16; 16; 16; 18; ...
18; 20; 20; 20; 22; 22; 22; 24; 24; 24; 26; 26; 26; 28; 28; 30; 30; ...
30; 32; 32; 34; 36; 36; 38; 38; 40; 42];

f = zeros(m, 1);

if needfi > 0
f(needfi) = x(1) + (0.49-x(1))*exp(-x(2)*(a(needfi)-8.0));
return;
end

temp = exp(-x(2)*(a-8.0));

if (mode==0 || mode==2)
f = x(1) + (0.49-x(1))*temp;
end

if (mode==1 || mode==2)
fjac(:,1) = 1.0 - temp;
fjac(:,2) = -(0.49-x(1)).*(a-8.0).*temp;
end

function [quas, mode, user] = start(npts, quas, n, repeat, bl, bu, mode, user)
quas(1, 1) = 0.4;
quas(2, 1) = 0.0;
```
```

Calls to E05ZKF
---------------

LIST
PRINT LEVEL = 10

*** E05USF

Parameters
----------

Linear constraints.....         1       Variables..............         2
Nonlinear constraints..         1       Subfunctions...........        44

Infinite bound size....  1.00E+20       COLD start.............
Infinite step size.....  1.00E+20       EPS (machine precision)  1.11E-16
Step limit.............  2.00E+00       Hessian................        NO

Linear feasibility.....  1.05E-08       Crash tolerance........  1.00E-02
Nonlinear feasibility..  1.05E-08       Optimality tolerance...  3.26E-12
Line search tolerance..  9.00E-01       Function precision.....  4.37E-15

Derivative level.......         3       Monitoring file........        -1
Verify level...........         0

Major iterations limit.        50       Major print level......        10
Minor iterations limit.        50       Minor print level......         0

J'J initial Hessian....                 Reset frequency........         2

Workspace provided is     IWORK(       9),  WORK(     306).
To solve problem we need  IWORK(       9),  WORK(     306).

-----------------------------------------

The constraint Jacobian seems to be ok.

The largest relative error was    1.89E-08  in constraint    1

----------------------------------------

The objective Jacobian seems to be ok.

The largest relative error was    1.04E-08  in subfunction    3

Maj  Mnr    Step Merit Function Norm Gz  Violtn Cond Hz
0    2 0.0E+00   2.224070E-02 8.5E-02 3.6E-02 1.0E+00
1    1 1.0E+00   1.455402E-02 1.5E-03 9.8E-03 1.0E+00
2    1 1.0E+00   1.436491E-02 4.9E-03 7.2E-04 1.0E+00
3    1 1.0E+00   1.427013E-02 2.9E-03 9.2E-06 1.0E+00
4    1 1.0E+00   1.422989E-02 1.6E-04 3.6E-05 1.0E+00
5    1 1.0E+00   1.422983E-02 5.4E-07 6.4E-08 1.0E+00
6    1 1.0E+00   1.422983E-02 3.4E-09 9.8E-13 1.0E+00

Exit from NP problem after     6 major iterations,
8 minor iterations.

Varbl State     Value       Lower Bound   Upper Bound    Lagr Mult   Slack

V   1    FR   0.419953      0.400000          None           .      1.9953E-02
V   2    FR    1.28485      -4.00000          None           .       5.285

L Con State     Value       Lower Bound   Upper Bound    Lagr Mult   Slack

L   1    FR    1.70480       1.00000          None           .      0.7048

N Con State     Value       Lower Bound   Upper Bound    Lagr Mult   Slack

N   1    LL  -9.767742E-13       .            None      3.3358E-02 -9.7677E-13

Exit E05USF - Optimal solution found.

Final objective value =   0.1422983E-01

Solution number 1

e04us returned with ifail = 0

Variable Istate           Value Lagrange Multiplier
1        0           0.419953            0
2        0            1.28485            0

L Con    Istate           Value Lagrange Multiplier
1        0             1.7048            0

NL Con  Istate            Value Lagrange Multiplier
1        1       -9.76774e-13            0

Final objective value =      0.01422983
clamda:          0         0         0    0.0334

------------------------------------------------------

```

## Algorithmic Details

See Section [Algorithmic Details] in (e04us).

## Optional Parameters

Several optional parameters in nag_glopt_nlp_multistart_sqp_lsq (e05us) define choices in the problem specification or the algorithm logic. In order to reduce the number of formal parameters of nag_glopt_nlp_multistart_sqp_lsq (e05us) these optional parameters have associated default values that are appropriate for most problems. Therefore you need only specify those optional parameters whose values are to be different from their default values.
Optional parameters may be specified by calling nag_glopt_optset (e05zk) before a call to nag_glopt_nlp_multistart_sqp_lsq (e05us). Before calling nag_glopt_nlp_multistart_sqp_lsq (e05us), the optional parameter arrays iopts and opts must be initialized for use with nag_glopt_nlp_multistart_sqp_lsq (e05us) by calling nag_glopt_optset (e05zk) with optstr set to ‘Initialize = e05usc’.
All optional parameters not specified are set to their default values. Optional parameters specified are unaltered by nag_glopt_nlp_multistart_sqp_lsq (e05us) (unless they define invalid values) and so remain in effect for subsequent calls to nag_glopt_nlp_multistart_sqp_lsq (e05us).
See Section [Optional Parameters] in (e04us) for full details.
The Warm Start option of nag_opt_lsq_gencon_deriv (e04us) is not a valid option for use with nag_glopt_nlp_multistart_sqp_lsq (e05us).

## Description of Monitoring Information

See Section [Description of Monitoring Information] in (e04us).