SOL LPOPT: Difference between revisions

From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the SOL Manual|link=SOL}} ==Direct Solver Call== A direct solver call is not recommended unless the user is 100 % sure that no other solvers will...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
==Direct Solver Call==
==Direct Solver Call==


A direct solver call is not recommended  unless the user is 100 % sure that no other solvers will be used for the problem. Please refer to Section 3.4.2 for information on how to use LPOPT with TOMLAB.
A direct solver call is not recommended  unless the user is 100 % sure that no other solvers will be used for the problem. Please refer to [[#Using TOMLAB]] for information on how to use LPOPT with TOMLAB.


===Purpose===
===Purpose===
Line 8: Line 8:
''lpopt ''solves dense linear optimization problems defined as
''lpopt ''solves dense linear optimization problems defined as


<math>
\begin{array}{ll}
\min\limits_{x} & f(x) = c^T x \\
&  \\
s/t & \begin{array}{lcccl}
& & x  & &, \\
b_{L} & \leq  & A x  & \leq & b_{U} \\
\end{array}
\end{array}
</math>
where <math>c, x \in \mathbb{R}^n</math>, <math>A \in \mathbb{R}^{m_1 \times
n}</math>, and <math>b_L,b_U \in \mathbb{R}^{n+m_1}</math>.


If isempty(c) (or all(c==0), then a feasible point problem is solved (FP). Otherwise a standard linear programming problem is solved (LP)
If isempty(c) (or all(c==0), then a feasible point problem is solved (FP). Otherwise a standard linear programming problem is solved (LP)
Line 14: Line 28:


<pre>
<pre>
[Inform, Iter, iState, Ax, cLamda, Obj, x] = lpopt(A, bl, bu, c, Warm, x, iState, SpecsFile, PrintFile,  SummFile, PriLev, optPar );
[Inform, Iter, iState, Ax, cLamda, Obj, x] = lpopt(A, bl, bu, c, Warm, x, iState, SpecsFile,  
PrintFile,  SummFile, PriLev, optPar );
</pre>
</pre>


===Description of Inputs===
===Description of Inputs===


{| class="wikitable"
{| class="wikitable"
Line 98: Line 112:
|''x ''||Solution vector with decision variable values (n x 1 vector).
|''x ''||Solution vector with decision variable values (n x 1 vector).
|}
|}
==Using TOMLAB==
===Purpose===
''lpoptTL ''solves dense linear optimization problems defined as
<math>
\begin{array}{ll}
\min\limits_{x} & f(x) = c^T x \\
&  \\
s/t & \begin{array}{lcccl}
x_{L} & \leq  & x    & \leq & x_{U}, \\
b_{L} & \leq  & A x  & \leq & b_{U} \\
\end{array}
\end{array}
</math>
where <math>c, x, x_L, x_U \in \mathbb{R}^n</math>, <math>A \in \mathbb{R}^{m_1
\times n}</math>, and <math>b_L,b_U \in \mathbb{R}^{m_1}</math>.
===Calling Syntax===
Using the driver routine ''tomRun '':
<pre>
Prob = lpAssign( ... );
Result = tomRun('lpopt',  Prob ... );
or
Prob = ProbCheck( ... );
Result = lpoptTL(Prob);
</pre>
Call Prob = lpAssign( ... ) or Prob=ProbDef to define the Prob for the second option.
===Description of Inputs===
{| class="wikitable"
!colspan="2"|''Prob'', The following fields are used:
|-valign="top"
|''x_L, x_U ''||Bounds on variables.
|-valign="top"
|''b_L, b_U ''||Bounds on linear constraints.
|-valign="top"
|''A ''||Linear constraint matrix.
|-valign="top"
|''QP.c ''||Linear coefficients in objective function.
|-valign="top"
|''PriLevOpt ''||Print level.
|-valign="top"
|''WarmStart ''||If true, use warm start, otherwise cold start.
|-valign="top"
|''SOL.xs ''||Solution and slacks from previous run.
|-valign="top"
|''SOL.iState ''||Working set (if  Warm start)  (n+m)  x 1 (DENSE) If  length(iState) ¡  n+m, setting iState(1:n+m)=0;
''iState(i)=0:''Corresponding constraint not in the initial  QP working set.
''iState(i)=1:''Inequality constraint at its lower bound in QP working set.
''iState(i)=2:''Inequality constraint at its upper bound in QP working set.
''iState(i)=3:''Equality constraint in the initial  QP working set, bl(i)==bu(i).
|-valign="top"
|''SOL.SpecsFile''||Name of user defined SPECS file, read BEFORE optPar() is used.
|-valign="top"
|''SOL.PrintFile''||Name of SOL Print file. Amount and type of printing determined by SPECS parameters or optPar parameters.
|-valign="top"
|''SOL.SummFile''||Name of SOL Summary File.
|-valign="top"
|''SOL.optPar''||Elements ''> ''-999 takes precedence over corresponding TOMLAB params. See Table 50.
|}
===Description of Outputs===
{|class="wikitable"
!colspan="2"|''Result'', The following fields are used:
|-valign="top"
|''Result''||The structure with results (see ResultDef.m).
|-valign="top"
|''f_k''||Function value at optimum.
|-valign="top"
|''x_k''||Solution vector.
|-valign="top"
|''x_0''||Initial  solution vector.
|-valign="top"
|''g_k''||Gradient c (linear objective).
|-valign="top"
|''xState''||State of variables. Free == 0; On lower == 1; On upper == 2; Fixed == 3;
|-valign="top"
|''bState''||State of linear constraints.  Free == 0; Lower == 1; Upper == 2; Equality == 3;
|-valign="top"
|''v_k''||Lagrangian multipliers (for bounds + dual solution vector).
|-valign="top"
|''ExitFlag''||Exit status from lpopt.m (similar to TOMLAB).
|-valign="top"
|''Inform''||LPOPT information parameter.
0 = Optimal solution with unique minimizer found.
1 = A dead point was reached.
2 = The solution appears to be unbounded  (or badly scaled).
3 = The constraints could not be satisfied. The problem has no feasible solu- tion.
4 = Too many iterations, in either phase.
5 = The Maximum degrees of freedom is too small. The reduced Hessian must expand if further progress is too be made.
6 = An input parameter was invalid.
7 = The problem type was not recognized. Other = UNKNOWN  LPOPT Inform value.
|-valign="top"
|''rc''||Reduced costs. If ninf=0, last m == -v k.
|-valign="top"
|''Iter ''||Number of iterations.
|-valign="top"
|''FuncEv ''||Number of function evaluations.
|-valign="top"
|''ConstrEv ''||Number of constraint evaluations.
|-valign="top"
|''QP.B ''||Basis vector in TOMLAB  QP standard. ''MinorIter ''Number of minor iterations. Not Set. ''Solver ''Name of the solver (lpopt).
|-valign="top"
|''SolverAlgorithm ''||Description of the solver.
|-valign="top"
|''SOL.xs ''||Solution and slack variables.
|-valign="top"
|''SOL.iState ''||State for variables and constraints in iState.
|}
==optPar==
===Description===
Use missing value (-999 or less), when no change of parameter setting is wanted. No call is then done to internal routines lpprmi, lpprmr and lpprm. The default value will then be used by LPOPT, unless the value is altered in the SPECS file.
===Description of Inputs===
====Table: The following fields are used:====
{| class="wikitable"
!#||SPECS keyword text||Lower||Default||Upper||Comment
|-valign="top"
|colspan="2"|'''Printing'''
|-valign="top"
|1.||PRINT LEVEL||0||10||||0,1,5,10,20,30
|-valign="top"
|colspan="2"|'''Convergence Tolerances'''
|-valign="top"
|||In LPOPT/QPOPT: macheps = 2<sup>''-''53</sup> ; eps in Matlab is = 2<sup>''-''52</sup> ;
|-valign="top"
|10.||OPTIMALITY TOLERANCE||''> ''0||1.05E-8||||sqrt(macheps)
|-valign="top"
|11.||FEASIBILITY TOLERANCE||''> ''0||1.05E-8||||sqrt(macheps)
|-valign="top"
|colspan="2"|'''Other Tolerances'''
|-valign="top"
|21.||CRASH TOLERANCE||''> ''0||0.01||''< ''1
|-valign="top"
|27.||RANK TOLERANCE||''> ''0||1.11E-14||||100*macheps
|-valign="top"
|30.||ITERATION LIMIT||''>''0||max(2000,5(n+m))
|-valign="top"
|33.||MIN SUM YES (or NO)
IF 1 (MIN  SUM YES), minimize the infeasibilities before return.
||0||0||1||1=min infeas.
|-valign="top"
|36.||FEASIBILITY PHASE ITERATIONS||''>''0||max(2000,5(n+m))
|-valign="top"
|45.||INFINITE STEP SIZE||''>''0||1E20
|-valign="top"
|colspan="2"|'''Frequencies'''
|-valign="top"
|51.||CHECK FREQUENCY||''> ''0||50
|-valign="top"
|52.||EXPAND  FREQUENCY||''> ''0||5

Latest revision as of 13:03, 22 January 2012

Notice.png

This page is part of the SOL Manual. See SOL.

Direct Solver Call

A direct solver call is not recommended unless the user is 100 % sure that no other solvers will be used for the problem. Please refer to #Using TOMLAB for information on how to use LPOPT with TOMLAB.

Purpose

lpopt solves dense linear optimization problems defined as


where , , and .

If isempty(c) (or all(c==0), then a feasible point problem is solved (FP). Otherwise a standard linear programming problem is solved (LP)

Calling Syntax

[Inform, Iter, iState, Ax, cLamda, Obj, x] = lpopt(A, bl, bu, c, Warm, x, iState, SpecsFile, 
PrintFile,  SummFile, PriLev, optPar );

Description of Inputs

The following fields are used:
A Constraint matrix, m x n (DENSE).
bl Lower bounds on (x,Ax), m+n x 1 vector (DENSE).
bu Upper bounds on (x,Ax), m+n x 1 vector (DENSE).
c Linear objective function cost coeffs, n x 1 (DENSE). If length(c) < n, setting c(1:n)=0;
Warm If Warm > 0, then warm start, otherwise cold Start. Default 0. If warm start, then x and iState must be set properly. Normally the values from last call to lpopt are used.
x Initial estimate of solution vector x. (DENSE) If length(x) ¡ n, the rest of the elements in x are set to 0.
iState Working set (if Warm start) (n+m) x 1 (DENSE) If length(iState) ¡ n+m, setting iState(1:n+m)=0;

iState(i)=0: Corresponding constraint not in the initial QP working set.

iState(i)=1: Inequality constraint at its lower bound in QP working set.

iState(i)=2: Inequality constraint at its upper bound in QP working set.

iState(i)=3: Equality constraint in the initial QP working set,bl(i)==bu(i).

SpecsFile Name of the OPTIONS File, see TOMLAB Guide.
PrintFile Name of the Print file. Name includes the path, maximal number of characters = 500.
SummFile Name of the Summary file. Name includes the path, maximal number of char- acters = 500.
PriLev Print level in the lpopt MEX-interface.

= 0 Silent.

= 1 Summary information.

= 2 More detailed information. if isempty(PriLev), set as 0.

optPar Vector with optimization parameters overriding defaults and the optionally specified SPECS file. If length(optPar) ¡ 62, lpopt sets the rest of the values to missing value (-999).

Description of Outputs

The following fields are used:
Inform Result of LPOPT run.

0 = Optimal solution with unique minimizer found.

1 = A dead point was reached.

2 = The solution appears to be unbounded (or badly scaled).

3 = The constraints could not be satisfied. The problem has no feasible solu- tion.

4 = Too many iterations, in either phase.

5 = The Maximum degrees of freedom is too small. The reduced Hessian must expand if further progress is too be made.

6 = An input parameter was invalid.

7 = The problem type was not recognized. Other = UNKNOWN LPOPT Inform value.

Iter Number of iterations.
iState Status of working set, se input description of iState.
Ax A*x.
cLamda Lagrangian multipliers (dual solution vector) (m x 1 vector).
Obj Objective function value at optimum.
x Solution vector with decision variable values (n x 1 vector).

Using TOMLAB

Purpose

lpoptTL solves dense linear optimization problems defined as


where , , and .

Calling Syntax

Using the driver routine tomRun :

Prob = lpAssign( ... );
Result = tomRun('lpopt',  Prob ... );
or
Prob = ProbCheck( ... ); 
Result = lpoptTL(Prob);

Call Prob = lpAssign( ... ) or Prob=ProbDef to define the Prob for the second option.

Description of Inputs

Prob, The following fields are used:
x_L, x_U Bounds on variables.
b_L, b_U Bounds on linear constraints.
A Linear constraint matrix.
QP.c Linear coefficients in objective function.
PriLevOpt Print level.
WarmStart If true, use warm start, otherwise cold start.
SOL.xs Solution and slacks from previous run.
SOL.iState Working set (if Warm start) (n+m) x 1 (DENSE) If length(iState) ¡ n+m, setting iState(1:n+m)=0;

iState(i)=0:Corresponding constraint not in the initial QP working set.

iState(i)=1:Inequality constraint at its lower bound in QP working set.

iState(i)=2:Inequality constraint at its upper bound in QP working set.

iState(i)=3:Equality constraint in the initial QP working set, bl(i)==bu(i).

SOL.SpecsFile Name of user defined SPECS file, read BEFORE optPar() is used.
SOL.PrintFile Name of SOL Print file. Amount and type of printing determined by SPECS parameters or optPar parameters.
SOL.SummFile Name of SOL Summary File.
SOL.optPar Elements > -999 takes precedence over corresponding TOMLAB params. See Table 50.

Description of Outputs

Result, The following fields are used:
Result The structure with results (see ResultDef.m).
f_k Function value at optimum.
x_k Solution vector.
x_0 Initial solution vector.
g_k Gradient c (linear objective).
xState State of variables. Free == 0; On lower == 1; On upper == 2; Fixed == 3;
bState State of linear constraints. Free == 0; Lower == 1; Upper == 2; Equality == 3;
v_k Lagrangian multipliers (for bounds + dual solution vector).
ExitFlag Exit status from lpopt.m (similar to TOMLAB).
Inform LPOPT information parameter.

0 = Optimal solution with unique minimizer found.

1 = A dead point was reached.

2 = The solution appears to be unbounded (or badly scaled).

3 = The constraints could not be satisfied. The problem has no feasible solu- tion.

4 = Too many iterations, in either phase.

5 = The Maximum degrees of freedom is too small. The reduced Hessian must expand if further progress is too be made.

6 = An input parameter was invalid.

7 = The problem type was not recognized. Other = UNKNOWN LPOPT Inform value.

rc Reduced costs. If ninf=0, last m == -v k.
Iter Number of iterations.
FuncEv Number of function evaluations.
ConstrEv Number of constraint evaluations.
QP.B Basis vector in TOMLAB QP standard. MinorIter Number of minor iterations. Not Set. Solver Name of the solver (lpopt).
SolverAlgorithm Description of the solver.
SOL.xs Solution and slack variables.
SOL.iState State for variables and constraints in iState.

optPar

Description

Use missing value (-999 or less), when no change of parameter setting is wanted. No call is then done to internal routines lpprmi, lpprmr and lpprm. The default value will then be used by LPOPT, unless the value is altered in the SPECS file.

Description of Inputs

Table: The following fields are used:

# SPECS keyword text Lower Default Upper Comment
Printing
1. PRINT LEVEL 0 10 0,1,5,10,20,30
Convergence Tolerances
In LPOPT/QPOPT: macheps = 2-53 ; eps in Matlab is = 2-52 ;
10. OPTIMALITY TOLERANCE > 0 1.05E-8 sqrt(macheps)
11. FEASIBILITY TOLERANCE > 0 1.05E-8 sqrt(macheps)
Other Tolerances
21. CRASH TOLERANCE > 0 0.01 < 1
27. RANK TOLERANCE > 0 1.11E-14 100*macheps
30. ITERATION LIMIT >0 max(2000,5(n+m))
33. MIN SUM YES (or NO)

IF 1 (MIN SUM YES), minimize the infeasibilities before return.

0 0 1 1=min infeas.
36. FEASIBILITY PHASE ITERATIONS >0 max(2000,5(n+m))
45. INFINITE STEP SIZE >0 1E20
Frequencies
51. CHECK FREQUENCY > 0 50
52. EXPAND FREQUENCY > 0 5