|
TOMLAB OPTIMIZATION ENVIRONMENT: slsSolve |
![]() |
slsSolve
Purpose
For finding a sparse least squares solution to a constrained least squares problem.
Description
Finds a Sparse Least Squares (sls) solution to a constrained least
squares problem with many variables, with the use of any suitable
NLP TOMLAB solver
The use is mainly for sparse problems, where the structure in both the
Jacobian of the residuals and the Jacobian of the nonlinear constraints
are utilized by a sparse NLP solver, e.g. SNOPT.
See slsDemo.m in tomlab\examples for an example
Problem
min 0.5*r'r, where r(x) is in R^m
x
s/t x_L <= x <= x_U, x is in R^n
b_L <= A x <= b_U
c_L <= c(x) <= c_U
The constrained least squares (L2) problem is solved in
slsSolve by rewriting the problem as a general constrained
optimization problem. A set of m additional variables z
, stored as x(n+1:m), is added
min 0.5*z'z,
x
s/t x_L <= x <= x_U
b_L <= A x <= b_U
c_L <= c(x) <= c_U
0 <= r(x) - z <= 0
Input Parameters
Prob Structure Prob. Prob must be defined!!!
Best is to use Prob = clsAssign(.....), if using the TQ format.
The problem should be created in the Tomlab constrained
nonlinear least squares format (cls)
This format is aimed for a vector valued function, with a
Jacobian matrix as the derivative.
PriLev The second input argument. Default == 2.
If PriLev == 0, slsSolve is silent, except for error messages.
If > 0, slsSolve prints summary output about problem
transformation
slsSolve calls PrintResult(Result,PriLev), i.e. printing in
PrintResult is made if PriLev > 0.
PriLev == 2 displays standard output in PrintResult.
Use Prob = probInit('name of file',problem_number'); if solving
a predefined problem in the Init File (IF) format.
Extra fields used in Prob:
SolverL2 Name of the Tomlab solver. Valid names are:
conSolve, nlpSolve, (sTrustr, clsSolve)
If Tomlab /SOL is installed: minos, snopt, npopt
L2Type =1 standard constrained formulation
The rest of the fields in Prob should be defined as wanted by the
selected solver. See the help for the solver.
In particular:
x_0: Starting point x_L: Lower bounds for x x_U: Upper bounds for x b_L: Lower bounds for linear constraints b_U: Upper bounds for linear constraints A: Linear constraint matrix c_L: Lower bounds for nonlinear constraints c_U: Upper bounds for nonlinear constraints ConsPattern The pattern of the constraint Jacobian JacPattern The pattern of the residual Jacobian
Note that Prob.LS.y must have the correct residual length, if
JacPattern is empty (but not ConsPattern).
slsSolve will create the new Prob.ConsPattern to be
used by the solver using the information in ConsPattern and
JacPattern.
Output Parameters
Result Structure with results from optimization. See help for the used solver
The output in Result, i.e. fields Result.x_k, Result.r_k, Result.J_k,
Result.c_k, Result.cJac, Result.x_0, Result.xState, Result.cState,
Result.v_k, is transformed back to the original problem.
Result.g_k is Result.J_k'*Result.r_k.
The output in Result.Prob is the result after slsSolve
transformed the problem, i.e. the altered Prob structure
![]() |
qpSolve | sTrustr | ![]() |