SlsSolve: Difference between revisions
(Created page with "==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 ...") |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:Solvers]] | |||
{{cleanup|Clean this article.}} | |||
==Purpose== | ==Purpose== | ||
Revision as of 08:23, 11 July 2011
{{#switch: | left =
{{#switch:{{#if: | {{{smallimage}}} | }} | none =| #default =
}} {{#if:{{#if: | {{{smallimageright}}} | }} | {{#ifeq:{{#if: | {{{smallimageright}}} | }}|none | | }} }}{{
#switch:left | left =| #default = }} {{#if:{{#if: | {{{smallimage}}} | }} | {{#if: | {{{smallimage}}} | }} | [[File:{{#switch:caution | critical = Ambox speedy deletion.png | important = Ambox deletion.png | warning = Ambox content.png | caution = Cleanup.png | move = Ambox move.png | protection = Ambox protection.png | notice | #default = Cleanup.png }} | {{#switch:left | left = 20x20px | #default = 40x40px }} |link=|alt=]] }}{{#switch:left | left =| #default = | {{#if:
| {{{smalltext}}} | Cleanup is needed}} | {{#switch:left
| left = {{#if: | {{{smallimageright}}} | }}| #default = {{#if:
}}| {{{smallimageright}}} |}} |
| #default =
{{#switch: | none =| #default =
}}{{#if: | {{#ifeq:|none
|| }} }}
{{
#switch: | left =| #default = }} {{#if: | | [[File:{{#switch:caution | critical = Ambox speedy deletion.png | important = Ambox deletion.png | warning = Ambox content.png | caution = Cleanup.png | move = Ambox move.png | protection = Ambox protection.png | notice | #default = Cleanup.png }} | {{#switch: | left = 20x20px | #default = 40x40px }} |link=|alt=]] }}{{#switch: | left =| #default = | Cleanup is needed Clean this article. |
{{#switch:
| left =| #default = |
}}
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 Failed to parse (unknown function "\Rdim"): {\displaystyle x,x_L,x_U \in \Rdim{n}}
, Failed to parse (unknown function "\Rdim"): {\displaystyle r(x) \in \Rdim{m}}
, Failed to parse (unknown function "\Rdim"): {\displaystyle A \in\Rdim{m_1,n}}
, Failed to parse (unknown function "\Rdim"): {\displaystyle b_L,b_U \in \Rdim{m_1}}
and Failed to parse (unknown function "\Rdim"): {\displaystyle c(x),c_L,c_U \in\Rdim{m_2}}
.
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)
Description of Inputs
Prob | Problem description structure. Should be created in the cls format, preferably by callingProb=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. |
Description of 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
Failed to parse (unknown function "\multicolumn"): {\displaystyle \begin{array}{cccccc} \min \limits_x & \multicolumn{5}{l}{\frac{1}{2} z^T z} \\ \mbox{subject to} & x_L & \leq & (x_1,x_2,\ldots,x_n) & \leq & x_U \\ {} & b_L & \leq & Ax & \leq & b_U \\ {} & c_L & \leq & c(x) & \leq & c_U \\ {} & 0 & \leq & r(x) - z & \leq & 0 \\ \end{array} }
is then solved by the solver given by Prob.SolverL2.
Examples
slsDemo.m
M-files Used
iniSolve.m, GetSolver.m