SlsSolve

From TomWiki
Jump to navigationJump to search


Purpose

Find a Sparse Least Squares (sls) solution to a constrained least squares problem with the use of any suitable TOMLAB NLP solver.

slsSolve solves problems of the type:



where , , , and .

The use of slsSolve is mainly for large, sparse problems, where the structure in the Jacobians of the residuals and the nonlinear constraints are utilized by a sparse NLP solver, e.g. SNOPT.

Calling Syntax

Result=slsSolve(Prob,PriLev)

Inputs

Prob Problem description structure. Should be created in the cls format, preferably by calling Prob=clsAssign(...) if using the TQ format.
slsSolve uses two special fields in Prob:
SolverL2 Text string with name of the NLP solver used for solving the reformulated problem. Valid choices are conSolve, nlpSolve, sTrustr, clsSolve. Suitable SOL solvers, if available: minos, snopt, npopt.
L2Type Set to 1 for standard constrained formulation. Currently this is the only allowed choice.
All other fields should be set as expected by the nonlinear solver selected. In particular:
A Linear constraint matrix.
b_L Lower bounds on the linear constraints.
b_U Upper bounds on the linear constraints.
c_L Upper bounds on the nonlinear constraints.
c_U Lower bounds on the nonlinear constraints.
x_L Lower bounds on the variables.
x_U Upper bounds on the variables.
x_0 Starting point.
ConsPattern The nonzero pattern of the constraint Jacobian.
JacPattern The nonzero pattern of the residual Jacobian.

Note that Prob.LS.y must be of correct length if JacPattern is empty (but ConsPattern is not). slsSolve will create the new Prob.ConsPattern to be used by the nonlinear solver using the information in the supplied ConsPattern and JacPattern.

PriLev Print level in slsSolve. Default value is 2.
0 Silent except for error messages.
> 1 Print summary information about problem transformation. slsSolve calls Print- Result(Result,PriLev).
2 Standard output in PrintResult.

Outputs

Result Structure with results from optimization. The contents of Result depend on which nonlinear solver was used to solved
slsSolve transforms the following fields of Result back to the format of the original problem:
x_k Optimal point.
r_k Residual at optimum.
J_k Jacobian of residuals at optimum.
c_k Nonlinear constraint vector at optimum.
v_k Lagrange multipliers.
g_k The gradient vector is calculated as J kT · r k.
cJac Jacobian of nonlinear constraints at optimum.
x_0 Starting point.
xState State of variables at optimum.
cState State of constraints at optimum.
Result.Prob The problem structure defining the reformulated problem.

Description

The constrained least squares problem is solved in slsSolve by rewriting the problem as a general constrained optimization problem. A set of m (the number of residuals) extra variables are added at the end of the vector of unknowns. The reformulated problem



is then solved by the solver given by Prob.SolverL2.

Examples

slsDemo.m

M-files Used

iniSolve.m, GetSolver.m